diff --git "a/partition_8.json" "b/partition_8.json" new file mode 100644--- /dev/null +++ "b/partition_8.json" @@ -0,0 +1,104050 @@ +[ + { + "hash": "c117d3173e31d74ed97c811a5ef208ab1c72c263", + "msg": "r1array and r2array converted to atleast_1d and atleast_2d", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T03:41:30+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T03:41:30+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "b6c68d69358a03fb22f25f40014cff97aed5e15c" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 37, + "insertions": 37, + "lines": 74, + "files": 20, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "weave/__init__.py", + "new_path": "weave/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -28,7 +28,7 @@ def test(level=10):\n return runner\n \n def test_suite(level=1):\n- import scipy_test\n+ import scipy_base.testing\n import scipy.weave\n this_mod = scipy.weave\n- return scipy_test.harvest_test_suites(this_mod,level=level)\n+ return scipy_base.testing.harvest_test_suites(this_mod,level=level)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\"\"\" compiler provides several tools:\n\n 1. inline() -- a function for including C/C++ code within Python\n 2. blitz() -- a function for compiling Numeric expressions to C++\n 3. ext_tools-- a module that helps construct C/C++ extension modules.\n 4. accelerate -- a module that inline accelerates Python functions\n\"\"\"\n\ntry:\n from blitz_tools import blitz\nexcept ImportError:\n pass # Numeric wasn't available \n \nfrom inline_tools import inline\nimport ext_tools\nfrom ext_tools import ext_module, ext_function\ntry:\n from accelerate_tools import accelerate\nexcept:\n pass\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy.weave\n this_mod = scipy.weave\n return scipy_base.testing.harvest_test_suites(this_mod,level=level)\n", + "source_code_before": "\"\"\" compiler provides several tools:\n\n 1. inline() -- a function for including C/C++ code within Python\n 2. blitz() -- a function for compiling Numeric expressions to C++\n 3. ext_tools-- a module that helps construct C/C++ extension modules.\n 4. accelerate -- a module that inline accelerates Python functions\n\"\"\"\n\ntry:\n from blitz_tools import blitz\nexcept ImportError:\n pass # Numeric wasn't available \n \nfrom inline_tools import inline\nimport ext_tools\nfrom ext_tools import ext_module, ext_function\ntry:\n from accelerate_tools import accelerate\nexcept:\n pass\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_test\n import scipy.weave\n this_mod = scipy.weave\n return scipy_test.harvest_test_suites(this_mod,level=level)\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 33, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 29, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 33, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "nloc": 28, + "complexity": 2, + "token_count": 93, + "diff_parsed": { + "added": [ + " import scipy_base.testing", + " return scipy_base.testing.harvest_test_suites(this_mod,level=level)" + ], + "deleted": [ + " import scipy_test", + " return scipy_test.harvest_test_suites(this_mod,level=level)" + ] + } + }, + { + "old_path": "weave/ast_tools.py", + "new_path": "weave/ast_tools.py", + "filename": "ast_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -198,11 +198,11 @@ def tuples_to_lists(ast_tuple):\n return new_list\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n \"\"\"\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"Match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "source_code_before": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"Match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "methods": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "ast_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "ast_tools.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "ast_tools.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 204, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "ast_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "ast_tools.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "ast_tools.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 204, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 204, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 123, + "complexity": 46, + "token_count": 703, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/blitz_tools.py", + "new_path": "weave/blitz_tools.py", + "filename": "blitz_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -145,11 +145,11 @@ def test_function():\n return string.join( [module_header,func,init],'\\n')\n \"\"\"\n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n if __name__ == \"__main__\":\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import parser\nimport string\nimport copy\nimport os,sys\nimport ast_tools\nimport token,symbol\nimport slice_handler\nimport size_check\nimport converters\n\nfrom ast_tools import *\n\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n \nfrom types import *\n\nimport inline_tools\nfrom inline_tools import attempt_function_call\nfunction_catalog = inline_tools.function_catalog\nfunction_cache = inline_tools.function_cache\n \ndef blitz(expr,local_dict=None, global_dict=None,check_size=1,verbose=0,**kw):\n # this could call inline, but making a copy of the\n # code here is more efficient for several reasons.\n global function_catalog\n \n # this grabs the local variables from the *previous* call\n # frame -- that is the locals from the function that called\n # inline.\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n\n # 1. Check the sizes of the arrays and make sure they are compatible.\n # This is expensive, so unsetting the check_size flag can save a lot\n # of time. It also can cause core-dumps if the sizes of the inputs \n # aren't compatible. \n if check_size and not size_check.check_expr(expr,local_dict,global_dict):\n raise 'inputs failed to pass size check.'\n \n # 2. try local cache \n try:\n results = apply(function_cache[expr],(local_dict,global_dict))\n return results\n except: \n pass\n try:\n results = attempt_function_call(expr,local_dict,global_dict)\n # 3. build the function \n except ValueError:\n # This section is pretty much the only difference \n # between blitz and inline\n ast = parser.suite(expr)\n ast_list = ast.tolist()\n expr_code = ast_to_blitz_expr(ast_list)\n arg_names = harvest_variables(ast_list)\n module_dir = global_dict.get('__file__',None)\n #func = inline_tools.compile_function(expr_code,arg_names,\n # local_dict,global_dict,\n # module_dir,auto_downcast = 1)\n func = inline_tools.compile_function(expr_code,arg_names,local_dict, \n global_dict,module_dir,\n compiler='gcc',auto_downcast=1,\n verbose = verbose,\n type_converters = converters.blitz,\n **kw)\n function_catalog.add_function(expr,func,module_dir)\n try: \n results = attempt_function_call(expr,local_dict,global_dict)\n except ValueError: \n print 'warning: compilation failed. Executing as python code'\n exec expr in global_dict, local_dict\n \ndef ast_to_blitz_expr(ast_seq):\n \"\"\" Convert an ast_sequence to a blitz expression.\n \"\"\"\n \n # Don't overwrite orignal sequence in call to transform slices.\n ast_seq = copy.deepcopy(ast_seq) \n slice_handler.transform_slices(ast_seq)\n \n # Build the actual program statement from ast_seq\n expr = ast_tools.ast_to_string(ast_seq)\n \n # Now find and replace specific symbols to convert this to\n # a blitz++ compatible statement.\n # I'm doing this with string replacement here. It could\n # also be done on the actual ast tree (and probably should from\n # a purest standpoint...).\n \n # this one isn't necessary but it helps code readability\n # and compactness. It requires that \n # Range _all = blitz::Range::all();\n # be included in the generated code. \n # These could all alternatively be done to the ast in\n # build_slice_atom()\n expr = string.replace(expr,'slice(_beg,_end)', '_all' ) \n expr = string.replace(expr,'slice', 'blitz::Range' )\n expr = string.replace(expr,'[','(')\n expr = string.replace(expr,']', ')' )\n expr = string.replace(expr,'_stp', '1' )\n \n # Instead of blitz::fromStart and blitz::toEnd. This requires\n # the following in the generated code.\n # Range _beg = blitz::fromStart;\n # Range _end = blitz::toEnd;\n #expr = string.replace(expr,'_beg', 'blitz::fromStart' )\n #expr = string.replace(expr,'_end', 'blitz::toEnd' )\n \n return expr + ';\\n'\n\ndef test_function():\n from code_blocks import module_header\n\n expr = \"ex[:,1:,1:] = k + ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,1:])\"\\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n #ast = parser.suite('a = (b + c) * sin(d)')\n ast = parser.suite(expr)\n k = 1.\n ex = ones((1,1,1),typecode=Float32)\n ca_x = ones((1,1,1),typecode=Float32)\n cb_y_x = ones((1,1,1),typecode=Float32)\n cb_z_x = ones((1,1,1),typecode=Float32)\n hz = ones((1,1,1),typecode=Float32)\n hy = ones((1,1,1),typecode=Float32)\n blitz(expr)\n \"\"\"\n ast_list = ast.tolist()\n \n expr_code = ast_to_blitz_expr(ast_list)\n arg_list = harvest_variables(ast_list)\n arg_specs = assign_variable_types(arg_list,locals())\n \n func,template_types = create_function('test_function',expr_code,arg_list,arg_specs)\n init,used_names = create_module_init('compile_sample','test_function',template_types)\n #wrapper = create_wrapper(mod_name,func_name,used_names)\n return string.join( [module_header,func,init],'\\n')\n \"\"\"\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\":\n test_function()\n", + "source_code_before": "import parser\nimport string\nimport copy\nimport os,sys\nimport ast_tools\nimport token,symbol\nimport slice_handler\nimport size_check\nimport converters\n\nfrom ast_tools import *\n\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n \nfrom types import *\n\nimport inline_tools\nfrom inline_tools import attempt_function_call\nfunction_catalog = inline_tools.function_catalog\nfunction_cache = inline_tools.function_cache\n \ndef blitz(expr,local_dict=None, global_dict=None,check_size=1,verbose=0,**kw):\n # this could call inline, but making a copy of the\n # code here is more efficient for several reasons.\n global function_catalog\n \n # this grabs the local variables from the *previous* call\n # frame -- that is the locals from the function that called\n # inline.\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n\n # 1. Check the sizes of the arrays and make sure they are compatible.\n # This is expensive, so unsetting the check_size flag can save a lot\n # of time. It also can cause core-dumps if the sizes of the inputs \n # aren't compatible. \n if check_size and not size_check.check_expr(expr,local_dict,global_dict):\n raise 'inputs failed to pass size check.'\n \n # 2. try local cache \n try:\n results = apply(function_cache[expr],(local_dict,global_dict))\n return results\n except: \n pass\n try:\n results = attempt_function_call(expr,local_dict,global_dict)\n # 3. build the function \n except ValueError:\n # This section is pretty much the only difference \n # between blitz and inline\n ast = parser.suite(expr)\n ast_list = ast.tolist()\n expr_code = ast_to_blitz_expr(ast_list)\n arg_names = harvest_variables(ast_list)\n module_dir = global_dict.get('__file__',None)\n #func = inline_tools.compile_function(expr_code,arg_names,\n # local_dict,global_dict,\n # module_dir,auto_downcast = 1)\n func = inline_tools.compile_function(expr_code,arg_names,local_dict, \n global_dict,module_dir,\n compiler='gcc',auto_downcast=1,\n verbose = verbose,\n type_converters = converters.blitz,\n **kw)\n function_catalog.add_function(expr,func,module_dir)\n try: \n results = attempt_function_call(expr,local_dict,global_dict)\n except ValueError: \n print 'warning: compilation failed. Executing as python code'\n exec expr in global_dict, local_dict\n \ndef ast_to_blitz_expr(ast_seq):\n \"\"\" Convert an ast_sequence to a blitz expression.\n \"\"\"\n \n # Don't overwrite orignal sequence in call to transform slices.\n ast_seq = copy.deepcopy(ast_seq) \n slice_handler.transform_slices(ast_seq)\n \n # Build the actual program statement from ast_seq\n expr = ast_tools.ast_to_string(ast_seq)\n \n # Now find and replace specific symbols to convert this to\n # a blitz++ compatible statement.\n # I'm doing this with string replacement here. It could\n # also be done on the actual ast tree (and probably should from\n # a purest standpoint...).\n \n # this one isn't necessary but it helps code readability\n # and compactness. It requires that \n # Range _all = blitz::Range::all();\n # be included in the generated code. \n # These could all alternatively be done to the ast in\n # build_slice_atom()\n expr = string.replace(expr,'slice(_beg,_end)', '_all' ) \n expr = string.replace(expr,'slice', 'blitz::Range' )\n expr = string.replace(expr,'[','(')\n expr = string.replace(expr,']', ')' )\n expr = string.replace(expr,'_stp', '1' )\n \n # Instead of blitz::fromStart and blitz::toEnd. This requires\n # the following in the generated code.\n # Range _beg = blitz::fromStart;\n # Range _end = blitz::toEnd;\n #expr = string.replace(expr,'_beg', 'blitz::fromStart' )\n #expr = string.replace(expr,'_end', 'blitz::toEnd' )\n \n return expr + ';\\n'\n\ndef test_function():\n from code_blocks import module_header\n\n expr = \"ex[:,1:,1:] = k + ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,1:])\"\\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n #ast = parser.suite('a = (b + c) * sin(d)')\n ast = parser.suite(expr)\n k = 1.\n ex = ones((1,1,1),typecode=Float32)\n ca_x = ones((1,1,1),typecode=Float32)\n cb_y_x = ones((1,1,1),typecode=Float32)\n cb_z_x = ones((1,1,1),typecode=Float32)\n hz = ones((1,1,1),typecode=Float32)\n hy = ones((1,1,1),typecode=Float32)\n blitz(expr)\n \"\"\"\n ast_list = ast.tolist()\n \n expr_code = ast_to_blitz_expr(ast_list)\n arg_list = harvest_variables(ast_list)\n arg_specs = assign_variable_types(arg_list,locals())\n \n func,template_types = create_function('test_function',expr_code,arg_list,arg_specs)\n init,used_names = create_module_init('compile_sample','test_function',template_types)\n #wrapper = create_wrapper(mod_name,func_name,used_names)\n return string.join( [module_header,func,init],'\\n')\n \"\"\"\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\":\n test_function()\n", + "methods": [ + { + "name": "blitz", + "long_name": "blitz( expr , local_dict = None , global_dict = None , check_size = 1 , verbose = 0 , ** kw )", + "filename": "blitz_tools.py", + "nloc": 34, + "complexity": 8, + "token_count": 216, + "parameters": [ + "expr", + "local_dict", + "global_dict", + "check_size", + "verbose", + "kw" + ], + "start_line": 27, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "ast_to_blitz_expr", + "long_name": "ast_to_blitz_expr( ast_seq )", + "filename": "blitz_tools.py", + "nloc": 10, + "complexity": 1, + "token_count": 92, + "parameters": [ + "ast_seq" + ], + "start_line": 81, + "end_line": 117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "test_function", + "long_name": "test_function( )", + "filename": "blitz_tools.py", + "nloc": 26, + "complexity": 1, + "token_count": 128, + "parameters": [], + "start_line": 119, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 147, + "end_line": 149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 151, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "blitz", + "long_name": "blitz( expr , local_dict = None , global_dict = None , check_size = 1 , verbose = 0 , ** kw )", + "filename": "blitz_tools.py", + "nloc": 34, + "complexity": 8, + "token_count": 216, + "parameters": [ + "expr", + "local_dict", + "global_dict", + "check_size", + "verbose", + "kw" + ], + "start_line": 27, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 0 + }, + { + "name": "ast_to_blitz_expr", + "long_name": "ast_to_blitz_expr( ast_seq )", + "filename": "blitz_tools.py", + "nloc": 10, + "complexity": 1, + "token_count": 92, + "parameters": [ + "ast_seq" + ], + "start_line": 81, + "end_line": 117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "test_function", + "long_name": "test_function( )", + "filename": "blitz_tools.py", + "nloc": 26, + "complexity": 1, + "token_count": 128, + "parameters": [], + "start_line": 119, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 147, + "end_line": 149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 151, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 151, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "blitz_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 147, + "end_line": 149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 98, + "complexity": 12, + "token_count": 557, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/build_tools.py", + "new_path": "weave/build_tools.py", + "filename": "build_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -447,11 +447,11 @@ def build_import_library():\n # raise DistutilsPlatformError, msg\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists():\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('gcc -v')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system('gcc -v')\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile == None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "source_code_before": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists():\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('gcc -v')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system('gcc -v')\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile == None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "methods": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 30, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 42, + "end_line": 212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 215, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 230, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 238, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 282, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 317, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 354, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 408, + "end_line": 416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 30, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 42, + "end_line": 212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 215, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 230, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 238, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 282, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 317, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 354, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 408, + "end_line": 416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 225, + "complexity": 55, + "token_count": 1409, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/catalog.py", + "new_path": "weave/catalog.py", + "filename": "catalog.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -648,9 +648,9 @@ def fast_cache(self,code,function):\n self.cache[code].insert(0,function)\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\"\"\" Track relationships between compiled extension functions & code fragments\n\n catalog keeps track of which compiled(or even standard) functions are \n related to which code fragments. It also stores these relationships\n to disk so they are remembered between Python sessions. When \n \n a = 1\n compiler.inline('printf(\"printed from C: %d\",a);',['a'] )\n \n is called, inline() first looks to see if it has seen the code \n 'printf(\"printed from C\");' before. If not, it calls \n \n catalog.get_functions('printf(\"printed from C: %d\", a);')\n \n which returns a list of all the function objects that have been compiled\n for the code fragment. Multiple functions can occur because the code\n could be compiled for different types for 'a' (although not likely in\n this case). The catalog first looks in its cache and quickly returns\n a list of the functions if possible. If the cache lookup fails, it then\n looks through possibly multiple catalog files on disk and fills its\n cache with all the functions that match the code fragment. \n \n In case where the code fragment hasn't been compiled, inline() compiles\n the code and then adds it to the catalog:\n \n function = \n catalog.add_function('printf(\"printed from C: %d\", a);',function)\n \n add_function() adds function to the front of the cache. function,\n along with the path information to its module, are also stored in a\n persistent catalog for future use by python sessions. \n\"\"\" \n\nimport os,sys,string\nimport pickle\n\ntry:\n import dbhash\n import shelve\n dumb = 0\nexcept ImportError:\n import dumb_shelve as shelve\n dumb = 1\n\n#For testing...\n#import dumb_shelve as shelve\n#dumb = 1\n\n#import shelve\n#dumb = 0\n \ndef getmodule(object):\n \"\"\" Discover the name of the module where object was defined.\n \n This is an augmented version of inspect.getmodule that can discover \n the parent module for extension functions.\n \"\"\"\n import inspect\n value = inspect.getmodule(object)\n if value is None:\n #walk trough all modules looking for function\n for name,mod in sys.modules.items():\n # try except used because of some comparison failures\n # in wxPoint code. Need to review this\n try:\n if mod and object in mod.__dict__.values():\n value = mod\n # if it is a built-in module, keep looking to see\n # if a non-builtin also has it. Otherwise quit and\n # consider the module found. (ain't perfect, but will \n # have to do for now).\n if string.find('(built-in)',str(mod)) is -1:\n break\n \n except (TypeError, KeyError):\n pass \n return value\n\ndef expr_to_filename(expr):\n \"\"\" Convert an arbitrary expr string to a valid file name.\n \n The name is based on the md5 check sum for the string and\n Something that was a little more human readable would be \n nice, but the computer doesn't seem to care.\n \"\"\"\n import md5\n base = 'sc_'\n return base + md5.new(expr).hexdigest()\n\ndef unique_file(d,expr):\n \"\"\" Generate a unqiue file name based on expr in directory d\n \n This is meant for use with building extension modules, so\n a file name is considered unique if none of the following\n extension '.cpp','.o','.so','module.so','.py', or '.pyd'\n exists in directory d. The fully qualified path to the\n new name is returned. You'll need to append your own\n extension to it before creating files.\n \"\"\"\n files = os.listdir(d)\n #base = 'scipy_compile'\n base = expr_to_filename(expr)\n for i in range(1000000):\n fname = base + `i`\n if not (fname+'.cpp' in files or\n fname+'.o' in files or\n fname+'.so' in files or\n fname+'module.so' in files or\n fname+'.py' in files or\n fname+'.pyd' in files):\n break\n return os.path.join(d,fname)\n \ndef default_dir():\n \"\"\" Return a default location to store compiled files and catalogs.\n \n XX is the Python version number in all paths listed below\n On windows, the default location is the temporary directory\n returned by gettempdir()/pythonXX.\n \n On Unix, ~/.pythonXX_compiled is the default location. If it doesn't\n exist, it is created. The directory is marked rwx------.\n \n If for some reason it isn't possible to build a default directory\n in the user's home, /tmp/_pythonXX_compiled is used. If it \n doesn't exist, it is created. The directory is marked rwx------\n to try and keep people from being able to sneak a bad module\n in on you. \n \"\"\"\n import tempfile \n python_name = \"python%d%d_compiled\" % tuple(sys.version_info[:2]) \n if sys.platform != 'win32':\n try:\n path = os.path.join(os.environ['HOME'],'.' + python_name)\n except KeyError:\n temp_dir = `os.getuid()` + '_' + python_name\n path = os.path.join(tempfile.gettempdir(),temp_dir) \n else:\n path = os.path.join(tempfile.gettempdir(),python_name)\n \n if not os.path.exists(path):\n os.mkdir(path)\n os.chmod(path,0700) # make it only accessible by this user.\n if not os.access(path,os.W_OK):\n print 'warning: default directory is not write accessible.'\n print 'defualt:', path\n return path\n\ndef intermediate_dir():\n \"\"\" Location in temp dir for storing .cpp and .o files during\n builds.\n \"\"\"\n import tempfile \n python_name = \"python%d%d_intermediate\" % tuple(sys.version_info[:2]) \n path = os.path.join(tempfile.gettempdir(),python_name)\n if not os.path.exists(path):\n os.mkdir(path)\n return path\n \ndef default_temp_dir():\n path = os.path.join(default_dir(),'temp')\n if not os.path.exists(path):\n os.mkdir(path)\n os.chmod(path,0700) # make it only accessible by this user.\n if not os.access(path,os.W_OK):\n print 'warning: default directory is not write accessible.'\n print 'defualt:', path\n return path\n\n \ndef os_dependent_catalog_name():\n \"\"\" Generate catalog name dependent on OS and Python version being used.\n \n This allows multiple platforms to have catalog files in the\n same directory without stepping on each other. For now, it \n bases the name of the value returned by sys.platform and the\n version of python being run. If this isn't enough to descriminate\n on some platforms, we can try to add other info. It has \n occured to me that if we get fancy enough to optimize for different\n architectures, then chip type might be added to the catalog name also.\n \"\"\"\n version = '%d%d' % sys.version_info[:2]\n return sys.platform+version+'compiled_catalog'\n \ndef catalog_path(module_path):\n \"\"\" Return the full path name for the catalog file in the given directory.\n \n module_path can either be a file name or a path name. If it is a \n file name, the catalog file name in its parent directory is returned.\n If it is a directory, the catalog file in that directory is returned.\n\n If module_path doesn't exist, None is returned. Note though, that the\n catalog file does *not* have to exist, only its parent. '~', shell\n variables, and relative ('.' and '..') paths are all acceptable.\n \n catalog file names are os dependent (based on sys.platform), so this \n should support multiple platforms sharing the same disk space \n (NFS mounts). See os_dependent_catalog_name() for more info.\n \"\"\"\n module_path = os.path.expanduser(module_path)\n module_path = os.path.expandvars(module_path)\n module_path = os.path.abspath(module_path)\n if not os.path.exists(module_path):\n catalog_file = None\n elif not os.path.isdir(module_path):\n module_path,dummy = os.path.split(module_path)\n catalog_file = os.path.join(module_path,os_dependent_catalog_name())\n else: \n catalog_file = os.path.join(module_path,os_dependent_catalog_name())\n return catalog_file\n\ndef get_catalog(module_path,mode='r'):\n \"\"\" Return a function catalog (shelve object) from the path module_path\n\n If module_path is a directory, the function catalog returned is\n from that directory. If module_path is an actual module_name,\n then the function catalog returned is from its parent directory.\n mode uses the standard 'c' = create, 'n' = new, 'r' = read, \n 'w' = write file open modes available for anydbm databases.\n \n Well... it should be. Stuck with dumbdbm for now and the modes\n almost don't matter. We do some checking for 'r' mode, but that\n is about it.\n \n See catalog_path() for more information on module_path.\n \"\"\"\n if mode not in ['c','r','w','n']:\n msg = \" mode must be 'c', 'n', 'r', or 'w'. See anydbm for more info\"\n raise ValueError, msg\n catalog_file = catalog_path(module_path)\n try:\n # code reliant on the fact that we are using dumbdbm\n if dumb and mode == 'r' and not os.path.exists(catalog_file+'.dat'):\n sh = None\n else:\n sh = shelve.open(catalog_file,mode)\n except: # not sure how to pin down which error to catch yet\n sh = None\n return sh\n\nclass catalog:\n \"\"\" Stores information about compiled functions both in cache and on disk.\n \n catalog stores (code, list_of_function) pairs so that all the functions\n that have been compiled for code are available for calling (usually in\n inline or blitz).\n \n catalog keeps a dictionary of previously accessed code values cached \n for quick access. It also handles the looking up of functions compiled \n in previously called Python sessions on disk in function catalogs. \n catalog searches the directories in the PYTHONCOMPILED environment \n variable in order loading functions that correspond to the given code \n fragment. A default directory is also searched for catalog functions. \n On unix, the default directory is usually '~/.pythonxx_compiled' where \n xx is the version of Python used. On windows, it is the directory \n returned by temfile.gettempdir(). Functions closer to the front are of \n the variable list are guaranteed to be closer to the front of the \n function list so that they will be called first. See \n get_cataloged_functions() for more info on how the search order is \n traversed.\n \n Catalog also handles storing information about compiled functions to\n a catalog. When writing this information, the first writable catalog\n file in PYTHONCOMPILED path is used. If a writable catalog is not\n found, it is written to the catalog in the default directory. This\n directory should always be writable.\n \"\"\"\n def __init__(self,user_path_list=None):\n \"\"\" Create a catalog for storing/searching for compiled functions. \n \n user_path_list contains directories that should be searched \n first for function catalogs. They will come before the path\n entries in the PYTHONCOMPILED environment varilable.\n \"\"\"\n if type(user_path_list) == type('string'):\n self.user_path_list = [user_path_list]\n elif user_path_list:\n self.user_path_list = user_path_list\n else:\n self.user_path_list = []\n self.cache = {}\n self.module_dir = None\n self.paths_added = 0\n \n def set_module_directory(self,module_dir):\n \"\"\" Set the path that will replace 'MODULE' in catalog searches.\n \n You should call clear_module_directory() when your finished\n working with it.\n \"\"\"\n self.module_dir = module_dir\n def get_module_directory(self):\n \"\"\" Return the path used to replace the 'MODULE' in searches.\n \"\"\"\n return self.module_dir\n def clear_module_directory(self):\n \"\"\" Reset 'MODULE' path to None so that it is ignored in searches. \n \"\"\"\n self.module_dir = None\n \n def get_environ_path(self):\n \"\"\" Return list of paths from 'PYTHONCOMPILED' environment variable.\n \n On Unix the path in PYTHONCOMPILED is a ':' separated list of\n directories. On Windows, a ';' separated list is used. \n \"\"\"\n paths = []\n if os.environ.has_key('PYTHONCOMPILED'):\n path_string = os.environ['PYTHONCOMPILED'] \n if sys.platform == 'win32':\n #probably should also look in registry\n paths = path_string.split(';')\n else: \n paths = path_string.split(':')\n return paths \n\n def build_search_order(self):\n \"\"\" Returns a list of paths that are searched for catalogs. \n \n Values specified in the catalog constructor are searched first,\n then values found in the PYTHONCOMPILED environment variable.\n The directory returned by default_dir() is always returned at\n the end of the list.\n \n There is a 'magic' path name called 'MODULE' that is replaced\n by the directory defined by set_module_directory(). If the\n module directory hasn't been set, 'MODULE' is ignored.\n \"\"\"\n \n paths = self.user_path_list + self.get_environ_path()\n search_order = []\n for path in paths:\n if path == 'MODULE':\n if self.module_dir:\n search_order.append(self.module_dir)\n else:\n search_order.append(path)\n search_order.append(default_dir())\n return search_order\n\n def get_catalog_files(self):\n \"\"\" Returns catalog file list in correct search order.\n \n Some of the catalog files may not currently exists.\n However, all will be valid locations for a catalog\n to be created (if you have write permission).\n \"\"\"\n files = map(catalog_path,self.build_search_order())\n files = filter(lambda x: x is not None,files)\n return files\n\n def get_existing_files(self):\n \"\"\" Returns all existing catalog file list in correct search order.\n \"\"\"\n files = self.get_catalog_files()\n # open every stinking file to check if it exists.\n # This is because anydbm doesn't provide a consistent naming \n # convention across platforms for its files \n existing_files = []\n for file in files:\n if get_catalog(os.path.dirname(file),'r') is not None:\n existing_files.append(file)\n # This is the non-portable (and much faster) old code\n #existing_files = filter(os.path.exists,files)\n return existing_files\n\n def get_writable_file(self,existing_only=0):\n \"\"\" Return the name of the first writable catalog file.\n \n Its parent directory must also be writable. This is so that\n compiled modules can be written to the same directory.\n \"\"\"\n # note: both file and its parent directory must be writeable\n if existing_only:\n files = self.get_existing_files()\n else:\n files = self.get_catalog_files()\n # filter for (file exists and is writable) OR directory is writable\n def file_test(x):\n from os import access, F_OK, W_OK\n return (access(x,F_OK) and access(x,W_OK) or\n access(os.path.dirname(x),W_OK))\n writable = filter(file_test,files)\n if writable:\n file = writable[0]\n else:\n file = None\n return file\n \n def get_writable_dir(self):\n \"\"\" Return the parent directory of first writable catalog file.\n \n The returned directory has write access.\n \"\"\"\n return os.path.dirname(self.get_writable_file())\n \n def unique_module_name(self,code,module_dir=None):\n \"\"\" Return full path to unique file name that in writable location.\n \n The directory for the file is the first writable directory in \n the catalog search path. The unique file name is derived from\n the code fragment. If, module_dir is specified, it is used\n to replace 'MODULE' in the search path.\n \"\"\"\n if module_dir is not None:\n self.set_module_directory(module_dir)\n try:\n d = self.get_writable_dir()\n finally:\n if module_dir is not None:\n self.clear_module_directory()\n return unique_file(d,code)\n\n def path_key(self,code):\n \"\"\" Return key for path information for functions associated with code.\n \"\"\"\n return '__path__' + code\n \n def configure_path(self,cat,code):\n \"\"\" Add the python path for the given code to the sys.path\n \n unconfigure_path() should be called as soon as possible after\n imports associated with code are finished so that sys.path \n is restored to normal.\n \"\"\"\n try:\n paths = cat[self.path_key(code)]\n self.paths_added = len(paths)\n sys.path = paths + sys.path\n except:\n self.paths_added = 0 \n \n def unconfigure_path(self):\n \"\"\" Restores sys.path to normal after calls to configure_path()\n \n Remove the previously added paths from sys.path\n \"\"\"\n sys.path = sys.path[self.paths_added:]\n self.paths_added = 0\n\n def get_cataloged_functions(self,code):\n \"\"\" Load all functions associated with code from catalog search path.\n \n Sometimes there can be trouble loading a function listed in a\n catalog file because the actual module that holds the function \n has been moved or deleted. When this happens, that catalog file\n is \"repaired\", meaning the entire entry for this function is \n removed from the file. This only affects the catalog file that\n has problems -- not the others in the search path.\n \n The \"repair\" behavior may not be needed, but I'll keep it for now.\n \"\"\"\n mode = 'r'\n cat = None\n function_list = []\n for path in self.build_search_order():\n cat = get_catalog(path,mode)\n if cat is not None and cat.has_key(code):\n # set up the python path so that modules for this\n # function can be loaded.\n self.configure_path(cat,code)\n try: \n function_list += cat[code]\n except: #SystemError and ImportError so far seen \n # problems loading a function from the catalog. Try to\n # repair the cause.\n cat.close()\n self.repair_catalog(path,code)\n self.unconfigure_path() \n return function_list\n\n\n def repair_catalog(self,catalog_path,code):\n \"\"\" Remove entry for code from catalog_path\n \n Occasionally catalog entries could get corrupted. An example\n would be when a module that had functions in the catalog was\n deleted or moved on the disk. The best current repair method is \n just to trash the entire catalog entry for this piece of code. \n This may loose function entries that are valid, but thats life.\n \n catalog_path must be writable for repair. If it isn't, the\n function exists with a warning. \n \"\"\"\n writable_cat = None\n if not os.path.exists(catalog_path):\n return\n try:\n writable_cat = get_catalog(catalog_path,'w')\n except:\n print 'warning: unable to repair catalog entry\\n %s\\n in\\n %s' % \\\n (code,catalog_path)\n return \n if writable_cat.has_key(code):\n print 'repairing catalog by removing key'\n del writable_cat[code]\n \n # it is possible that the path key doesn't exist (if the function registered\n # was a built-in function), so we have to check if the path exists before\n # arbitrarily deleting it.\n path_key = self.path_key(code) \n if writable_cat.has_key(path_key):\n del writable_cat[path_key] \n \n def get_functions_fast(self,code):\n \"\"\" Return list of functions for code from the cache.\n \n Return an empty list if the code entry is not found.\n \"\"\"\n return self.cache.get(code,[])\n \n def get_functions(self,code,module_dir=None):\n \"\"\" Return the list of functions associated with this code fragment.\n \n The cache is first searched for the function. If an entry\n in the cache is not found, then catalog files on disk are \n searched for the entry. This is slooooow, but only happens\n once per code object. All the functions found in catalog files\n on a cache miss are loaded into the cache to speed up future calls.\n The search order is as follows:\n \n 1. user specified path (from catalog initialization)\n 2. directories from the PYTHONCOMPILED environment variable\n 3. The temporary directory on your platform.\n\n The path specified by module_dir will replace the 'MODULE' \n place holder in the catalog search path. See build_search_order()\n for more info on the search path. \n \"\"\" \n # Fast!! try cache first.\n if self.cache.has_key(code):\n return self.cache[code]\n \n # 2. Slow!! read previously compiled functions from disk.\n try:\n self.set_module_directory(module_dir)\n function_list = self.get_cataloged_functions(code)\n # put function_list in cache to save future lookups.\n if function_list:\n self.cache[code] = function_list\n # return function_list, empty or otherwise.\n finally:\n self.clear_module_directory()\n return function_list\n\n def add_function(self,code,function,module_dir=None):\n \"\"\" Adds a function to the catalog.\n \n The function is added to the cache as well as the first\n writable file catalog found in the search path. If no\n code entry exists in the cache, the on disk catalogs\n are loaded into the cache and function is added to the\n beginning of the function list.\n \n The path specified by module_dir will replace the 'MODULE' \n place holder in the catalog search path. See build_search_order()\n for more info on the search path. \n \"\"\" \n\n # 1. put it in the cache.\n if self.cache.has_key(code):\n if function not in self.cache[code]:\n self.cache[code].insert(0,function)\n else:\n # if it is in the cache, then it is also\n # been persisted \n return\n else: \n # Load functions and put this one up front\n self.cache[code] = self.get_functions(code) \n self.fast_cache(code,function)\n # 2. Store the function entry to disk. \n try:\n self.set_module_directory(module_dir)\n self.add_function_persistent(code,function)\n finally:\n self.clear_module_directory()\n \n def add_function_persistent(self,code,function):\n \"\"\" Store the code->function relationship to disk.\n \n Two pieces of information are needed for loading functions\n from disk -- the function pickle (which conveniently stores\n the module name, etc.) and the path to its module's directory.\n The latter is needed so that the function can be loaded no\n matter what the user's Python path is.\n \"\"\" \n # add function to data in first writable catalog\n mode = 'c' # create if doesn't exist, otherwise, use existing\n cat_dir = self.get_writable_dir()\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n cat_dir = default_dir()\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n cat_dir = default_dir() \n cat_file = catalog_path(cat_dir)\n print 'problems with default catalog -- removing'\n import glob\n files = glob.glob(cat_file+'*')\n for f in files:\n os.remove(f)\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n raise ValueError, 'Failed to access a catalog for storing functions' \n # Prabhu was getting some corrupt catalog errors. I'll put a try/except\n # to protect against this, but should really try and track down the issue.\n function_list = [function]\n try:\n function_list = function_list + cat.get(code,[])\n except pickle.UnpicklingError:\n pass\n cat[code] = function_list\n # now add needed path information for loading function\n module = getmodule(function)\n try:\n # built in modules don't have the __file__ extension, so this\n # will fail. Just pass in this case since path additions aren't\n # needed for built-in modules.\n mod_path,f=os.path.split(os.path.abspath(module.__file__))\n pkey = self.path_key(code)\n cat[pkey] = [mod_path] + cat.get(pkey,[])\n except:\n pass\n\n def fast_cache(self,code,function):\n \"\"\" Move function to the front of the cache entry for code\n \n If future calls to the function have the same type signature,\n this will speed up access significantly because the first\n function call is correct.\n \n Note: The cache added to the inline_tools module is significantly\n faster than always calling get_functions, so this isn't\n as necessary as it used to be. Still, it's probably worth\n doing. \n \"\"\"\n try:\n if self.cache[code][0] == function:\n return\n except: # KeyError, IndexError \n pass\n try:\n self.cache[code].remove(function)\n except ValueError:\n pass\n # put new function at the beginning of the list to search.\n self.cache[code].insert(0,function)\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "source_code_before": "\"\"\" Track relationships between compiled extension functions & code fragments\n\n catalog keeps track of which compiled(or even standard) functions are \n related to which code fragments. It also stores these relationships\n to disk so they are remembered between Python sessions. When \n \n a = 1\n compiler.inline('printf(\"printed from C: %d\",a);',['a'] )\n \n is called, inline() first looks to see if it has seen the code \n 'printf(\"printed from C\");' before. If not, it calls \n \n catalog.get_functions('printf(\"printed from C: %d\", a);')\n \n which returns a list of all the function objects that have been compiled\n for the code fragment. Multiple functions can occur because the code\n could be compiled for different types for 'a' (although not likely in\n this case). The catalog first looks in its cache and quickly returns\n a list of the functions if possible. If the cache lookup fails, it then\n looks through possibly multiple catalog files on disk and fills its\n cache with all the functions that match the code fragment. \n \n In case where the code fragment hasn't been compiled, inline() compiles\n the code and then adds it to the catalog:\n \n function = \n catalog.add_function('printf(\"printed from C: %d\", a);',function)\n \n add_function() adds function to the front of the cache. function,\n along with the path information to its module, are also stored in a\n persistent catalog for future use by python sessions. \n\"\"\" \n\nimport os,sys,string\nimport pickle\n\ntry:\n import dbhash\n import shelve\n dumb = 0\nexcept ImportError:\n import dumb_shelve as shelve\n dumb = 1\n\n#For testing...\n#import dumb_shelve as shelve\n#dumb = 1\n\n#import shelve\n#dumb = 0\n \ndef getmodule(object):\n \"\"\" Discover the name of the module where object was defined.\n \n This is an augmented version of inspect.getmodule that can discover \n the parent module for extension functions.\n \"\"\"\n import inspect\n value = inspect.getmodule(object)\n if value is None:\n #walk trough all modules looking for function\n for name,mod in sys.modules.items():\n # try except used because of some comparison failures\n # in wxPoint code. Need to review this\n try:\n if mod and object in mod.__dict__.values():\n value = mod\n # if it is a built-in module, keep looking to see\n # if a non-builtin also has it. Otherwise quit and\n # consider the module found. (ain't perfect, but will \n # have to do for now).\n if string.find('(built-in)',str(mod)) is -1:\n break\n \n except (TypeError, KeyError):\n pass \n return value\n\ndef expr_to_filename(expr):\n \"\"\" Convert an arbitrary expr string to a valid file name.\n \n The name is based on the md5 check sum for the string and\n Something that was a little more human readable would be \n nice, but the computer doesn't seem to care.\n \"\"\"\n import md5\n base = 'sc_'\n return base + md5.new(expr).hexdigest()\n\ndef unique_file(d,expr):\n \"\"\" Generate a unqiue file name based on expr in directory d\n \n This is meant for use with building extension modules, so\n a file name is considered unique if none of the following\n extension '.cpp','.o','.so','module.so','.py', or '.pyd'\n exists in directory d. The fully qualified path to the\n new name is returned. You'll need to append your own\n extension to it before creating files.\n \"\"\"\n files = os.listdir(d)\n #base = 'scipy_compile'\n base = expr_to_filename(expr)\n for i in range(1000000):\n fname = base + `i`\n if not (fname+'.cpp' in files or\n fname+'.o' in files or\n fname+'.so' in files or\n fname+'module.so' in files or\n fname+'.py' in files or\n fname+'.pyd' in files):\n break\n return os.path.join(d,fname)\n \ndef default_dir():\n \"\"\" Return a default location to store compiled files and catalogs.\n \n XX is the Python version number in all paths listed below\n On windows, the default location is the temporary directory\n returned by gettempdir()/pythonXX.\n \n On Unix, ~/.pythonXX_compiled is the default location. If it doesn't\n exist, it is created. The directory is marked rwx------.\n \n If for some reason it isn't possible to build a default directory\n in the user's home, /tmp/_pythonXX_compiled is used. If it \n doesn't exist, it is created. The directory is marked rwx------\n to try and keep people from being able to sneak a bad module\n in on you. \n \"\"\"\n import tempfile \n python_name = \"python%d%d_compiled\" % tuple(sys.version_info[:2]) \n if sys.platform != 'win32':\n try:\n path = os.path.join(os.environ['HOME'],'.' + python_name)\n except KeyError:\n temp_dir = `os.getuid()` + '_' + python_name\n path = os.path.join(tempfile.gettempdir(),temp_dir) \n else:\n path = os.path.join(tempfile.gettempdir(),python_name)\n \n if not os.path.exists(path):\n os.mkdir(path)\n os.chmod(path,0700) # make it only accessible by this user.\n if not os.access(path,os.W_OK):\n print 'warning: default directory is not write accessible.'\n print 'defualt:', path\n return path\n\ndef intermediate_dir():\n \"\"\" Location in temp dir for storing .cpp and .o files during\n builds.\n \"\"\"\n import tempfile \n python_name = \"python%d%d_intermediate\" % tuple(sys.version_info[:2]) \n path = os.path.join(tempfile.gettempdir(),python_name)\n if not os.path.exists(path):\n os.mkdir(path)\n return path\n \ndef default_temp_dir():\n path = os.path.join(default_dir(),'temp')\n if not os.path.exists(path):\n os.mkdir(path)\n os.chmod(path,0700) # make it only accessible by this user.\n if not os.access(path,os.W_OK):\n print 'warning: default directory is not write accessible.'\n print 'defualt:', path\n return path\n\n \ndef os_dependent_catalog_name():\n \"\"\" Generate catalog name dependent on OS and Python version being used.\n \n This allows multiple platforms to have catalog files in the\n same directory without stepping on each other. For now, it \n bases the name of the value returned by sys.platform and the\n version of python being run. If this isn't enough to descriminate\n on some platforms, we can try to add other info. It has \n occured to me that if we get fancy enough to optimize for different\n architectures, then chip type might be added to the catalog name also.\n \"\"\"\n version = '%d%d' % sys.version_info[:2]\n return sys.platform+version+'compiled_catalog'\n \ndef catalog_path(module_path):\n \"\"\" Return the full path name for the catalog file in the given directory.\n \n module_path can either be a file name or a path name. If it is a \n file name, the catalog file name in its parent directory is returned.\n If it is a directory, the catalog file in that directory is returned.\n\n If module_path doesn't exist, None is returned. Note though, that the\n catalog file does *not* have to exist, only its parent. '~', shell\n variables, and relative ('.' and '..') paths are all acceptable.\n \n catalog file names are os dependent (based on sys.platform), so this \n should support multiple platforms sharing the same disk space \n (NFS mounts). See os_dependent_catalog_name() for more info.\n \"\"\"\n module_path = os.path.expanduser(module_path)\n module_path = os.path.expandvars(module_path)\n module_path = os.path.abspath(module_path)\n if not os.path.exists(module_path):\n catalog_file = None\n elif not os.path.isdir(module_path):\n module_path,dummy = os.path.split(module_path)\n catalog_file = os.path.join(module_path,os_dependent_catalog_name())\n else: \n catalog_file = os.path.join(module_path,os_dependent_catalog_name())\n return catalog_file\n\ndef get_catalog(module_path,mode='r'):\n \"\"\" Return a function catalog (shelve object) from the path module_path\n\n If module_path is a directory, the function catalog returned is\n from that directory. If module_path is an actual module_name,\n then the function catalog returned is from its parent directory.\n mode uses the standard 'c' = create, 'n' = new, 'r' = read, \n 'w' = write file open modes available for anydbm databases.\n \n Well... it should be. Stuck with dumbdbm for now and the modes\n almost don't matter. We do some checking for 'r' mode, but that\n is about it.\n \n See catalog_path() for more information on module_path.\n \"\"\"\n if mode not in ['c','r','w','n']:\n msg = \" mode must be 'c', 'n', 'r', or 'w'. See anydbm for more info\"\n raise ValueError, msg\n catalog_file = catalog_path(module_path)\n try:\n # code reliant on the fact that we are using dumbdbm\n if dumb and mode == 'r' and not os.path.exists(catalog_file+'.dat'):\n sh = None\n else:\n sh = shelve.open(catalog_file,mode)\n except: # not sure how to pin down which error to catch yet\n sh = None\n return sh\n\nclass catalog:\n \"\"\" Stores information about compiled functions both in cache and on disk.\n \n catalog stores (code, list_of_function) pairs so that all the functions\n that have been compiled for code are available for calling (usually in\n inline or blitz).\n \n catalog keeps a dictionary of previously accessed code values cached \n for quick access. It also handles the looking up of functions compiled \n in previously called Python sessions on disk in function catalogs. \n catalog searches the directories in the PYTHONCOMPILED environment \n variable in order loading functions that correspond to the given code \n fragment. A default directory is also searched for catalog functions. \n On unix, the default directory is usually '~/.pythonxx_compiled' where \n xx is the version of Python used. On windows, it is the directory \n returned by temfile.gettempdir(). Functions closer to the front are of \n the variable list are guaranteed to be closer to the front of the \n function list so that they will be called first. See \n get_cataloged_functions() for more info on how the search order is \n traversed.\n \n Catalog also handles storing information about compiled functions to\n a catalog. When writing this information, the first writable catalog\n file in PYTHONCOMPILED path is used. If a writable catalog is not\n found, it is written to the catalog in the default directory. This\n directory should always be writable.\n \"\"\"\n def __init__(self,user_path_list=None):\n \"\"\" Create a catalog for storing/searching for compiled functions. \n \n user_path_list contains directories that should be searched \n first for function catalogs. They will come before the path\n entries in the PYTHONCOMPILED environment varilable.\n \"\"\"\n if type(user_path_list) == type('string'):\n self.user_path_list = [user_path_list]\n elif user_path_list:\n self.user_path_list = user_path_list\n else:\n self.user_path_list = []\n self.cache = {}\n self.module_dir = None\n self.paths_added = 0\n \n def set_module_directory(self,module_dir):\n \"\"\" Set the path that will replace 'MODULE' in catalog searches.\n \n You should call clear_module_directory() when your finished\n working with it.\n \"\"\"\n self.module_dir = module_dir\n def get_module_directory(self):\n \"\"\" Return the path used to replace the 'MODULE' in searches.\n \"\"\"\n return self.module_dir\n def clear_module_directory(self):\n \"\"\" Reset 'MODULE' path to None so that it is ignored in searches. \n \"\"\"\n self.module_dir = None\n \n def get_environ_path(self):\n \"\"\" Return list of paths from 'PYTHONCOMPILED' environment variable.\n \n On Unix the path in PYTHONCOMPILED is a ':' separated list of\n directories. On Windows, a ';' separated list is used. \n \"\"\"\n paths = []\n if os.environ.has_key('PYTHONCOMPILED'):\n path_string = os.environ['PYTHONCOMPILED'] \n if sys.platform == 'win32':\n #probably should also look in registry\n paths = path_string.split(';')\n else: \n paths = path_string.split(':')\n return paths \n\n def build_search_order(self):\n \"\"\" Returns a list of paths that are searched for catalogs. \n \n Values specified in the catalog constructor are searched first,\n then values found in the PYTHONCOMPILED environment variable.\n The directory returned by default_dir() is always returned at\n the end of the list.\n \n There is a 'magic' path name called 'MODULE' that is replaced\n by the directory defined by set_module_directory(). If the\n module directory hasn't been set, 'MODULE' is ignored.\n \"\"\"\n \n paths = self.user_path_list + self.get_environ_path()\n search_order = []\n for path in paths:\n if path == 'MODULE':\n if self.module_dir:\n search_order.append(self.module_dir)\n else:\n search_order.append(path)\n search_order.append(default_dir())\n return search_order\n\n def get_catalog_files(self):\n \"\"\" Returns catalog file list in correct search order.\n \n Some of the catalog files may not currently exists.\n However, all will be valid locations for a catalog\n to be created (if you have write permission).\n \"\"\"\n files = map(catalog_path,self.build_search_order())\n files = filter(lambda x: x is not None,files)\n return files\n\n def get_existing_files(self):\n \"\"\" Returns all existing catalog file list in correct search order.\n \"\"\"\n files = self.get_catalog_files()\n # open every stinking file to check if it exists.\n # This is because anydbm doesn't provide a consistent naming \n # convention across platforms for its files \n existing_files = []\n for file in files:\n if get_catalog(os.path.dirname(file),'r') is not None:\n existing_files.append(file)\n # This is the non-portable (and much faster) old code\n #existing_files = filter(os.path.exists,files)\n return existing_files\n\n def get_writable_file(self,existing_only=0):\n \"\"\" Return the name of the first writable catalog file.\n \n Its parent directory must also be writable. This is so that\n compiled modules can be written to the same directory.\n \"\"\"\n # note: both file and its parent directory must be writeable\n if existing_only:\n files = self.get_existing_files()\n else:\n files = self.get_catalog_files()\n # filter for (file exists and is writable) OR directory is writable\n def file_test(x):\n from os import access, F_OK, W_OK\n return (access(x,F_OK) and access(x,W_OK) or\n access(os.path.dirname(x),W_OK))\n writable = filter(file_test,files)\n if writable:\n file = writable[0]\n else:\n file = None\n return file\n \n def get_writable_dir(self):\n \"\"\" Return the parent directory of first writable catalog file.\n \n The returned directory has write access.\n \"\"\"\n return os.path.dirname(self.get_writable_file())\n \n def unique_module_name(self,code,module_dir=None):\n \"\"\" Return full path to unique file name that in writable location.\n \n The directory for the file is the first writable directory in \n the catalog search path. The unique file name is derived from\n the code fragment. If, module_dir is specified, it is used\n to replace 'MODULE' in the search path.\n \"\"\"\n if module_dir is not None:\n self.set_module_directory(module_dir)\n try:\n d = self.get_writable_dir()\n finally:\n if module_dir is not None:\n self.clear_module_directory()\n return unique_file(d,code)\n\n def path_key(self,code):\n \"\"\" Return key for path information for functions associated with code.\n \"\"\"\n return '__path__' + code\n \n def configure_path(self,cat,code):\n \"\"\" Add the python path for the given code to the sys.path\n \n unconfigure_path() should be called as soon as possible after\n imports associated with code are finished so that sys.path \n is restored to normal.\n \"\"\"\n try:\n paths = cat[self.path_key(code)]\n self.paths_added = len(paths)\n sys.path = paths + sys.path\n except:\n self.paths_added = 0 \n \n def unconfigure_path(self):\n \"\"\" Restores sys.path to normal after calls to configure_path()\n \n Remove the previously added paths from sys.path\n \"\"\"\n sys.path = sys.path[self.paths_added:]\n self.paths_added = 0\n\n def get_cataloged_functions(self,code):\n \"\"\" Load all functions associated with code from catalog search path.\n \n Sometimes there can be trouble loading a function listed in a\n catalog file because the actual module that holds the function \n has been moved or deleted. When this happens, that catalog file\n is \"repaired\", meaning the entire entry for this function is \n removed from the file. This only affects the catalog file that\n has problems -- not the others in the search path.\n \n The \"repair\" behavior may not be needed, but I'll keep it for now.\n \"\"\"\n mode = 'r'\n cat = None\n function_list = []\n for path in self.build_search_order():\n cat = get_catalog(path,mode)\n if cat is not None and cat.has_key(code):\n # set up the python path so that modules for this\n # function can be loaded.\n self.configure_path(cat,code)\n try: \n function_list += cat[code]\n except: #SystemError and ImportError so far seen \n # problems loading a function from the catalog. Try to\n # repair the cause.\n cat.close()\n self.repair_catalog(path,code)\n self.unconfigure_path() \n return function_list\n\n\n def repair_catalog(self,catalog_path,code):\n \"\"\" Remove entry for code from catalog_path\n \n Occasionally catalog entries could get corrupted. An example\n would be when a module that had functions in the catalog was\n deleted or moved on the disk. The best current repair method is \n just to trash the entire catalog entry for this piece of code. \n This may loose function entries that are valid, but thats life.\n \n catalog_path must be writable for repair. If it isn't, the\n function exists with a warning. \n \"\"\"\n writable_cat = None\n if not os.path.exists(catalog_path):\n return\n try:\n writable_cat = get_catalog(catalog_path,'w')\n except:\n print 'warning: unable to repair catalog entry\\n %s\\n in\\n %s' % \\\n (code,catalog_path)\n return \n if writable_cat.has_key(code):\n print 'repairing catalog by removing key'\n del writable_cat[code]\n \n # it is possible that the path key doesn't exist (if the function registered\n # was a built-in function), so we have to check if the path exists before\n # arbitrarily deleting it.\n path_key = self.path_key(code) \n if writable_cat.has_key(path_key):\n del writable_cat[path_key] \n \n def get_functions_fast(self,code):\n \"\"\" Return list of functions for code from the cache.\n \n Return an empty list if the code entry is not found.\n \"\"\"\n return self.cache.get(code,[])\n \n def get_functions(self,code,module_dir=None):\n \"\"\" Return the list of functions associated with this code fragment.\n \n The cache is first searched for the function. If an entry\n in the cache is not found, then catalog files on disk are \n searched for the entry. This is slooooow, but only happens\n once per code object. All the functions found in catalog files\n on a cache miss are loaded into the cache to speed up future calls.\n The search order is as follows:\n \n 1. user specified path (from catalog initialization)\n 2. directories from the PYTHONCOMPILED environment variable\n 3. The temporary directory on your platform.\n\n The path specified by module_dir will replace the 'MODULE' \n place holder in the catalog search path. See build_search_order()\n for more info on the search path. \n \"\"\" \n # Fast!! try cache first.\n if self.cache.has_key(code):\n return self.cache[code]\n \n # 2. Slow!! read previously compiled functions from disk.\n try:\n self.set_module_directory(module_dir)\n function_list = self.get_cataloged_functions(code)\n # put function_list in cache to save future lookups.\n if function_list:\n self.cache[code] = function_list\n # return function_list, empty or otherwise.\n finally:\n self.clear_module_directory()\n return function_list\n\n def add_function(self,code,function,module_dir=None):\n \"\"\" Adds a function to the catalog.\n \n The function is added to the cache as well as the first\n writable file catalog found in the search path. If no\n code entry exists in the cache, the on disk catalogs\n are loaded into the cache and function is added to the\n beginning of the function list.\n \n The path specified by module_dir will replace the 'MODULE' \n place holder in the catalog search path. See build_search_order()\n for more info on the search path. \n \"\"\" \n\n # 1. put it in the cache.\n if self.cache.has_key(code):\n if function not in self.cache[code]:\n self.cache[code].insert(0,function)\n else:\n # if it is in the cache, then it is also\n # been persisted \n return\n else: \n # Load functions and put this one up front\n self.cache[code] = self.get_functions(code) \n self.fast_cache(code,function)\n # 2. Store the function entry to disk. \n try:\n self.set_module_directory(module_dir)\n self.add_function_persistent(code,function)\n finally:\n self.clear_module_directory()\n \n def add_function_persistent(self,code,function):\n \"\"\" Store the code->function relationship to disk.\n \n Two pieces of information are needed for loading functions\n from disk -- the function pickle (which conveniently stores\n the module name, etc.) and the path to its module's directory.\n The latter is needed so that the function can be loaded no\n matter what the user's Python path is.\n \"\"\" \n # add function to data in first writable catalog\n mode = 'c' # create if doesn't exist, otherwise, use existing\n cat_dir = self.get_writable_dir()\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n cat_dir = default_dir()\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n cat_dir = default_dir() \n cat_file = catalog_path(cat_dir)\n print 'problems with default catalog -- removing'\n import glob\n files = glob.glob(cat_file+'*')\n for f in files:\n os.remove(f)\n cat = get_catalog(cat_dir,mode)\n if cat is None:\n raise ValueError, 'Failed to access a catalog for storing functions' \n # Prabhu was getting some corrupt catalog errors. I'll put a try/except\n # to protect against this, but should really try and track down the issue.\n function_list = [function]\n try:\n function_list = function_list + cat.get(code,[])\n except pickle.UnpicklingError:\n pass\n cat[code] = function_list\n # now add needed path information for loading function\n module = getmodule(function)\n try:\n # built in modules don't have the __file__ extension, so this\n # will fail. Just pass in this case since path additions aren't\n # needed for built-in modules.\n mod_path,f=os.path.split(os.path.abspath(module.__file__))\n pkey = self.path_key(code)\n cat[pkey] = [mod_path] + cat.get(pkey,[])\n except:\n pass\n\n def fast_cache(self,code,function):\n \"\"\" Move function to the front of the cache entry for code\n \n If future calls to the function have the same type signature,\n this will speed up access significantly because the first\n function call is correct.\n \n Note: The cache added to the inline_tools module is significantly\n faster than always calling get_functions, so this isn't\n as necessary as it used to be. Still, it's probably worth\n doing. \n \"\"\"\n try:\n if self.cache[code][0] == function:\n return\n except: # KeyError, IndexError \n pass\n try:\n self.cache[code].remove(function)\n except ValueError:\n pass\n # put new function at the beginning of the list to search.\n self.cache[code].insert(0,function)\n \ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "methods": [ + { + "name": "getmodule", + "long_name": "getmodule( object )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 7, + "token_count": 79, + "parameters": [ + "object" + ], + "start_line": 52, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "expr_to_filename", + "long_name": "expr_to_filename( expr )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "expr" + ], + "start_line": 79, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "unique_file", + "long_name": "unique_file( d , expr )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 8, + "token_count": 89, + "parameters": [ + "d", + "expr" + ], + "start_line": 90, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "default_dir", + "long_name": "default_dir( )", + "filename": "catalog.py", + "nloc": 18, + "complexity": 5, + "token_count": 145, + "parameters": [], + "start_line": 114, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "intermediate_dir", + "long_name": "intermediate_dir( )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 56, + "parameters": [], + "start_line": 149, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "default_temp_dir", + "long_name": "default_temp_dir( )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 3, + "token_count": 64, + "parameters": [], + "start_line": 160, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "os_dependent_catalog_name", + "long_name": "os_dependent_catalog_name( )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [], + "start_line": 171, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "catalog_path", + "long_name": "catalog_path( module_path )", + "filename": "catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 105, + "parameters": [ + "module_path" + ], + "start_line": 185, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "get_catalog", + "long_name": "get_catalog( module_path , mode = 'r' )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 6, + "token_count": 80, + "parameters": [ + "module_path", + "mode" + ], + "start_line": 212, + "end_line": 239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , user_path_list = None )", + "filename": "catalog.py", + "nloc": 10, + "complexity": 3, + "token_count": 60, + "parameters": [ + "self", + "user_path_list" + ], + "start_line": 268, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "set_module_directory", + "long_name": "set_module_directory( self , module_dir )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "module_dir" + ], + "start_line": 285, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "get_module_directory", + "long_name": "get_module_directory( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "clear_module_directory", + "long_name": "clear_module_directory( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_environ_path", + "long_name": "get_environ_path( self )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "build_search_order", + "long_name": "build_search_order( self )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 62, + "parameters": [ + "self" + ], + "start_line": 317, + "end_line": 339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "get_catalog_files", + "long_name": "get_catalog_files( self )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_existing_files", + "long_name": "get_existing_files( self )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 3, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 352, + "end_line": 365, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "get_writable_file.file_test", + "long_name": "get_writable_file.file_test( x )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 3, + "token_count": 43, + "parameters": [ + "x" + ], + "start_line": 379, + "end_line": 382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 2 + }, + { + "name": "get_writable_file", + "long_name": "get_writable_file( self , existing_only = 0 )", + "filename": "catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "existing_only" + ], + "start_line": 367, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "get_writable_dir", + "long_name": "get_writable_dir( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 390, + "end_line": 395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "unique_module_name", + "long_name": "unique_module_name( self , code , module_dir = None )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 4, + "token_count": 53, + "parameters": [ + "self", + "code", + "module_dir" + ], + "start_line": 397, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "path_key", + "long_name": "path_key( self , code )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "code" + ], + "start_line": 414, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "configure_path", + "long_name": "configure_path( self , cat , code )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "self", + "cat", + "code" + ], + "start_line": 419, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "unconfigure_path", + "long_name": "unconfigure_path( self )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 433, + "end_line": 439, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "get_cataloged_functions", + "long_name": "get_cataloged_functions( self , code )", + "filename": "catalog.py", + "nloc": 15, + "complexity": 5, + "token_count": 86, + "parameters": [ + "self", + "code" + ], + "start_line": 441, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "repair_catalog", + "long_name": "repair_catalog( self , catalog_path , code )", + "filename": "catalog.py", + "nloc": 16, + "complexity": 5, + "token_count": 83, + "parameters": [ + "self", + "catalog_path", + "code" + ], + "start_line": 473, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "get_functions_fast", + "long_name": "get_functions_fast( self , code )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "code" + ], + "start_line": 505, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_functions", + "long_name": "get_functions( self , code , module_dir = None )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 65, + "parameters": [ + "self", + "code", + "module_dir" + ], + "start_line": 512, + "end_line": 544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_function", + "long_name": "add_function( self , code , function , module_dir = None )", + "filename": "catalog.py", + "nloc": 14, + "complexity": 4, + "token_count": 97, + "parameters": [ + "self", + "code", + "function", + "module_dir" + ], + "start_line": 546, + "end_line": 577, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + }, + { + "name": "add_function_persistent", + "long_name": "add_function_persistent( self , code , function )", + "filename": "catalog.py", + "nloc": 31, + "complexity": 7, + "token_count": 194, + "parameters": [ + "self", + "code", + "function" + ], + "start_line": 579, + "end_line": 624, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "fast_cache", + "long_name": "fast_cache( self , code , function )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 59, + "parameters": [ + "self", + "code", + "function" + ], + "start_line": 626, + "end_line": 648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 650, + "end_line": 652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 654, + "end_line": 656, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "getmodule", + "long_name": "getmodule( object )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 7, + "token_count": 79, + "parameters": [ + "object" + ], + "start_line": 52, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "expr_to_filename", + "long_name": "expr_to_filename( expr )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "expr" + ], + "start_line": 79, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "unique_file", + "long_name": "unique_file( d , expr )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 8, + "token_count": 89, + "parameters": [ + "d", + "expr" + ], + "start_line": 90, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "default_dir", + "long_name": "default_dir( )", + "filename": "catalog.py", + "nloc": 18, + "complexity": 5, + "token_count": 145, + "parameters": [], + "start_line": 114, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 34, + "top_nesting_level": 0 + }, + { + "name": "intermediate_dir", + "long_name": "intermediate_dir( )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 56, + "parameters": [], + "start_line": 149, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "default_temp_dir", + "long_name": "default_temp_dir( )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 3, + "token_count": 64, + "parameters": [], + "start_line": 160, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "os_dependent_catalog_name", + "long_name": "os_dependent_catalog_name( )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [], + "start_line": 171, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "catalog_path", + "long_name": "catalog_path( module_path )", + "filename": "catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 105, + "parameters": [ + "module_path" + ], + "start_line": 185, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "get_catalog", + "long_name": "get_catalog( module_path , mode = 'r' )", + "filename": "catalog.py", + "nloc": 13, + "complexity": 6, + "token_count": 80, + "parameters": [ + "module_path", + "mode" + ], + "start_line": 212, + "end_line": 239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , user_path_list = None )", + "filename": "catalog.py", + "nloc": 10, + "complexity": 3, + "token_count": 60, + "parameters": [ + "self", + "user_path_list" + ], + "start_line": 268, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "set_module_directory", + "long_name": "set_module_directory( self , module_dir )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "self", + "module_dir" + ], + "start_line": 285, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "get_module_directory", + "long_name": "get_module_directory( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "clear_module_directory", + "long_name": "clear_module_directory( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "get_environ_path", + "long_name": "get_environ_path( self )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "build_search_order", + "long_name": "build_search_order( self )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 62, + "parameters": [ + "self" + ], + "start_line": 317, + "end_line": 339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "get_catalog_files", + "long_name": "get_catalog_files( self )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "get_existing_files", + "long_name": "get_existing_files( self )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 3, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 352, + "end_line": 365, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "get_writable_file.file_test", + "long_name": "get_writable_file.file_test( x )", + "filename": "catalog.py", + "nloc": 4, + "complexity": 3, + "token_count": 43, + "parameters": [ + "x" + ], + "start_line": 379, + "end_line": 382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 2 + }, + { + "name": "get_writable_file", + "long_name": "get_writable_file( self , existing_only = 0 )", + "filename": "catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "existing_only" + ], + "start_line": 367, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "get_writable_dir", + "long_name": "get_writable_dir( self )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 390, + "end_line": 395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "unique_module_name", + "long_name": "unique_module_name( self , code , module_dir = None )", + "filename": "catalog.py", + "nloc": 9, + "complexity": 4, + "token_count": 53, + "parameters": [ + "self", + "code", + "module_dir" + ], + "start_line": 397, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "path_key", + "long_name": "path_key( self , code )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "code" + ], + "start_line": 414, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "configure_path", + "long_name": "configure_path( self , cat , code )", + "filename": "catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "self", + "cat", + "code" + ], + "start_line": 419, + "end_line": 431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "unconfigure_path", + "long_name": "unconfigure_path( self )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 433, + "end_line": 439, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "get_cataloged_functions", + "long_name": "get_cataloged_functions( self , code )", + "filename": "catalog.py", + "nloc": 15, + "complexity": 5, + "token_count": 86, + "parameters": [ + "self", + "code" + ], + "start_line": 441, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "repair_catalog", + "long_name": "repair_catalog( self , catalog_path , code )", + "filename": "catalog.py", + "nloc": 16, + "complexity": 5, + "token_count": 83, + "parameters": [ + "self", + "catalog_path", + "code" + ], + "start_line": 473, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "get_functions_fast", + "long_name": "get_functions_fast( self , code )", + "filename": "catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "code" + ], + "start_line": 505, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "get_functions", + "long_name": "get_functions( self , code , module_dir = None )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 65, + "parameters": [ + "self", + "code", + "module_dir" + ], + "start_line": 512, + "end_line": 544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "add_function", + "long_name": "add_function( self , code , function , module_dir = None )", + "filename": "catalog.py", + "nloc": 14, + "complexity": 4, + "token_count": 97, + "parameters": [ + "self", + "code", + "function", + "module_dir" + ], + "start_line": 546, + "end_line": 577, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + }, + { + "name": "add_function_persistent", + "long_name": "add_function_persistent( self , code , function )", + "filename": "catalog.py", + "nloc": 31, + "complexity": 7, + "token_count": 194, + "parameters": [ + "self", + "code", + "function" + ], + "start_line": 579, + "end_line": 624, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 1 + }, + { + "name": "fast_cache", + "long_name": "fast_cache( self , code , function )", + "filename": "catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 59, + "parameters": [ + "self", + "code", + "function" + ], + "start_line": 626, + "end_line": 648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 650, + "end_line": 652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 654, + "end_line": 656, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 654, + "end_line": 656, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 650, + "end_line": 652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 351, + "complexity": 100, + "token_count": 1926, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/common_spec.py", + "new_path": "weave/common_spec.py", + "filename": "common_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -64,9 +64,9 @@ def declaration_code(self,templatize = 0,inline=0):\n return code \n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "from base_spec import base_converter\nimport common_info\nfrom types import *\nimport os\n\nclass common_base_converter(base_converter):\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name \n return new_spec\n def __repr__(self):\n msg = \"(file:: name: %s)\" % self.name\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__)\n \n \nclass file_converter(common_base_converter):\n type_name = 'file'\n _build_information = [common_info.file_info()]\n def type_match(self,value):\n return type(value) in [FileType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n #code = 'PyObject* py_%s = %s;\\n' \\\n # 'FILE* %s = convert_to_file(py_%s,\"%s\");\\n' % \\\n # (self.name,var_name,self.name,self.name,self.name)\n code = 'PyObject* py_%s = %s;\\n' \\\n 'FILE* %s = convert_to_file(py_%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name,self.name,self.name)\n return code \n def cleanup_code(self):\n # could use Py_DECREF here I think and save NULL test.\n code = \"Py_XDECREF(py_%s);\\n\" % self.name\n return code\n\nclass callable_converter(common_base_converter):\n type_name = 'callable'\n _build_information = [common_info.callable_info()]\n def type_match(self,value):\n # probably should test for callable classes here also.\n return type(value) in [FunctionType,MethodType,type(len)]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'PyObject* %s = convert_to_callable(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n\nclass instance_converter(common_base_converter):\n type_name = 'instance'\n _build_information = [common_info.instance_info()]\n def type_match(self,value):\n return type(value) in [InstanceType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'PyObject* %s = convert_to_instance(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "source_code_before": "from base_spec import base_converter\nimport common_info\nfrom types import *\nimport os\n\nclass common_base_converter(base_converter):\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name \n return new_spec\n def __repr__(self):\n msg = \"(file:: name: %s)\" % self.name\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__)\n \n \nclass file_converter(common_base_converter):\n type_name = 'file'\n _build_information = [common_info.file_info()]\n def type_match(self,value):\n return type(value) in [FileType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n #code = 'PyObject* py_%s = %s;\\n' \\\n # 'FILE* %s = convert_to_file(py_%s,\"%s\");\\n' % \\\n # (self.name,var_name,self.name,self.name,self.name)\n code = 'PyObject* py_%s = %s;\\n' \\\n 'FILE* %s = convert_to_file(py_%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name,self.name,self.name)\n return code \n def cleanup_code(self):\n # could use Py_DECREF here I think and save NULL test.\n code = \"Py_XDECREF(py_%s);\\n\" % self.name\n return code\n\nclass callable_converter(common_base_converter):\n type_name = 'callable'\n _build_information = [common_info.callable_info()]\n def type_match(self,value):\n # probably should test for callable classes here also.\n return type(value) in [FunctionType,MethodType,type(len)]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'PyObject* %s = convert_to_callable(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n\nclass instance_converter(common_base_converter):\n type_name = 'instance'\n _build_information = [common_info.instance_info()]\n def type_match(self,value):\n return type(value) in [InstanceType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'PyObject* %s = convert_to_instance(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "methods": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "common_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 7, + "end_line": 11, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 12, + "end_line": 14, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "other" + ], + "start_line": 15, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 24, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 27, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "cleanup_code", + "long_name": "cleanup_code( self )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "value" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 48, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 57, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 60, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 66, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 70, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "common_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 7, + "end_line": 11, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 12, + "end_line": 14, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "other" + ], + "start_line": 15, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 24, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 27, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "cleanup_code", + "long_name": "cleanup_code( self )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "value" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 48, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "common_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 57, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "common_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 60, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 66, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 70, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 70, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "common_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 66, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 55, + "complexity": 13, + "token_count": 394, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/ext_tools.py", + "new_path": "weave/ext_tools.py", + "filename": "ext_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -413,9 +413,9 @@ def format_error_msg(errors):\n return msg.getvalue()\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import os, sys\nimport string, re\n\nimport catalog \nimport build_tools\nimport converters\nimport base_spec\n\nclass ext_function_from_specs:\n def __init__(self,name,code_block,arg_specs):\n self.name = name\n self.arg_specs = base_spec.arg_spec_list(arg_specs)\n self.code_block = code_block\n self.compiler = ''\n self.customize = base_info.custom_info()\n \n def header_code(self):\n pass\n\n def function_declaration_code(self):\n code = 'static PyObject* %s(PyObject*self, PyObject* args,' \\\n ' PyObject* kywds)\\n{\\n'\n return code % self.name\n\n def template_declaration_code(self):\n code = 'template\\n' \\\n 'static PyObject* %s(PyObject*self, PyObject* args,' \\\n ' PyObject* kywds)\\n{\\n'\n return code % self.name\n\n #def cpp_function_declaration_code(self):\n # pass\n #def cpp_function_call_code(self):\n #s pass\n \n def parse_tuple_code(self):\n \"\"\" Create code block for PyArg_ParseTuple. Variable declarations\n for all PyObjects are done also.\n \n This code got a lot uglier when I added local_dict...\n \"\"\"\n join = string.join\n\n declare_return = 'PyObject *return_val = NULL;\\n' \\\n 'int exception_occured = 0;\\n' \\\n 'PyObject *py_local_dict = NULL;\\n'\n arg_string_list = self.arg_specs.variable_as_strings() + ['\"local_dict\"']\n arg_strings = join(arg_string_list,',')\n if arg_strings: arg_strings += ','\n declare_kwlist = 'static char *kwlist[] = {%s NULL};\\n' % arg_strings\n\n py_objects = join(self.arg_specs.py_pointers(),', ')\n if py_objects:\n declare_py_objects = 'PyObject ' + py_objects +';\\n'\n else:\n declare_py_objects = ''\n \n py_vars = join(self.arg_specs.py_variables(),' = ')\n if py_vars:\n init_values = py_vars + ' = NULL;\\n\\n'\n else:\n init_values = '' \n\n #Each variable is in charge of its own cleanup now.\n #cnt = len(arg_list)\n #declare_cleanup = \"blitz::TinyVector clean_up(0);\\n\" % cnt\n\n ref_string = join(self.arg_specs.py_references(),', ')\n if ref_string:\n ref_string += ', &py_local_dict'\n else:\n ref_string = '&py_local_dict'\n \n format = \"O\"* len(self.arg_specs) + \"|O\" + ':' + self.name\n parse_tuple = 'if(!PyArg_ParseTupleAndKeywords(args,' \\\n 'kywds,\"%s\",kwlist,%s))\\n' % (format,ref_string)\n parse_tuple += ' return NULL;\\n'\n\n return declare_return + declare_kwlist + declare_py_objects \\\n + init_values + parse_tuple\n\n def arg_declaration_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.declaration_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_cleanup_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.cleanup_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_local_dict_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.local_dict_code())\n code = string.join(arg_strings,\"\")\n return code\n \n def function_code(self):\n decl_code = indent(self.arg_declaration_code(),4)\n cleanup_code = indent(self.arg_cleanup_code(),4)\n function_code = indent(self.code_block,4)\n local_dict_code = indent(self.arg_local_dict_code(),4)\n\n dict_code = \"if(py_local_dict) \\n\" \\\n \"{ \\n\" \\\n \" Py::Dict local_dict = Py::Dict(py_local_dict); \\n\" + \\\n local_dict_code + \\\n \"} \\n\"\n\n try_code = \"try \\n\" \\\n \"{ \\n\" + \\\n decl_code + \\\n \" /**/ \\n\" + \\\n function_code + \\\n indent(dict_code,4) + \\\n \"\\n} \\n\"\n catch_code = \"catch(...) \\n\" \\\n \"{ \\n\" + \\\n \" return_val = Py::Null(); \\n\" \\\n \" exception_occured = 1; \\n\" \\\n \"} \\n\"\n\n return_code = \" /*cleanup code*/ \\n\" + \\\n cleanup_code + \\\n \" if(!return_val && !exception_occured)\\n\" \\\n \" {\\n \\n\" \\\n \" Py_INCREF(Py_None); \\n\" \\\n \" return_val = Py_None; \\n\" \\\n \" }\\n \\n\" \\\n \" return return_val; \\n\" \\\n \"} \\n\"\n\n all_code = self.function_declaration_code() + \\\n indent(self.parse_tuple_code(),4) + \\\n indent(try_code,4) + \\\n indent(catch_code,4) + \\\n return_code\n\n return all_code\n\n def python_function_definition_code(self):\n args = (self.name, self.name)\n function_decls = '{\"%s\",(PyCFunction)%s , METH_VARARGS|' \\\n 'METH_KEYWORDS},\\n' % args\n return function_decls\n\n def set_compiler(self,compiler):\n self.compiler = compiler\n for arg in self.arg_specs:\n arg.set_compiler(compiler)\n\n\nclass ext_function(ext_function_from_specs):\n def __init__(self,name,code_block, args, local_dict=None, global_dict=None,\n auto_downcast=1, type_converters=None):\n \n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n if type_converters is None:\n type_converters = converters.default\n arg_specs = assign_variable_types(args,local_dict, global_dict,\n auto_downcast, type_converters)\n ext_function_from_specs.__init__(self,name,code_block,arg_specs)\n \n \nimport base_info, common_info, cxx_info, scalar_info\n\nclass ext_module:\n def __init__(self,name,compiler=''):\n standard_info = [common_info.basic_module_info(),\n common_info.file_info(), \n common_info.instance_info(), \n common_info.callable_info(), \n common_info.module_info(), \n cxx_info.cxx_info(),\n scalar_info.scalar_info()]\n self.name = name\n self.functions = []\n self.compiler = compiler\n self.customize = base_info.custom_info()\n self._build_information = base_info.info_list(standard_info)\n \n def add_function(self,func):\n self.functions.append(func)\n def module_code(self):\n code = self.warning_code() + \\\n self.header_code() + \\\n self.support_code() + \\\n self.function_code() + \\\n self.python_function_definition_code() + \\\n self.module_init_code()\n return code\n\n def arg_specs(self):\n all_arg_specs = base_spec.arg_spec_list()\n for func in self.functions:\n all_arg_specs += func.arg_specs\n return all_arg_specs\n\n def build_information(self):\n info = [self.customize] + self._build_information + \\\n self.arg_specs().build_information()\n for func in self.functions:\n info.append(func.customize)\n #redundant, but easiest place to make sure compiler is set\n for i in info:\n i.set_compiler(self.compiler)\n return info\n \n def get_headers(self):\n all_headers = self.build_information().headers()\n\n # blitz/array.h always needs to be first so we hack that here...\n if '\"blitz/array.h\"' in all_headers:\n all_headers.remove('\"blitz/array.h\"')\n all_headers.insert(0,'\"blitz/array.h\"')\n return all_headers\n\n def warning_code(self):\n all_warnings = self.build_information().warnings()\n w=map(lambda x: \"#pragma warning(%s)\\n\" % x,all_warnings)\n return ''.join(w)\n \n def header_code(self):\n h = self.get_headers()\n h= map(lambda x: '#include ' + x + '\\n',h)\n return ''.join(h)\n\n def support_code(self):\n code = self.build_information().support_code()\n return ''.join(code)\n\n def function_code(self):\n all_function_code = \"\"\n for func in self.functions:\n all_function_code += func.function_code()\n return ''.join(all_function_code)\n\n def python_function_definition_code(self):\n all_definition_code = \"\"\n for func in self.functions:\n all_definition_code += func.python_function_definition_code()\n all_definition_code = indent(''.join(all_definition_code),4)\n code = 'static PyMethodDef compiled_methods[] = \\n' \\\n '{\\n' \\\n '%s' \\\n ' {NULL, NULL} /* Sentinel */\\n' \\\n '};\\n'\n return code % (all_definition_code)\n\n def module_init_code(self):\n init_code_list = self.build_information().module_init_code()\n init_code = indent(''.join(init_code_list),4)\n code = 'extern \"C\" void init%s()\\n' \\\n '{\\n' \\\n '%s' \\\n ' (void) Py_InitModule(\"%s\", compiled_methods);\\n' \\\n '}\\n' % (self.name,init_code,self.name)\n return code\n\n def generate_file(self,file_name=\"\",location='.'):\n code = self.module_code()\n if not file_name:\n file_name = self.name + '.cpp'\n name = generate_file_name(file_name,location)\n #return name\n return generate_module(code,name)\n\n def set_compiler(self,compiler):\n #for i in self.arg_specs()\n # i.set_compiler(compiler)\n for i in self.build_information():\n i.set_compiler(compiler) \n for i in self.functions:\n i.set_compiler(compiler)\n self.compiler = compiler \n \n def compile(self,location='.',compiler=None, verbose = 0, **kw):\n \n if compiler is not None:\n self.compiler = compiler\n # hmm. Is there a cleaner way to do this? Seems like\n # choosing the compiler spagettis around a little.\n compiler = build_tools.choose_compiler(self.compiler) \n self.set_compiler(compiler)\n arg_specs = self.arg_specs()\n info = self.build_information()\n _source_files = info.sources()\n # remove duplicates\n source_files = {}\n for i in _source_files:\n source_files[i] = None\n source_files = source_files.keys()\n \n # add internally specified macros, includes, etc. to the key words\n # values of the same names so that distutils will use them.\n kw['define_macros'] = kw.get('define_macros',[]) + info.define_macros()\n kw['include_dirs'] = kw.get('include_dirs',[]) + info.include_dirs()\n kw['libraries'] = kw.get('libraries',[]) + info.libraries()\n kw['library_dirs'] = kw.get('library_dirs',[]) + info.library_dirs()\n \n file = self.generate_file(location=location)\n # This is needed so that files build correctly even when different\n # versions of Python are running around.\n # Imported at beginning of file now to help with test paths.\n # import catalog \n #temp = catalog.default_temp_dir()\n # for speed, build in the machines temp directory\n temp = catalog.intermediate_dir()\n success = build_tools.build_extension(file, temp_dir = temp,\n sources = source_files, \n compiler_name = compiler,\n verbose = verbose, **kw)\n if not success:\n raise SystemError, 'Compilation failed'\n\ndef generate_file_name(module_name,module_location):\n module_file = os.path.join(module_location,module_name)\n return os.path.abspath(module_file)\n\ndef generate_module(module_string, module_file):\n f =open(module_file,'w')\n f.write(module_string)\n f.close()\n return module_file\n\ndef assign_variable_types(variables,local_dict = {}, global_dict = {},\n auto_downcast = 1,\n type_converters = converters.default):\n incoming_vars = {}\n incoming_vars.update(global_dict)\n incoming_vars.update(local_dict)\n variable_specs = []\n errors={}\n for var in variables:\n try:\n example_type = incoming_vars[var]\n\n # look through possible type specs to find which one\n # should be used to for example_type\n spec = None\n for factory in type_converters:\n if factory.type_match(example_type):\n spec = factory.type_spec(var,example_type)\n break\n if not spec:\n # should really define our own type.\n raise IndexError\n else:\n variable_specs.append(spec)\n except KeyError:\n errors[var] = (\"The type and dimensionality specifications\" +\n \"for variable '\" + var + \"' are missing.\")\n except IndexError:\n errors[var] = (\"Unable to convert variable '\"+ var +\n \"' to a C++ type.\")\n if errors:\n raise TypeError, format_error_msg(errors)\n\n if auto_downcast:\n variable_specs = downcast(variable_specs)\n return variable_specs\n\ndef downcast(var_specs):\n \"\"\" Cast python scalars down to most common type of\n arrays used.\n\n Right now, focus on complex and float types. Ignore int types.\n Require all arrays to have same type before forcing downcasts.\n\n Note: var_specs are currently altered in place (horrors...!)\n \"\"\"\n numeric_types = []\n\n #grab all the numeric types associated with a variables.\n for var in var_specs:\n if hasattr(var,'numeric_type'):\n numeric_types.append(var.numeric_type)\n\n # if arrays are present, but none of them are double precision,\n # make all numeric types float or complex(float)\n if ( ('f' in numeric_types or 'F' in numeric_types) and\n not ('d' in numeric_types or 'D' in numeric_types) ):\n for var in var_specs:\n if hasattr(var,'numeric_type'):\n # really should do this some other way...\n if var.numeric_type == type(1+1j):\n var.numeric_type = 'F'\n elif var.numeric_type == type(1.):\n var.numeric_type = 'f'\n return var_specs\n\ndef indent(st,spaces):\n indention = ' '*spaces\n indented = indention + string.replace(st,'\\n','\\n'+indention)\n # trim off any trailing spaces\n indented = re.sub(r' +$',r'',indented)\n return indented\n\ndef format_error_msg(errors):\n #minimum effort right now...\n import pprint,cStringIO\n msg = cStringIO.StringIO()\n pprint.pprint(errors,msg)\n return msg.getvalue()\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "source_code_before": "import os, sys\nimport string, re\n\nimport catalog \nimport build_tools\nimport converters\nimport base_spec\n\nclass ext_function_from_specs:\n def __init__(self,name,code_block,arg_specs):\n self.name = name\n self.arg_specs = base_spec.arg_spec_list(arg_specs)\n self.code_block = code_block\n self.compiler = ''\n self.customize = base_info.custom_info()\n \n def header_code(self):\n pass\n\n def function_declaration_code(self):\n code = 'static PyObject* %s(PyObject*self, PyObject* args,' \\\n ' PyObject* kywds)\\n{\\n'\n return code % self.name\n\n def template_declaration_code(self):\n code = 'template\\n' \\\n 'static PyObject* %s(PyObject*self, PyObject* args,' \\\n ' PyObject* kywds)\\n{\\n'\n return code % self.name\n\n #def cpp_function_declaration_code(self):\n # pass\n #def cpp_function_call_code(self):\n #s pass\n \n def parse_tuple_code(self):\n \"\"\" Create code block for PyArg_ParseTuple. Variable declarations\n for all PyObjects are done also.\n \n This code got a lot uglier when I added local_dict...\n \"\"\"\n join = string.join\n\n declare_return = 'PyObject *return_val = NULL;\\n' \\\n 'int exception_occured = 0;\\n' \\\n 'PyObject *py_local_dict = NULL;\\n'\n arg_string_list = self.arg_specs.variable_as_strings() + ['\"local_dict\"']\n arg_strings = join(arg_string_list,',')\n if arg_strings: arg_strings += ','\n declare_kwlist = 'static char *kwlist[] = {%s NULL};\\n' % arg_strings\n\n py_objects = join(self.arg_specs.py_pointers(),', ')\n if py_objects:\n declare_py_objects = 'PyObject ' + py_objects +';\\n'\n else:\n declare_py_objects = ''\n \n py_vars = join(self.arg_specs.py_variables(),' = ')\n if py_vars:\n init_values = py_vars + ' = NULL;\\n\\n'\n else:\n init_values = '' \n\n #Each variable is in charge of its own cleanup now.\n #cnt = len(arg_list)\n #declare_cleanup = \"blitz::TinyVector clean_up(0);\\n\" % cnt\n\n ref_string = join(self.arg_specs.py_references(),', ')\n if ref_string:\n ref_string += ', &py_local_dict'\n else:\n ref_string = '&py_local_dict'\n \n format = \"O\"* len(self.arg_specs) + \"|O\" + ':' + self.name\n parse_tuple = 'if(!PyArg_ParseTupleAndKeywords(args,' \\\n 'kywds,\"%s\",kwlist,%s))\\n' % (format,ref_string)\n parse_tuple += ' return NULL;\\n'\n\n return declare_return + declare_kwlist + declare_py_objects \\\n + init_values + parse_tuple\n\n def arg_declaration_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.declaration_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_cleanup_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.cleanup_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_local_dict_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.local_dict_code())\n code = string.join(arg_strings,\"\")\n return code\n \n def function_code(self):\n decl_code = indent(self.arg_declaration_code(),4)\n cleanup_code = indent(self.arg_cleanup_code(),4)\n function_code = indent(self.code_block,4)\n local_dict_code = indent(self.arg_local_dict_code(),4)\n\n dict_code = \"if(py_local_dict) \\n\" \\\n \"{ \\n\" \\\n \" Py::Dict local_dict = Py::Dict(py_local_dict); \\n\" + \\\n local_dict_code + \\\n \"} \\n\"\n\n try_code = \"try \\n\" \\\n \"{ \\n\" + \\\n decl_code + \\\n \" /**/ \\n\" + \\\n function_code + \\\n indent(dict_code,4) + \\\n \"\\n} \\n\"\n catch_code = \"catch(...) \\n\" \\\n \"{ \\n\" + \\\n \" return_val = Py::Null(); \\n\" \\\n \" exception_occured = 1; \\n\" \\\n \"} \\n\"\n\n return_code = \" /*cleanup code*/ \\n\" + \\\n cleanup_code + \\\n \" if(!return_val && !exception_occured)\\n\" \\\n \" {\\n \\n\" \\\n \" Py_INCREF(Py_None); \\n\" \\\n \" return_val = Py_None; \\n\" \\\n \" }\\n \\n\" \\\n \" return return_val; \\n\" \\\n \"} \\n\"\n\n all_code = self.function_declaration_code() + \\\n indent(self.parse_tuple_code(),4) + \\\n indent(try_code,4) + \\\n indent(catch_code,4) + \\\n return_code\n\n return all_code\n\n def python_function_definition_code(self):\n args = (self.name, self.name)\n function_decls = '{\"%s\",(PyCFunction)%s , METH_VARARGS|' \\\n 'METH_KEYWORDS},\\n' % args\n return function_decls\n\n def set_compiler(self,compiler):\n self.compiler = compiler\n for arg in self.arg_specs:\n arg.set_compiler(compiler)\n\n\nclass ext_function(ext_function_from_specs):\n def __init__(self,name,code_block, args, local_dict=None, global_dict=None,\n auto_downcast=1, type_converters=None):\n \n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n if type_converters is None:\n type_converters = converters.default\n arg_specs = assign_variable_types(args,local_dict, global_dict,\n auto_downcast, type_converters)\n ext_function_from_specs.__init__(self,name,code_block,arg_specs)\n \n \nimport base_info, common_info, cxx_info, scalar_info\n\nclass ext_module:\n def __init__(self,name,compiler=''):\n standard_info = [common_info.basic_module_info(),\n common_info.file_info(), \n common_info.instance_info(), \n common_info.callable_info(), \n common_info.module_info(), \n cxx_info.cxx_info(),\n scalar_info.scalar_info()]\n self.name = name\n self.functions = []\n self.compiler = compiler\n self.customize = base_info.custom_info()\n self._build_information = base_info.info_list(standard_info)\n \n def add_function(self,func):\n self.functions.append(func)\n def module_code(self):\n code = self.warning_code() + \\\n self.header_code() + \\\n self.support_code() + \\\n self.function_code() + \\\n self.python_function_definition_code() + \\\n self.module_init_code()\n return code\n\n def arg_specs(self):\n all_arg_specs = base_spec.arg_spec_list()\n for func in self.functions:\n all_arg_specs += func.arg_specs\n return all_arg_specs\n\n def build_information(self):\n info = [self.customize] + self._build_information + \\\n self.arg_specs().build_information()\n for func in self.functions:\n info.append(func.customize)\n #redundant, but easiest place to make sure compiler is set\n for i in info:\n i.set_compiler(self.compiler)\n return info\n \n def get_headers(self):\n all_headers = self.build_information().headers()\n\n # blitz/array.h always needs to be first so we hack that here...\n if '\"blitz/array.h\"' in all_headers:\n all_headers.remove('\"blitz/array.h\"')\n all_headers.insert(0,'\"blitz/array.h\"')\n return all_headers\n\n def warning_code(self):\n all_warnings = self.build_information().warnings()\n w=map(lambda x: \"#pragma warning(%s)\\n\" % x,all_warnings)\n return ''.join(w)\n \n def header_code(self):\n h = self.get_headers()\n h= map(lambda x: '#include ' + x + '\\n',h)\n return ''.join(h)\n\n def support_code(self):\n code = self.build_information().support_code()\n return ''.join(code)\n\n def function_code(self):\n all_function_code = \"\"\n for func in self.functions:\n all_function_code += func.function_code()\n return ''.join(all_function_code)\n\n def python_function_definition_code(self):\n all_definition_code = \"\"\n for func in self.functions:\n all_definition_code += func.python_function_definition_code()\n all_definition_code = indent(''.join(all_definition_code),4)\n code = 'static PyMethodDef compiled_methods[] = \\n' \\\n '{\\n' \\\n '%s' \\\n ' {NULL, NULL} /* Sentinel */\\n' \\\n '};\\n'\n return code % (all_definition_code)\n\n def module_init_code(self):\n init_code_list = self.build_information().module_init_code()\n init_code = indent(''.join(init_code_list),4)\n code = 'extern \"C\" void init%s()\\n' \\\n '{\\n' \\\n '%s' \\\n ' (void) Py_InitModule(\"%s\", compiled_methods);\\n' \\\n '}\\n' % (self.name,init_code,self.name)\n return code\n\n def generate_file(self,file_name=\"\",location='.'):\n code = self.module_code()\n if not file_name:\n file_name = self.name + '.cpp'\n name = generate_file_name(file_name,location)\n #return name\n return generate_module(code,name)\n\n def set_compiler(self,compiler):\n #for i in self.arg_specs()\n # i.set_compiler(compiler)\n for i in self.build_information():\n i.set_compiler(compiler) \n for i in self.functions:\n i.set_compiler(compiler)\n self.compiler = compiler \n \n def compile(self,location='.',compiler=None, verbose = 0, **kw):\n \n if compiler is not None:\n self.compiler = compiler\n # hmm. Is there a cleaner way to do this? Seems like\n # choosing the compiler spagettis around a little.\n compiler = build_tools.choose_compiler(self.compiler) \n self.set_compiler(compiler)\n arg_specs = self.arg_specs()\n info = self.build_information()\n _source_files = info.sources()\n # remove duplicates\n source_files = {}\n for i in _source_files:\n source_files[i] = None\n source_files = source_files.keys()\n \n # add internally specified macros, includes, etc. to the key words\n # values of the same names so that distutils will use them.\n kw['define_macros'] = kw.get('define_macros',[]) + info.define_macros()\n kw['include_dirs'] = kw.get('include_dirs',[]) + info.include_dirs()\n kw['libraries'] = kw.get('libraries',[]) + info.libraries()\n kw['library_dirs'] = kw.get('library_dirs',[]) + info.library_dirs()\n \n file = self.generate_file(location=location)\n # This is needed so that files build correctly even when different\n # versions of Python are running around.\n # Imported at beginning of file now to help with test paths.\n # import catalog \n #temp = catalog.default_temp_dir()\n # for speed, build in the machines temp directory\n temp = catalog.intermediate_dir()\n success = build_tools.build_extension(file, temp_dir = temp,\n sources = source_files, \n compiler_name = compiler,\n verbose = verbose, **kw)\n if not success:\n raise SystemError, 'Compilation failed'\n\ndef generate_file_name(module_name,module_location):\n module_file = os.path.join(module_location,module_name)\n return os.path.abspath(module_file)\n\ndef generate_module(module_string, module_file):\n f =open(module_file,'w')\n f.write(module_string)\n f.close()\n return module_file\n\ndef assign_variable_types(variables,local_dict = {}, global_dict = {},\n auto_downcast = 1,\n type_converters = converters.default):\n incoming_vars = {}\n incoming_vars.update(global_dict)\n incoming_vars.update(local_dict)\n variable_specs = []\n errors={}\n for var in variables:\n try:\n example_type = incoming_vars[var]\n\n # look through possible type specs to find which one\n # should be used to for example_type\n spec = None\n for factory in type_converters:\n if factory.type_match(example_type):\n spec = factory.type_spec(var,example_type)\n break\n if not spec:\n # should really define our own type.\n raise IndexError\n else:\n variable_specs.append(spec)\n except KeyError:\n errors[var] = (\"The type and dimensionality specifications\" +\n \"for variable '\" + var + \"' are missing.\")\n except IndexError:\n errors[var] = (\"Unable to convert variable '\"+ var +\n \"' to a C++ type.\")\n if errors:\n raise TypeError, format_error_msg(errors)\n\n if auto_downcast:\n variable_specs = downcast(variable_specs)\n return variable_specs\n\ndef downcast(var_specs):\n \"\"\" Cast python scalars down to most common type of\n arrays used.\n\n Right now, focus on complex and float types. Ignore int types.\n Require all arrays to have same type before forcing downcasts.\n\n Note: var_specs are currently altered in place (horrors...!)\n \"\"\"\n numeric_types = []\n\n #grab all the numeric types associated with a variables.\n for var in var_specs:\n if hasattr(var,'numeric_type'):\n numeric_types.append(var.numeric_type)\n\n # if arrays are present, but none of them are double precision,\n # make all numeric types float or complex(float)\n if ( ('f' in numeric_types or 'F' in numeric_types) and\n not ('d' in numeric_types or 'D' in numeric_types) ):\n for var in var_specs:\n if hasattr(var,'numeric_type'):\n # really should do this some other way...\n if var.numeric_type == type(1+1j):\n var.numeric_type = 'F'\n elif var.numeric_type == type(1.):\n var.numeric_type = 'f'\n return var_specs\n\ndef indent(st,spaces):\n indention = ' '*spaces\n indented = indention + string.replace(st,'\\n','\\n'+indention)\n # trim off any trailing spaces\n indented = re.sub(r' +$',r'',indented)\n return indented\n\ndef format_error_msg(errors):\n #minimum effort right now...\n import pprint,cStringIO\n msg = cStringIO.StringIO()\n pprint.pprint(errors,msg)\n return msg.getvalue()\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self , name , code_block , arg_specs )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self", + "name", + "code_block", + "arg_specs" + ], + "start_line": 10, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "header_code", + "long_name": "header_code( self )", + "filename": "ext_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 6, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "function_declaration_code", + "long_name": "function_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 20, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "template_declaration_code", + "long_name": "template_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 25, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "parse_tuple_code", + "long_name": "parse_tuple_code( self )", + "filename": "ext_tools.py", + "nloc": 30, + "complexity": 5, + "token_count": 174, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "arg_declaration_code", + "long_name": "arg_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 82, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_cleanup_code", + "long_name": "arg_cleanup_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_local_dict_code", + "long_name": "arg_local_dict_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "ext_tools.py", + "nloc": 37, + "complexity": 1, + "token_count": 162, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 146, + "end_line": 150, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "set_compiler", + "long_name": "set_compiler( self , compiler )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "compiler" + ], + "start_line": 152, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , code_block , args , local_dict = None , global_dict = None , auto_downcast = 1 , type_converters = None )", + "filename": "ext_tools.py", + "nloc": 12, + "complexity": 4, + "token_count": 92, + "parameters": [ + "self", + "name", + "code_block", + "args", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters" + ], + "start_line": 159, + "end_line": 171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , compiler = '' )", + "filename": "ext_tools.py", + "nloc": 13, + "complexity": 1, + "token_count": 91, + "parameters": [ + "self", + "name", + "compiler" + ], + "start_line": 177, + "end_line": 189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "add_function", + "long_name": "add_function( self , func )", + "filename": "ext_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "func" + ], + "start_line": 191, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "module_code", + "long_name": "module_code( self )", + "filename": "ext_tools.py", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "arg_specs", + "long_name": "arg_specs( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 202, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "build_information", + "long_name": "build_information( self )", + "filename": "ext_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 208, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "get_headers", + "long_name": "get_headers( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "warning_code", + "long_name": "warning_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 230, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "header_code", + "long_name": "header_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 232, + "end_line": 235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "support_code", + "long_name": "support_code( self )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "ext_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "module_init_code", + "long_name": "module_init_code( self )", + "filename": "ext_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self" + ], + "start_line": 259, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "generate_file", + "long_name": "generate_file( self , file_name = \"\" , location = '.' )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 46, + "parameters": [ + "self", + "file_name", + "location" + ], + "start_line": 269, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "set_compiler", + "long_name": "set_compiler( self , compiler )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self", + "compiler" + ], + "start_line": 277, + "end_line": 284, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "compile", + "long_name": "compile( self , location = '.' , compiler = None , verbose = 0 , ** kw )", + "filename": "ext_tools.py", + "nloc": 24, + "complexity": 4, + "token_count": 222, + "parameters": [ + "self", + "location", + "compiler", + "verbose", + "kw" + ], + "start_line": 286, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "generate_file_name", + "long_name": "generate_file_name( module_name , module_location )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "module_name", + "module_location" + ], + "start_line": 325, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "generate_module", + "long_name": "generate_module( module_string , module_file )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "module_string", + "module_file" + ], + "start_line": 329, + "end_line": 333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "assign_variable_types", + "long_name": "assign_variable_types( variables , local_dict = { } , global_dict = { } , auto_downcast = 1 , type_converters = converters . default )", + "filename": "ext_tools.py", + "nloc": 31, + "complexity": 9, + "token_count": 156, + "parameters": [ + "variables", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters" + ], + "start_line": 335, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "downcast", + "long_name": "downcast( var_specs )", + "filename": "ext_tools.py", + "nloc": 14, + "complexity": 11, + "token_count": 103, + "parameters": [ + "var_specs" + ], + "start_line": 372, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "indent", + "long_name": "indent( st , spaces )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 44, + "parameters": [ + "st", + "spaces" + ], + "start_line": 401, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "format_error_msg", + "long_name": "format_error_msg( errors )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 30, + "parameters": [ + "errors" + ], + "start_line": 408, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 415, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 419, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self , name , code_block , arg_specs )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self", + "name", + "code_block", + "arg_specs" + ], + "start_line": 10, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "header_code", + "long_name": "header_code( self )", + "filename": "ext_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 6, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "function_declaration_code", + "long_name": "function_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 20, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "template_declaration_code", + "long_name": "template_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 25, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "parse_tuple_code", + "long_name": "parse_tuple_code( self )", + "filename": "ext_tools.py", + "nloc": 30, + "complexity": 5, + "token_count": 174, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 1 + }, + { + "name": "arg_declaration_code", + "long_name": "arg_declaration_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 82, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_cleanup_code", + "long_name": "arg_cleanup_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_local_dict_code", + "long_name": "arg_local_dict_code( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "ext_tools.py", + "nloc": 37, + "complexity": 1, + "token_count": 162, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 146, + "end_line": 150, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "set_compiler", + "long_name": "set_compiler( self , compiler )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self", + "compiler" + ], + "start_line": 152, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , code_block , args , local_dict = None , global_dict = None , auto_downcast = 1 , type_converters = None )", + "filename": "ext_tools.py", + "nloc": 12, + "complexity": 4, + "token_count": 92, + "parameters": [ + "self", + "name", + "code_block", + "args", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters" + ], + "start_line": 159, + "end_line": 171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , compiler = '' )", + "filename": "ext_tools.py", + "nloc": 13, + "complexity": 1, + "token_count": 91, + "parameters": [ + "self", + "name", + "compiler" + ], + "start_line": 177, + "end_line": 189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "add_function", + "long_name": "add_function( self , func )", + "filename": "ext_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "self", + "func" + ], + "start_line": 191, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "module_code", + "long_name": "module_code( self )", + "filename": "ext_tools.py", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 193, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "arg_specs", + "long_name": "arg_specs( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 202, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "build_information", + "long_name": "build_information( self )", + "filename": "ext_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 208, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "get_headers", + "long_name": "get_headers( self )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "warning_code", + "long_name": "warning_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 230, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "header_code", + "long_name": "header_code( self )", + "filename": "ext_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "self" + ], + "start_line": 232, + "end_line": 235, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "support_code", + "long_name": "support_code( self )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 239, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "ext_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "module_init_code", + "long_name": "module_init_code( self )", + "filename": "ext_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self" + ], + "start_line": 259, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "generate_file", + "long_name": "generate_file( self , file_name = \"\" , location = '.' )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 46, + "parameters": [ + "self", + "file_name", + "location" + ], + "start_line": 269, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "set_compiler", + "long_name": "set_compiler( self , compiler )", + "filename": "ext_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self", + "compiler" + ], + "start_line": 277, + "end_line": 284, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "compile", + "long_name": "compile( self , location = '.' , compiler = None , verbose = 0 , ** kw )", + "filename": "ext_tools.py", + "nloc": 24, + "complexity": 4, + "token_count": 222, + "parameters": [ + "self", + "location", + "compiler", + "verbose", + "kw" + ], + "start_line": 286, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 38, + "top_nesting_level": 1 + }, + { + "name": "generate_file_name", + "long_name": "generate_file_name( module_name , module_location )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "module_name", + "module_location" + ], + "start_line": 325, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "generate_module", + "long_name": "generate_module( module_string , module_file )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "module_string", + "module_file" + ], + "start_line": 329, + "end_line": 333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "assign_variable_types", + "long_name": "assign_variable_types( variables , local_dict = { } , global_dict = { } , auto_downcast = 1 , type_converters = converters . default )", + "filename": "ext_tools.py", + "nloc": 31, + "complexity": 9, + "token_count": 156, + "parameters": [ + "variables", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters" + ], + "start_line": 335, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "downcast", + "long_name": "downcast( var_specs )", + "filename": "ext_tools.py", + "nloc": 14, + "complexity": 11, + "token_count": 103, + "parameters": [ + "var_specs" + ], + "start_line": 372, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 0 + }, + { + "name": "indent", + "long_name": "indent( st , spaces )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 44, + "parameters": [ + "st", + "spaces" + ], + "start_line": 401, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "format_error_msg", + "long_name": "format_error_msg( errors )", + "filename": "ext_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 30, + "parameters": [ + "errors" + ], + "start_line": 408, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 415, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 419, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 419, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ext_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 415, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 316, + "complexity": 76, + "token_count": 1995, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/inline_tools.py", + "new_path": "weave/inline_tools.py", + "filename": "inline_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -436,11 +436,11 @@ def compile_function(code,arg_names,local_dict,global_dict,\n return func\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n if __name__ == \"__main__\":\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "# should re-write compiled functions to take a local and global dict\n# as input.\nimport sys,os\nimport ext_tools\nimport string\nimport catalog\nimport inline_info, cxx_info\n\n# not an easy way for the user_path_list to come in here.\n# the PYTHONCOMPILED environment variable offers the most hope.\n\nfunction_catalog = catalog.catalog()\n\n\nclass inline_ext_function(ext_tools.ext_function):\n # Some specialization is needed for inline extension functions\n def function_declaration_code(self):\n code = 'static PyObject* %s(PyObject*self, PyObject* args)\\n{\\n'\n return code % self.name\n\n def template_declaration_code(self):\n code = 'template\\n' \\\n 'static PyObject* %s(PyObject*self, PyObject* args)\\n{\\n'\n return code % self.name\n\n def parse_tuple_code(self):\n \"\"\" Create code block for PyArg_ParseTuple. Variable declarations\n for all PyObjects are done also.\n\n This code got a lot uglier when I added local_dict...\n \"\"\"\n declare_return = 'PyObject *return_val = NULL;\\n' \\\n 'int exception_occured = 0;\\n' \\\n 'PyObject *py__locals = NULL;\\n' \\\n 'PyObject *py__globals = NULL;\\n'\n\n py_objects = ', '.join(self.arg_specs.py_pointers())\n if py_objects:\n declare_py_objects = 'PyObject ' + py_objects +';\\n'\n else:\n declare_py_objects = ''\n\n py_vars = ' = '.join(self.arg_specs.py_variables())\n if py_vars:\n init_values = py_vars + ' = NULL;\\n\\n'\n else:\n init_values = ''\n\n parse_tuple = 'if(!PyArg_ParseTuple(args,\"OO:compiled_func\",'\\\n '&py__locals,'\\\n '&py__globals))\\n'\\\n ' return NULL;\\n'\n\n return declare_return + declare_py_objects + \\\n init_values + parse_tuple\n\n def arg_declaration_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.declaration_code(inline=1))\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_cleanup_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.cleanup_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_local_dict_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.local_dict_code())\n code = string.join(arg_strings,\"\")\n return code\n\n\n def function_code(self):\n from ext_tools import indent\n decl_code = indent(self.arg_declaration_code(),4)\n cleanup_code = indent(self.arg_cleanup_code(),4)\n function_code = indent(self.code_block,4)\n #local_dict_code = indent(self.arg_local_dict_code(),4)\n\n try_code = 'try \\n' \\\n '{ \\n' \\\n ' PyObject* raw_locals = py_to_raw_dict(' \\\n 'py__locals,\"_locals\");\\n' \\\n ' PyObject* raw_globals = py_to_raw_dict(' \\\n 'py__globals,\"_globals\");\\n' + \\\n ' /* argument conversion code */ \\n' + \\\n decl_code + \\\n ' /* inline code */ \\n' + \\\n function_code + \\\n ' /*I would like to fill in changed ' \\\n 'locals and globals here...*/ \\n' \\\n '\\n} \\n'\n catch_code = \"catch(...) \\n\" \\\n \"{ \\n\" + \\\n \" return_val = Py::Null(); \\n\" \\\n \" exception_occured = 1; \\n\" \\\n \"} \\n\" \n return_code = \" /* cleanup code */ \\n\" + \\\n cleanup_code + \\\n \" if(!return_val && !exception_occured)\\n\" \\\n \" {\\n \\n\" \\\n \" Py_INCREF(Py_None); \\n\" \\\n \" return_val = Py_None; \\n\" \\\n \" }\\n \\n\" \\\n \" return return_val; \\n\" \\\n \"} \\n\"\n\n all_code = self.function_declaration_code() + \\\n indent(self.parse_tuple_code(),4) + \\\n indent(try_code,4) + \\\n indent(catch_code,4) + \\\n return_code\n\n return all_code\n\n def python_function_definition_code(self):\n args = (self.name, self.name)\n function_decls = '{\"%s\",(PyCFunction)%s , METH_VARARGS},\\n' % args\n return function_decls\n\nclass inline_ext_module(ext_tools.ext_module):\n def __init__(self,name,compiler=''):\n ext_tools.ext_module.__init__(self,name,compiler)\n self._build_information.append(inline_info.inline_info())\n\nfunction_cache = {}\ndef inline(code,arg_names=[],local_dict = None, global_dict = None,\n force = 0,\n compiler='',\n verbose = 0,\n support_code = None,\n customize=None,\n type_converters = None,\n auto_downcast=1,\n **kw):\n \"\"\" Inline C/C++ code within Python scripts.\n\n inline() compiles and executes C/C++ code on the fly. Variables\n in the local and global Python scope are also available in the\n C/C++ code. Values are passed to the C/C++ code by assignment\n much like variables passed are passed into a standard Python\n function. Values are returned from the C/C++ code through a\n special argument called return_val. Also, the contents of\n mutable objects can be changed within the C/C++ code and the\n changes remain after the C code exits and returns to Python.\n\n inline has quite a few options as listed below. Also, the keyword\n arguments for distutils extension modules are accepted to\n specify extra information needed for compiling.\n\n code -- string. A string of valid C++ code. It should not specify a\n return statement. Instead it should assign results that\n need to be returned to Python in the return_val.\n arg_names -- optional. list of strings. A list of Python variable names \n that should be transferred from Python into the C/C++ \n code. It defaults to an empty string.\n local_dict -- optional. dictionary. If specified, it is a dictionary\n of values that should be used as the local scope for the\n C/C++ code. If local_dict is not specified the local\n dictionary of the calling function is used.\n global_dict -- optional. dictionary. If specified, it is a dictionary\n of values that should be used as the global scope for\n the C/C++ code. If global_dict is not specified the\n global dictionary of the calling function is used.\n force -- optional. 0 or 1. default 0. If 1, the C++ code is\n compiled every time inline is called. This is really\n only useful for debugging, and probably only useful if\n your editing support_code a lot.\n compiler -- optional. string. The name of compiler to use when\n compiling. On windows, it understands 'msvc' and 'gcc'\n as well as all the compiler names understood by\n distutils. On Unix, it'll only understand the values\n understoof by distutils. ( I should add 'gcc' though\n to this).\n\n On windows, the compiler defaults to the Microsoft C++\n compiler. If this isn't available, it looks for mingw32\n (the gcc compiler).\n\n On Unix, it'll probably use the same compiler that was\n used when compiling Python. Cygwin's behavior should be\n similar.\n verbose -- optional. 0,1, or 2. defualt 0. Speficies how much\n much information is printed during the compile phase\n of inlining code. 0 is silent (except on windows with\n msvc where it still prints some garbage). 1 informs\n you when compiling starts, finishes, and how long it\n took. 2 prints out the command lines for the compilation\n process and can be useful if your having problems\n getting code to work. Its handy for finding the name\n of the .cpp file if you need to examine it. verbose has\n no affect if the compilation isn't necessary.\n support_code -- optional. string. A string of valid C++ code declaring\n extra code that might be needed by your compiled\n function. This could be declarations of functions,\n classes, or structures.\n customize -- optional. base_info.custom_info object. An alternative\n way to specifiy support_code, headers, etc. needed by\n the function see the compiler.base_info module for more\n details. (not sure this'll be used much).\n type_converters -- optional. list of type converters. These\n guys are what convert Python data types to C/C++ data\n types. If you'd like to use a different set of type\n conversions than the default, specify them here. Look\n in the type conversions section of the main\n documentation for examples.\n auto_downcast -- optional. 0 or 1. default 1. This only affects\n functions that have Numeric arrays as input variables.\n Setting this to 1 will cause all floating point values\n to be cast as float instead of double if all the\n Numeric arrays are of type float. If even one of the\n arrays has type double or double complex, all\n variables maintain there standard types.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n\n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list\n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability)\n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line)\n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n # this grabs the local variables from the *previous* call\n # frame -- that is the locals from the function that called\n # inline.\n global function_catalog\n\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n if force:\n module_dir = global_dict.get('__file__',None)\n func = compile_function(code,arg_names,local_dict,\n global_dict,module_dir,\n compiler=compiler,\n verbose=verbose,\n support_code = support_code,\n customize=customize,\n type_converters = type_converters,\n auto_downcast = auto_downcast,\n **kw)\n\n function_catalog.add_function(code,func,module_dir)\n results = attempt_function_call(code,local_dict,global_dict)\n else:\n # 1. try local cache\n try:\n results = apply(function_cache[code],(local_dict,global_dict))\n return results\n except TypeError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise TypeError, msg\n except NameError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise NameError, msg\n except KeyError:\n pass\n # 2. try function catalog\n try:\n results = attempt_function_call(code,local_dict,global_dict)\n # 3. build the function\n except ValueError:\n # compile the library\n module_dir = global_dict.get('__file__',None)\n func = compile_function(code,arg_names,local_dict,\n global_dict,module_dir,\n compiler=compiler,\n verbose=verbose,\n support_code = support_code,\n customize=customize,\n type_converters = type_converters,\n auto_downcast = auto_downcast,\n **kw)\n\n function_catalog.add_function(code,func,module_dir)\n results = attempt_function_call(code,local_dict,global_dict)\n return results\n\ndef attempt_function_call(code,local_dict,global_dict):\n # we try 3 levels here -- a local cache first, then the\n # catalog cache, and then persistent catalog.\n #\n global function_cache\n # 2. try catalog cache.\n function_list = function_catalog.get_functions_fast(code)\n for func in function_list:\n try:\n results = apply(func,(local_dict,global_dict))\n function_catalog.fast_cache(code,func)\n function_cache[code] = func\n return results\n except TypeError, msg: # should specify argument types here.\n # This should really have its own error type, instead of\n # checking the beginning of the message, but I don't know\n # how to define that yet.\n msg = str(msg)\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise TypeError, msg\n except NameError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise NameError, msg \n # 3. try persistent catalog\n module_dir = global_dict.get('__file__',None)\n function_list = function_catalog.get_functions(code,module_dir)\n for func in function_list:\n try:\n results = apply(func,(local_dict,global_dict))\n function_catalog.fast_cache(code,func)\n function_cache[code] = func\n return results\n except: # should specify argument types here.\n pass\n # if we get here, the function wasn't found\n raise ValueError, 'function with correct signature not found'\n\ndef inline_function_code(code,arg_names,local_dict=None,\n global_dict=None,auto_downcast = 1,\n type_converters=None,compiler=''):\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n ext_func = inline_ext_function('compiled_func',code,arg_names,\n local_dict,global_dict,auto_downcast,\n type_converters = type_converters)\n import build_tools\n compiler = build_tools.choose_compiler(compiler)\n ext_func.set_compiler(compiler)\n return ext_func.function_code()\n\ndef compile_function(code,arg_names,local_dict,global_dict,\n module_dir,\n compiler='',\n verbose = 0,\n support_code = None,\n customize = None,\n type_converters = None,\n auto_downcast=1,\n **kw):\n # figure out where to store and what to name the extension module\n # that will contain the function.\n #storage_dir = catalog.intermediate_dir()\n module_path = function_catalog.unique_module_name(code,module_dir)\n storage_dir, module_name = os.path.split(module_path)\n mod = inline_ext_module(module_name,compiler)\n\n # create the function. This relies on the auto_downcast and\n # type factories setting\n ext_func = inline_ext_function('compiled_func',code,arg_names,\n local_dict,global_dict,auto_downcast,\n type_converters = type_converters)\n mod.add_function(ext_func)\n\n # if customize (a custom_info object), then set the module customization.\n if customize:\n mod.customize = customize\n\n # add the extra \"support code\" needed by the function to the module.\n if support_code:\n mod.customize.add_support_code(support_code)\n \n # compile code in correct location, with the given compiler and verbosity\n # setting. All input keywords are passed through to distutils\n mod.compile(location=storage_dir,compiler=compiler,\n verbose=verbose, **kw)\n\n # import the module and return the function. Make sure\n # the directory where it lives is in the python path.\n try:\n sys.path.insert(0,storage_dir)\n exec 'import ' + module_name\n func = eval(module_name+'.compiled_func')\n finally:\n del sys.path[0]\n return func\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\":\n test_function()\n\n", + "source_code_before": "# should re-write compiled functions to take a local and global dict\n# as input.\nimport sys,os\nimport ext_tools\nimport string\nimport catalog\nimport inline_info, cxx_info\n\n# not an easy way for the user_path_list to come in here.\n# the PYTHONCOMPILED environment variable offers the most hope.\n\nfunction_catalog = catalog.catalog()\n\n\nclass inline_ext_function(ext_tools.ext_function):\n # Some specialization is needed for inline extension functions\n def function_declaration_code(self):\n code = 'static PyObject* %s(PyObject*self, PyObject* args)\\n{\\n'\n return code % self.name\n\n def template_declaration_code(self):\n code = 'template\\n' \\\n 'static PyObject* %s(PyObject*self, PyObject* args)\\n{\\n'\n return code % self.name\n\n def parse_tuple_code(self):\n \"\"\" Create code block for PyArg_ParseTuple. Variable declarations\n for all PyObjects are done also.\n\n This code got a lot uglier when I added local_dict...\n \"\"\"\n declare_return = 'PyObject *return_val = NULL;\\n' \\\n 'int exception_occured = 0;\\n' \\\n 'PyObject *py__locals = NULL;\\n' \\\n 'PyObject *py__globals = NULL;\\n'\n\n py_objects = ', '.join(self.arg_specs.py_pointers())\n if py_objects:\n declare_py_objects = 'PyObject ' + py_objects +';\\n'\n else:\n declare_py_objects = ''\n\n py_vars = ' = '.join(self.arg_specs.py_variables())\n if py_vars:\n init_values = py_vars + ' = NULL;\\n\\n'\n else:\n init_values = ''\n\n parse_tuple = 'if(!PyArg_ParseTuple(args,\"OO:compiled_func\",'\\\n '&py__locals,'\\\n '&py__globals))\\n'\\\n ' return NULL;\\n'\n\n return declare_return + declare_py_objects + \\\n init_values + parse_tuple\n\n def arg_declaration_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.declaration_code(inline=1))\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_cleanup_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.cleanup_code())\n code = string.join(arg_strings,\"\")\n return code\n\n def arg_local_dict_code(self):\n arg_strings = []\n for arg in self.arg_specs:\n arg_strings.append(arg.local_dict_code())\n code = string.join(arg_strings,\"\")\n return code\n\n\n def function_code(self):\n from ext_tools import indent\n decl_code = indent(self.arg_declaration_code(),4)\n cleanup_code = indent(self.arg_cleanup_code(),4)\n function_code = indent(self.code_block,4)\n #local_dict_code = indent(self.arg_local_dict_code(),4)\n\n try_code = 'try \\n' \\\n '{ \\n' \\\n ' PyObject* raw_locals = py_to_raw_dict(' \\\n 'py__locals,\"_locals\");\\n' \\\n ' PyObject* raw_globals = py_to_raw_dict(' \\\n 'py__globals,\"_globals\");\\n' + \\\n ' /* argument conversion code */ \\n' + \\\n decl_code + \\\n ' /* inline code */ \\n' + \\\n function_code + \\\n ' /*I would like to fill in changed ' \\\n 'locals and globals here...*/ \\n' \\\n '\\n} \\n'\n catch_code = \"catch(...) \\n\" \\\n \"{ \\n\" + \\\n \" return_val = Py::Null(); \\n\" \\\n \" exception_occured = 1; \\n\" \\\n \"} \\n\" \n return_code = \" /* cleanup code */ \\n\" + \\\n cleanup_code + \\\n \" if(!return_val && !exception_occured)\\n\" \\\n \" {\\n \\n\" \\\n \" Py_INCREF(Py_None); \\n\" \\\n \" return_val = Py_None; \\n\" \\\n \" }\\n \\n\" \\\n \" return return_val; \\n\" \\\n \"} \\n\"\n\n all_code = self.function_declaration_code() + \\\n indent(self.parse_tuple_code(),4) + \\\n indent(try_code,4) + \\\n indent(catch_code,4) + \\\n return_code\n\n return all_code\n\n def python_function_definition_code(self):\n args = (self.name, self.name)\n function_decls = '{\"%s\",(PyCFunction)%s , METH_VARARGS},\\n' % args\n return function_decls\n\nclass inline_ext_module(ext_tools.ext_module):\n def __init__(self,name,compiler=''):\n ext_tools.ext_module.__init__(self,name,compiler)\n self._build_information.append(inline_info.inline_info())\n\nfunction_cache = {}\ndef inline(code,arg_names=[],local_dict = None, global_dict = None,\n force = 0,\n compiler='',\n verbose = 0,\n support_code = None,\n customize=None,\n type_converters = None,\n auto_downcast=1,\n **kw):\n \"\"\" Inline C/C++ code within Python scripts.\n\n inline() compiles and executes C/C++ code on the fly. Variables\n in the local and global Python scope are also available in the\n C/C++ code. Values are passed to the C/C++ code by assignment\n much like variables passed are passed into a standard Python\n function. Values are returned from the C/C++ code through a\n special argument called return_val. Also, the contents of\n mutable objects can be changed within the C/C++ code and the\n changes remain after the C code exits and returns to Python.\n\n inline has quite a few options as listed below. Also, the keyword\n arguments for distutils extension modules are accepted to\n specify extra information needed for compiling.\n\n code -- string. A string of valid C++ code. It should not specify a\n return statement. Instead it should assign results that\n need to be returned to Python in the return_val.\n arg_names -- optional. list of strings. A list of Python variable names \n that should be transferred from Python into the C/C++ \n code. It defaults to an empty string.\n local_dict -- optional. dictionary. If specified, it is a dictionary\n of values that should be used as the local scope for the\n C/C++ code. If local_dict is not specified the local\n dictionary of the calling function is used.\n global_dict -- optional. dictionary. If specified, it is a dictionary\n of values that should be used as the global scope for\n the C/C++ code. If global_dict is not specified the\n global dictionary of the calling function is used.\n force -- optional. 0 or 1. default 0. If 1, the C++ code is\n compiled every time inline is called. This is really\n only useful for debugging, and probably only useful if\n your editing support_code a lot.\n compiler -- optional. string. The name of compiler to use when\n compiling. On windows, it understands 'msvc' and 'gcc'\n as well as all the compiler names understood by\n distutils. On Unix, it'll only understand the values\n understoof by distutils. ( I should add 'gcc' though\n to this).\n\n On windows, the compiler defaults to the Microsoft C++\n compiler. If this isn't available, it looks for mingw32\n (the gcc compiler).\n\n On Unix, it'll probably use the same compiler that was\n used when compiling Python. Cygwin's behavior should be\n similar.\n verbose -- optional. 0,1, or 2. defualt 0. Speficies how much\n much information is printed during the compile phase\n of inlining code. 0 is silent (except on windows with\n msvc where it still prints some garbage). 1 informs\n you when compiling starts, finishes, and how long it\n took. 2 prints out the command lines for the compilation\n process and can be useful if your having problems\n getting code to work. Its handy for finding the name\n of the .cpp file if you need to examine it. verbose has\n no affect if the compilation isn't necessary.\n support_code -- optional. string. A string of valid C++ code declaring\n extra code that might be needed by your compiled\n function. This could be declarations of functions,\n classes, or structures.\n customize -- optional. base_info.custom_info object. An alternative\n way to specifiy support_code, headers, etc. needed by\n the function see the compiler.base_info module for more\n details. (not sure this'll be used much).\n type_converters -- optional. list of type converters. These\n guys are what convert Python data types to C/C++ data\n types. If you'd like to use a different set of type\n conversions than the default, specify them here. Look\n in the type conversions section of the main\n documentation for examples.\n auto_downcast -- optional. 0 or 1. default 1. This only affects\n functions that have Numeric arrays as input variables.\n Setting this to 1 will cause all floating point values\n to be cast as float instead of double if all the\n Numeric arrays are of type float. If even one of the\n arrays has type double or double complex, all\n variables maintain there standard types.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n\n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list\n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability)\n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line)\n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n # this grabs the local variables from the *previous* call\n # frame -- that is the locals from the function that called\n # inline.\n global function_catalog\n\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n if force:\n module_dir = global_dict.get('__file__',None)\n func = compile_function(code,arg_names,local_dict,\n global_dict,module_dir,\n compiler=compiler,\n verbose=verbose,\n support_code = support_code,\n customize=customize,\n type_converters = type_converters,\n auto_downcast = auto_downcast,\n **kw)\n\n function_catalog.add_function(code,func,module_dir)\n results = attempt_function_call(code,local_dict,global_dict)\n else:\n # 1. try local cache\n try:\n results = apply(function_cache[code],(local_dict,global_dict))\n return results\n except TypeError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise TypeError, msg\n except NameError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise NameError, msg\n except KeyError:\n pass\n # 2. try function catalog\n try:\n results = attempt_function_call(code,local_dict,global_dict)\n # 3. build the function\n except ValueError:\n # compile the library\n module_dir = global_dict.get('__file__',None)\n func = compile_function(code,arg_names,local_dict,\n global_dict,module_dir,\n compiler=compiler,\n verbose=verbose,\n support_code = support_code,\n customize=customize,\n type_converters = type_converters,\n auto_downcast = auto_downcast,\n **kw)\n\n function_catalog.add_function(code,func,module_dir)\n results = attempt_function_call(code,local_dict,global_dict)\n return results\n\ndef attempt_function_call(code,local_dict,global_dict):\n # we try 3 levels here -- a local cache first, then the\n # catalog cache, and then persistent catalog.\n #\n global function_cache\n # 2. try catalog cache.\n function_list = function_catalog.get_functions_fast(code)\n for func in function_list:\n try:\n results = apply(func,(local_dict,global_dict))\n function_catalog.fast_cache(code,func)\n function_cache[code] = func\n return results\n except TypeError, msg: # should specify argument types here.\n # This should really have its own error type, instead of\n # checking the beginning of the message, but I don't know\n # how to define that yet.\n msg = str(msg)\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise TypeError, msg\n except NameError, msg: \n msg = str(msg).strip()\n if msg[:16] == \"Conversion Error\":\n pass\n else:\n raise NameError, msg \n # 3. try persistent catalog\n module_dir = global_dict.get('__file__',None)\n function_list = function_catalog.get_functions(code,module_dir)\n for func in function_list:\n try:\n results = apply(func,(local_dict,global_dict))\n function_catalog.fast_cache(code,func)\n function_cache[code] = func\n return results\n except: # should specify argument types here.\n pass\n # if we get here, the function wasn't found\n raise ValueError, 'function with correct signature not found'\n\ndef inline_function_code(code,arg_names,local_dict=None,\n global_dict=None,auto_downcast = 1,\n type_converters=None,compiler=''):\n call_frame = sys._getframe().f_back\n if local_dict is None:\n local_dict = call_frame.f_locals\n if global_dict is None:\n global_dict = call_frame.f_globals\n ext_func = inline_ext_function('compiled_func',code,arg_names,\n local_dict,global_dict,auto_downcast,\n type_converters = type_converters)\n import build_tools\n compiler = build_tools.choose_compiler(compiler)\n ext_func.set_compiler(compiler)\n return ext_func.function_code()\n\ndef compile_function(code,arg_names,local_dict,global_dict,\n module_dir,\n compiler='',\n verbose = 0,\n support_code = None,\n customize = None,\n type_converters = None,\n auto_downcast=1,\n **kw):\n # figure out where to store and what to name the extension module\n # that will contain the function.\n #storage_dir = catalog.intermediate_dir()\n module_path = function_catalog.unique_module_name(code,module_dir)\n storage_dir, module_name = os.path.split(module_path)\n mod = inline_ext_module(module_name,compiler)\n\n # create the function. This relies on the auto_downcast and\n # type factories setting\n ext_func = inline_ext_function('compiled_func',code,arg_names,\n local_dict,global_dict,auto_downcast,\n type_converters = type_converters)\n mod.add_function(ext_func)\n\n # if customize (a custom_info object), then set the module customization.\n if customize:\n mod.customize = customize\n\n # add the extra \"support code\" needed by the function to the module.\n if support_code:\n mod.customize.add_support_code(support_code)\n \n # compile code in correct location, with the given compiler and verbosity\n # setting. All input keywords are passed through to distutils\n mod.compile(location=storage_dir,compiler=compiler,\n verbose=verbose, **kw)\n\n # import the module and return the function. Make sure\n # the directory where it lives is in the python path.\n try:\n sys.path.insert(0,storage_dir)\n exec 'import ' + module_name\n func = eval(module_name+'.compiled_func')\n finally:\n del sys.path[0]\n return func\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\":\n test_function()\n\n", + "methods": [ + { + "name": "function_declaration_code", + "long_name": "function_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "template_declaration_code", + "long_name": "template_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 21, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "parse_tuple_code", + "long_name": "parse_tuple_code( self )", + "filename": "inline_tools.py", + "nloc": 21, + "complexity": 3, + "token_count": 89, + "parameters": [ + "self" + ], + "start_line": 26, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "arg_declaration_code", + "long_name": "arg_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 57, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_cleanup_code", + "long_name": "arg_cleanup_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 64, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_local_dict_code", + "long_name": "arg_local_dict_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 71, + "end_line": 76, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "inline_tools.py", + "nloc": 38, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "inline_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 125, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , compiler = '' )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "name", + "compiler" + ], + "start_line": 128, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inline", + "long_name": "inline( code , arg_names = [ ] , local_dict = None , global_dict = None , force = 0 , compiler = '' , verbose = 0 , support_code = None , customize = None , type_converters = None , auto_downcast = 1 , ** kw )", + "filename": "inline_tools.py", + "nloc": 62, + "complexity": 10, + "token_count": 330, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "force", + "compiler", + "verbose", + "support_code", + "customize", + "type_converters", + "auto_downcast", + "kw" + ], + "start_line": 133, + "end_line": 332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 200, + "top_nesting_level": 0 + }, + { + "name": "attempt_function_call", + "long_name": "attempt_function_call( code , local_dict , global_dict )", + "filename": "inline_tools.py", + "nloc": 32, + "complexity": 8, + "token_count": 174, + "parameters": [ + "code", + "local_dict", + "global_dict" + ], + "start_line": 334, + "end_line": 374, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "inline_function_code", + "long_name": "inline_function_code( code , arg_names , local_dict = None , global_dict = None , auto_downcast = 1 , type_converters = None , compiler = '' )", + "filename": "inline_tools.py", + "nloc": 15, + "complexity": 3, + "token_count": 98, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters", + "compiler" + ], + "start_line": 376, + "end_line": 390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "compile_function", + "long_name": "compile_function( code , arg_names , local_dict , global_dict , module_dir , compiler = '' , verbose = 0 , support_code = None , customize = None , type_converters = None , auto_downcast = 1 , ** kw )", + "filename": "inline_tools.py", + "nloc": 29, + "complexity": 4, + "token_count": 169, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "module_dir", + "compiler", + "verbose", + "support_code", + "customize", + "type_converters", + "auto_downcast", + "kw" + ], + "start_line": 392, + "end_line": 436, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 438, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "function_declaration_code", + "long_name": "function_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "template_declaration_code", + "long_name": "template_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 21, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "parse_tuple_code", + "long_name": "parse_tuple_code( self )", + "filename": "inline_tools.py", + "nloc": 21, + "complexity": 3, + "token_count": 89, + "parameters": [ + "self" + ], + "start_line": 26, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 1 + }, + { + "name": "arg_declaration_code", + "long_name": "arg_declaration_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self" + ], + "start_line": 57, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_cleanup_code", + "long_name": "arg_cleanup_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 64, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "arg_local_dict_code", + "long_name": "arg_local_dict_code( self )", + "filename": "inline_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 71, + "end_line": 76, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "inline_tools.py", + "nloc": 38, + "complexity": 1, + "token_count": 148, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "inline_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 125, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , name , compiler = '' )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self", + "name", + "compiler" + ], + "start_line": 128, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inline", + "long_name": "inline( code , arg_names = [ ] , local_dict = None , global_dict = None , force = 0 , compiler = '' , verbose = 0 , support_code = None , customize = None , type_converters = None , auto_downcast = 1 , ** kw )", + "filename": "inline_tools.py", + "nloc": 62, + "complexity": 10, + "token_count": 330, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "force", + "compiler", + "verbose", + "support_code", + "customize", + "type_converters", + "auto_downcast", + "kw" + ], + "start_line": 133, + "end_line": 332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 200, + "top_nesting_level": 0 + }, + { + "name": "attempt_function_call", + "long_name": "attempt_function_call( code , local_dict , global_dict )", + "filename": "inline_tools.py", + "nloc": 32, + "complexity": 8, + "token_count": 174, + "parameters": [ + "code", + "local_dict", + "global_dict" + ], + "start_line": 334, + "end_line": 374, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 41, + "top_nesting_level": 0 + }, + { + "name": "inline_function_code", + "long_name": "inline_function_code( code , arg_names , local_dict = None , global_dict = None , auto_downcast = 1 , type_converters = None , compiler = '' )", + "filename": "inline_tools.py", + "nloc": 15, + "complexity": 3, + "token_count": 98, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "auto_downcast", + "type_converters", + "compiler" + ], + "start_line": 376, + "end_line": 390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "compile_function", + "long_name": "compile_function( code , arg_names , local_dict , global_dict , module_dir , compiler = '' , verbose = 0 , support_code = None , customize = None , type_converters = None , auto_downcast = 1 , ** kw )", + "filename": "inline_tools.py", + "nloc": 29, + "complexity": 4, + "token_count": 169, + "parameters": [ + "code", + "arg_names", + "local_dict", + "global_dict", + "module_dir", + "compiler", + "verbose", + "support_code", + "customize", + "type_converters", + "auto_downcast", + "kw" + ], + "start_line": 392, + "end_line": 436, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 438, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "inline_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 438, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 246, + "complexity": 41, + "token_count": 1324, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/scalar_spec.py", + "new_path": "weave/scalar_spec.py", + "filename": "scalar_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -86,10 +86,10 @@ def local_dict_code(self):\n return code\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n\\ No newline at end of file\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "from base_spec import base_converter\nimport scalar_info\n#from Numeric import *\nfrom types import *\n\n# the following typemaps are for 32 bit platforms. A way to do this\n# general case? maybe ask numeric types how long they are and base\n# the decisions on that.\n\nnumeric_to_c_type_mapping = {}\n\nnumeric_to_c_type_mapping['T'] = 'T' # for templates\nnumeric_to_c_type_mapping['F'] = 'std::complex '\nnumeric_to_c_type_mapping['D'] = 'std::complex '\nnumeric_to_c_type_mapping['f'] = 'float'\nnumeric_to_c_type_mapping['d'] = 'double'\nnumeric_to_c_type_mapping['1'] = 'char'\nnumeric_to_c_type_mapping['b'] = 'unsigned char'\nnumeric_to_c_type_mapping['s'] = 'short'\nnumeric_to_c_type_mapping['i'] = 'int'\n# not strictly correct, but shoulld be fine fo numeric work.\n# add test somewhere to make sure long can be cast to int before using.\nnumeric_to_c_type_mapping['l'] = 'int'\n\n# standard Python numeric type mappings.\nnumeric_to_c_type_mapping[type(1)] = 'int'\nnumeric_to_c_type_mapping[type(1.)] = 'double'\nnumeric_to_c_type_mapping[type(1.+1.j)] = 'std::complex '\n#hmmm. The following is likely unsafe...\nnumeric_to_c_type_mapping[type(1L)] = 'int'\n\nclass scalar_converter(base_converter):\n _build_information = [scalar_info.scalar_info()] \n\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name\n new_spec.numeric_type = type(value)\n return new_spec\n \n def declaration_code(self,inline=0):\n type = numeric_to_c_type_mapping[self.numeric_type]\n func_type = self.type_name\n name = self.name\n var_name = self.retrieve_py_variable(inline)\n template = '%(type)s %(name)s = '\\\n 'convert_to_%(func_type)s (%(var_name)s,\"%(name)s\");\\n'\n code = template % locals()\n return code\n\n def __repr__(self):\n msg = \"(%s:: name: %s, type: %s)\" % \\\n (self.type_name,self.name, self.numeric_type)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.numeric_type,other.numeric_type) or \\\n cmp(self.__class__, other.__class__)\n\nclass int_converter(scalar_converter):\n type_name = 'int'\n def type_match(self,value):\n return type(value) in [IntType, LongType]\n \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Int(%s);\\n' % (self.name,self.name) \n return code\n \nclass float_converter(scalar_converter):\n type_name = 'float'\n def type_match(self,value):\n return type(value) in [FloatType]\n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Float(%s);\\n' % (self.name,self.name) \n return code\n\nclass complex_converter(scalar_converter):\n type_name = 'complex'\n def type_match(self,value):\n return type(value) in [ComplexType]\n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Complex(%s.real(),%s.imag());\\n' % \\\n (self.name,self.name,self.name) \n return code\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n ", + "source_code_before": "from base_spec import base_converter\nimport scalar_info\n#from Numeric import *\nfrom types import *\n\n# the following typemaps are for 32 bit platforms. A way to do this\n# general case? maybe ask numeric types how long they are and base\n# the decisions on that.\n\nnumeric_to_c_type_mapping = {}\n\nnumeric_to_c_type_mapping['T'] = 'T' # for templates\nnumeric_to_c_type_mapping['F'] = 'std::complex '\nnumeric_to_c_type_mapping['D'] = 'std::complex '\nnumeric_to_c_type_mapping['f'] = 'float'\nnumeric_to_c_type_mapping['d'] = 'double'\nnumeric_to_c_type_mapping['1'] = 'char'\nnumeric_to_c_type_mapping['b'] = 'unsigned char'\nnumeric_to_c_type_mapping['s'] = 'short'\nnumeric_to_c_type_mapping['i'] = 'int'\n# not strictly correct, but shoulld be fine fo numeric work.\n# add test somewhere to make sure long can be cast to int before using.\nnumeric_to_c_type_mapping['l'] = 'int'\n\n# standard Python numeric type mappings.\nnumeric_to_c_type_mapping[type(1)] = 'int'\nnumeric_to_c_type_mapping[type(1.)] = 'double'\nnumeric_to_c_type_mapping[type(1.+1.j)] = 'std::complex '\n#hmmm. The following is likely unsafe...\nnumeric_to_c_type_mapping[type(1L)] = 'int'\n\nclass scalar_converter(base_converter):\n _build_information = [scalar_info.scalar_info()] \n\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name\n new_spec.numeric_type = type(value)\n return new_spec\n \n def declaration_code(self,inline=0):\n type = numeric_to_c_type_mapping[self.numeric_type]\n func_type = self.type_name\n name = self.name\n var_name = self.retrieve_py_variable(inline)\n template = '%(type)s %(name)s = '\\\n 'convert_to_%(func_type)s (%(var_name)s,\"%(name)s\");\\n'\n code = template % locals()\n return code\n\n def __repr__(self):\n msg = \"(%s:: name: %s, type: %s)\" % \\\n (self.type_name,self.name, self.numeric_type)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.numeric_type,other.numeric_type) or \\\n cmp(self.__class__, other.__class__)\n\nclass int_converter(scalar_converter):\n type_name = 'int'\n def type_match(self,value):\n return type(value) in [IntType, LongType]\n \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Int(%s);\\n' % (self.name,self.name) \n return code\n \nclass float_converter(scalar_converter):\n type_name = 'float'\n def type_match(self,value):\n return type(value) in [FloatType]\n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Float(%s);\\n' % (self.name,self.name) \n return code\n\nclass complex_converter(scalar_converter):\n type_name = 'complex'\n def type_match(self,value):\n return type(value) in [ComplexType]\n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = Py::Complex(%s.real(),%s.imag());\\n' % \\\n (self.name,self.name,self.name) \n return code\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n ", + "methods": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "scalar_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 35, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , inline = 0 )", + "filename": "scalar_spec.py", + "nloc": 9, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self", + "inline" + ], + "start_line": 42, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 52, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self", + "other" + ], + "start_line": 56, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self", + "value" + ], + "start_line": 64, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 73, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 88, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "scalar_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 35, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , inline = 0 )", + "filename": "scalar_spec.py", + "nloc": 9, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self", + "inline" + ], + "start_line": 42, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 52, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self", + "other" + ], + "start_line": 56, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self", + "value" + ], + "start_line": 64, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 73, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 88, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 88, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 70, + "complexity": 14, + "token_count": 479, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/sequence_spec.py", + "new_path": "weave/sequence_spec.py", + "filename": "sequence_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -77,10 +77,10 @@ def local_dict_code(self):\n return code\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import cxx_info\nfrom base_spec import base_converter\nfrom types import *\nimport os\n\nclass base_cxx_converter(base_converter):\n _build_information = [cxx_info.cxx_info()]\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name \n return new_spec\n def __repr__(self):\n msg = \"(%s:: name: %s)\" % (self.type_name,self.name)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__)\n \nclass string_converter(base_cxx_converter):\n type_name = 'string'\n def type_match(self,value):\n return type(value) in [StringType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::String %s = convert_to_string(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\n\nclass list_converter(base_cxx_converter):\n type_name = 'list'\n def type_match(self,value):\n return type(value) in [ListType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::List %s = convert_to_list(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\nclass dict_converter(base_cxx_converter):\n type_name = 'dict'\n def type_match(self,value):\n return type(value) in [DictType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::Dict %s = convert_to_dict(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name) \n return code\n \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\nclass tuple_converter(base_cxx_converter):\n type_name = 'tuple'\n def type_match(self,value):\n return type(value) in [TupleType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::Tuple %s = convert_to_tuple(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n", + "source_code_before": "import cxx_info\nfrom base_spec import base_converter\nfrom types import *\nimport os\n\nclass base_cxx_converter(base_converter):\n _build_information = [cxx_info.cxx_info()]\n def type_spec(self,name,value):\n # factory\n new_spec = self.__class__()\n new_spec.name = name \n return new_spec\n def __repr__(self):\n msg = \"(%s:: name: %s)\" % (self.type_name,self.name)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__)\n \nclass string_converter(base_cxx_converter):\n type_name = 'string'\n def type_match(self,value):\n return type(value) in [StringType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::String %s = convert_to_string(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\n\nclass list_converter(base_cxx_converter):\n type_name = 'list'\n def type_match(self,value):\n return type(value) in [ListType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::List %s = convert_to_list(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\nclass dict_converter(base_cxx_converter):\n type_name = 'dict'\n def type_match(self,value):\n return type(value) in [DictType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::Dict %s = convert_to_dict(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name) \n return code\n \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\nclass tuple_converter(base_cxx_converter):\n type_name = 'tuple'\n def type_match(self,value):\n return type(value) in [TupleType]\n\n def declaration_code(self,templatize = 0,inline=0):\n var_name = self.retrieve_py_variable(inline)\n code = 'Py::Tuple %s = convert_to_tuple(%s,\"%s\");\\n' % \\\n (self.name,var_name,self.name)\n return code \n def local_dict_code(self):\n code = 'local_dict[\"%s\"] = %s;\\n' % (self.name,self.name) \n return code\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n", + "methods": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "sequence_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 8, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 13, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "other" + ], + "start_line": 16, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 23, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 31, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 38, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 41, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 52, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 55, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 67, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 70, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 83, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "sequence_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 8, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 13, + "end_line": 15, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self", + "other" + ], + "start_line": 16, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 23, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 31, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 38, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 41, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 52, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 55, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "sequence_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "value" + ], + "start_line": 67, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "sequence_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 70, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 83, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 83, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "sequence_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 70, + "complexity": 18, + "token_count": 500, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/setup.py", + "new_path": "weave/setup.py", + "filename": "setup.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -15,7 +15,7 @@ def stand_alone_package(with_dependencies = 0):\n try:\n primary = ['weave']\n if with_dependencies:\n- dependencies= ['scipy_distutils', 'scipy_test'] \n+ dependencies= ['scipy_distutils', 'scipy_base.testing'] \n else:\n dependencies = [] \n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\nimport os,sys\nfrom scipy_distutils.core import setup\nfrom scipy_distutils.misc_util import get_path, merge_config_dicts\nfrom scipy_distutils.misc_util import package_config\n\n# Enought changes to bump the number. We need a global method for\n# versioning\nversion = \"0.2.3\"\n \ndef stand_alone_package(with_dependencies = 0):\n path = get_path(__name__)\n old_path = os.getcwd()\n os.chdir(path)\n try:\n primary = ['weave']\n if with_dependencies:\n dependencies= ['scipy_distutils', 'scipy_base.testing'] \n else:\n dependencies = [] \n \n print 'dep:', dependencies\n config_dict = package_config(primary,dependencies)\n\n setup (name = \"weave\",\n version = 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 **config_dict\n ) \n finally:\n os.chdir(old_path)\n\nif __name__ == '__main__':\n import sys\n if '--without-dependencies' in sys.argv:\n with_dependencies = 0\n sys.argv.remove('--without-dependencies')\n else:\n with_dependencies = 1 \n stand_alone_package(with_dependencies)\n \n", + "source_code_before": "#!/usr/bin/env python\nimport os,sys\nfrom scipy_distutils.core import setup\nfrom scipy_distutils.misc_util import get_path, merge_config_dicts\nfrom scipy_distutils.misc_util import package_config\n\n# Enought changes to bump the number. We need a global method for\n# versioning\nversion = \"0.2.3\"\n \ndef stand_alone_package(with_dependencies = 0):\n path = get_path(__name__)\n old_path = os.getcwd()\n os.chdir(path)\n try:\n primary = ['weave']\n if with_dependencies:\n dependencies= ['scipy_distutils', 'scipy_test'] \n else:\n dependencies = [] \n \n print 'dep:', dependencies\n config_dict = package_config(primary,dependencies)\n\n setup (name = \"weave\",\n version = 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 **config_dict\n ) \n finally:\n os.chdir(old_path)\n\nif __name__ == '__main__':\n import sys\n if '--without-dependencies' in sys.argv:\n with_dependencies = 0\n sys.argv.remove('--without-dependencies')\n else:\n with_dependencies = 1 \n stand_alone_package(with_dependencies)\n \n", + "methods": [ + { + "name": "stand_alone_package", + "long_name": "stand_alone_package( with_dependencies = 0 )", + "filename": "setup.py", + "nloc": 23, + "complexity": 3, + "token_count": 102, + "parameters": [ + "with_dependencies" + ], + "start_line": 11, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "stand_alone_package", + "long_name": "stand_alone_package( with_dependencies = 0 )", + "filename": "setup.py", + "nloc": 23, + "complexity": 3, + "token_count": 102, + "parameters": [ + "with_dependencies" + ], + "start_line": 11, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "stand_alone_package", + "long_name": "stand_alone_package( with_dependencies = 0 )", + "filename": "setup.py", + "nloc": 23, + "complexity": 3, + "token_count": 102, + "parameters": [ + "with_dependencies" + ], + "start_line": 11, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 0 + } + ], + "nloc": 36, + "complexity": 3, + "token_count": 164, + "diff_parsed": { + "added": [ + " dependencies= ['scipy_distutils', 'scipy_base.testing']" + ], + "deleted": [ + " dependencies= ['scipy_distutils', 'scipy_test']" + ] + } + }, + { + "old_path": "weave/size_check.py", + "new_path": "weave/size_check.py", + "filename": "size_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -284,10 +284,10 @@ def take(ary,axis=0): raise NotImplemented\n # and all the rest\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "from Numeric import *\n\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom ast_tools import *\nfrom types import *\nimport sys\n\ndef time_it():\n import time\n \n expr = \"ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,1:])\" \\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n ex = ones((10,10,10),typecode=Float32)\n ca_x = ones((10,10,10),typecode=Float32)\n cb_y_x = ones((10,10,10),typecode=Float32)\n cb_z_x = ones((10,10,10),typecode=Float32)\n hz = ones((10,10,10),typecode=Float32)\n hy = ones((10,10,10),typecode=Float32)\n \n N = 1\n t1 = time.time()\n for i in range(N):\n passed = check_expr(expr,locals())\n t2 = time.time()\n print 'time per call:', (t2 - t1)/N\n print 'passed:', passed\n \ndef check_expr(expr,local_vars,global_vars={}):\n \"\"\" Currently only checks expressions (not suites).\n Doesn't check that lhs = rhs. checked by compiled func though\n \"\"\"\n values ={}\n \n #first handle the globals\n for var,val in global_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n #now handle the locals \n for var,val in local_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n exec(expr,values)\n try:\n exec(expr,values)\n except:\n try:\n eval(expr,values)\n except:\n return 0 \n return 1 \n \nempty = array(())\nempty_slice = slice(None)\n\ndef make_same_length(x,y):\n try:\n Nx = len(x)\n except:\n Nx = 0\n try:\n Ny = len(y)\n except:\n Ny = 0\n if Nx == Ny == 0:\n return empty,empty\n elif Nx == Ny:\n return asarray(x),asarray(y)\n else: \n diff = abs(Nx - Ny)\n front = ones(diff,Int)\n if Nx > Ny:\n return asarray(x), concatenate((front,y))\n elif Ny > Nx:\n return concatenate((front,x)),asarray(y) \n\ndef binary_op_size(xx,yy):\n \"\"\" This returns the resulting size from operating on xx, and yy\n with a binary operator. It accounts for broadcasting, and\n throws errors if the array sizes are incompatible.\n \"\"\"\n x,y = make_same_length(xx,yy)\n res = zeros(len(x))\n for i in range(len(x)):\n if x[i] == y[i]:\n res[i] = x[i]\n elif x[i] == 1:\n res[i] = y[i]\n elif y[i] == 1:\n res[i] = x[i]\n else:\n # offer more information here about which variables.\n raise ValueError, \"frames are not aligned\"\n return res \nclass dummy_array:\n def __init__(self,ary,ary_is_shape = 0,name=None):\n self.name = name\n if ary_is_shape:\n self.shape = ary\n #self.shape = asarray(ary)\n else:\n try:\n self.shape = shape(ary)\n except:\n self.shape = empty\n #self.value = ary \n def binary_op(self,other):\n try: \n x = other.shape\n except AttributeError:\n x = empty \n new_shape = binary_op_size(self.shape,x)\n return dummy_array(new_shape,1)\n def __cmp__(self,other):\n # This isn't an exact compare, but does work for == \n # cluge for Numeric\n if type(other) in [IntType,LongType,FloatType,ComplexType]:\n return 0\n if len(self.shape) == len(other.shape) == 0:\n return 0\n return not alltrue(equal(self.shape,other.shape))\n\n def __add__(self,other): return self.binary_op(other)\n def __radd__(self,other): return self.binary_op(other)\n def __sub__(self,other): return self.binary_op(other)\n def __rsub__(self,other): return self.binary_op(other)\n def __mul__(self,other): return self.binary_op(other)\n def __rmul__(self,other): return self.binary_op(other)\n def __div__(self,other): return self.binary_op(other)\n def __rdiv__(self,other): return self.binary_op(other)\n def __mod__(self,other): return self.binary_op(other)\n def __rmod__(self,other): return self.binary_op(other)\n def __lshift__(self,other): return self.binary_op(other)\n def __rshift__(self,other): return self.binary_op(other)\n # unary ops\n def __neg__(self,other): return self\n def __pos__(self,other): return self\n def __abs__(self,other): return self\n def __invert__(self,other): return self \n # Not sure what to do with coersion ops. Ignore for now.\n #\n # not currently supported by compiler.\n # __divmod__\n # __pow__\n # __rpow__\n # __and__\n # __or__\n # __xor__\n # item access and slicing \n def __setitem__(self,indices,val):\n #ignore for now\n pass\n def __len__(self):\n return self.shape[0]\n def __getslice__(self,i,j):\n # enabling the following would make class compatible with\n # lists. Its current incarnation is compatible with arrays.\n # Both this and Numeric should have this FIXED to correspond\n # to lists.\n #i = max(i, 0); j = max(j, 0)\n return self.__getitem__((slice(i,j),))\n def __getitem__(self,indices):\n # ayeyaya this is a mess\n #print indices, type(indices), indices.shape \n if type(indices) is not TupleType:\n indices = (indices,)\n if Ellipsis in indices:\n raise IndexError, \"Ellipsis not currently supported\"\n new_dims = [] \n dim = 0 \n for index in indices:\n try:\n dim_len = self.shape[dim]\n except IndexError:\n raise IndexError, \"To many indices specified\"\n \n #if (type(index) is SliceType and index.start == index.stop == index.step):\n if (index is empty_slice):\n slc_len = dim_len\n elif type(index) is SliceType:\n beg,end,step = index.start,index.stop,index.step \n # handle if they are dummy arrays\n #if hasattr(beg,'value') and type(beg.value) != ArrayType:\n # beg = beg.value\n #if hasattr(end,'value') and type(end.value) != ArrayType:\n # end = end.value\n #if hasattr(step,'value') and type(step.value) != ArrayType:\n # step = step.value \n if beg is None: beg = 0\n if end == sys.maxint or end is None:\n end = dim_len\n if step is None: \n step = 1\n \n if beg < 0: beg += dim_len\n if end < 0: end += dim_len\n # the following is list like behavior,\n # which isn't adhered to by arrays. \n # FIX THIS ANOMOLY IN NUMERIC!\n if beg < 0: beg = 0\n if beg > dim_len: beg = dim_len\n if end < 0: end = 0\n if end > dim_len: end = dim_len\n # This is rubbish. \n if beg == end:\n beg,end,step = 0,0,1\n elif beg >= dim_len and step > 0:\n beg,end,step = 0,0,1\n #elif index.step > 0 and beg <= end:\n elif step > 0 and beg <= end:\n pass #slc_len = abs(divide(end-beg-1,step)+1) \n # handle [::-1] and [-1::-1] correctly \n #elif index.step > 0 and beg > end:\n elif step > 0 and beg > end:\n beg,end,step = 0,0,1\n elif(step < 0 and index.start is None and index.stop is None):\n beg,end,step = 0,dim_len,-step\n elif(step < 0 and index.start is None):\n # +1 because negative stepping is inclusive\n beg,end,step = end+1,dim_len,-step \n elif(step < 0 and index.stop is None):\n beg,end,step = 0,beg+1,-step\n elif(step < 0 and beg > end): \n beg,end,step = end,beg,-step\n elif(step < 0 and beg < end): \n beg,end,step = 0,0,-step\n slc_len = abs(divide(end-beg-1,step)+1)\n new_dims.append(slc_len)\n else:\n if index < 0: index += dim_len\n if index >=0 and index < dim_len:\n #this reduces the array dimensions by one\n pass\n else:\n raise IndexError, \"Index out of range\" \n dim += 1 \n new_dims.extend(self.shape[dim:])\n if 0 in new_dims:\n raise IndexError, \"Zero length slices not currently supported\"\n return dummy_array(new_dims,1)\n def __repr__(self):\n val = str((self.name, str(self.shape)))\n return val \n\ndef unary(ary):\n return ary\n\ndef not_implemented(ary):\n return ary\n \n#all imported from Numeric and need to be reassigned.\nunary_op = [arccos, arcsin, arctan, cos, cosh, sin, sinh, \n exp,ceil,floor,fabs,log,log10,sqrt]\n\nunsupported = [argmin,argmax, argsort,around, absolute,sign,negative,floor]\n\nfor func in unary_op:\n func = unary\n \nfor func in unsupported:\n func = not_implemented\n \ndef reduction(ary,axis=0):\n if axis < 0:\n axis += len(ary.shape) \n if axis < 0 or axis >= len(ary.shape):\n raise ValueError, \"Dimension not in array\" \n new_dims = list(ary.shape[:axis]) + list(ary.shape[axis+1:])\n return dummy_array(new_dims,1) \n\n# functions currently not supported by compiler\n# reductions are gonna take some array reordering for the general case,\n# so this is gonna take some thought (probably some tree manipulation).\ndef take(ary,axis=0): raise NotImplemented\n# and all the rest\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "source_code_before": "from Numeric import *\n\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom ast_tools import *\nfrom types import *\nimport sys\n\ndef time_it():\n import time\n \n expr = \"ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,1:])\" \\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n ex = ones((10,10,10),typecode=Float32)\n ca_x = ones((10,10,10),typecode=Float32)\n cb_y_x = ones((10,10,10),typecode=Float32)\n cb_z_x = ones((10,10,10),typecode=Float32)\n hz = ones((10,10,10),typecode=Float32)\n hy = ones((10,10,10),typecode=Float32)\n \n N = 1\n t1 = time.time()\n for i in range(N):\n passed = check_expr(expr,locals())\n t2 = time.time()\n print 'time per call:', (t2 - t1)/N\n print 'passed:', passed\n \ndef check_expr(expr,local_vars,global_vars={}):\n \"\"\" Currently only checks expressions (not suites).\n Doesn't check that lhs = rhs. checked by compiled func though\n \"\"\"\n values ={}\n \n #first handle the globals\n for var,val in global_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n #now handle the locals \n for var,val in local_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n exec(expr,values)\n try:\n exec(expr,values)\n except:\n try:\n eval(expr,values)\n except:\n return 0 \n return 1 \n \nempty = array(())\nempty_slice = slice(None)\n\ndef make_same_length(x,y):\n try:\n Nx = len(x)\n except:\n Nx = 0\n try:\n Ny = len(y)\n except:\n Ny = 0\n if Nx == Ny == 0:\n return empty,empty\n elif Nx == Ny:\n return asarray(x),asarray(y)\n else: \n diff = abs(Nx - Ny)\n front = ones(diff,Int)\n if Nx > Ny:\n return asarray(x), concatenate((front,y))\n elif Ny > Nx:\n return concatenate((front,x)),asarray(y) \n\ndef binary_op_size(xx,yy):\n \"\"\" This returns the resulting size from operating on xx, and yy\n with a binary operator. It accounts for broadcasting, and\n throws errors if the array sizes are incompatible.\n \"\"\"\n x,y = make_same_length(xx,yy)\n res = zeros(len(x))\n for i in range(len(x)):\n if x[i] == y[i]:\n res[i] = x[i]\n elif x[i] == 1:\n res[i] = y[i]\n elif y[i] == 1:\n res[i] = x[i]\n else:\n # offer more information here about which variables.\n raise ValueError, \"frames are not aligned\"\n return res \nclass dummy_array:\n def __init__(self,ary,ary_is_shape = 0,name=None):\n self.name = name\n if ary_is_shape:\n self.shape = ary\n #self.shape = asarray(ary)\n else:\n try:\n self.shape = shape(ary)\n except:\n self.shape = empty\n #self.value = ary \n def binary_op(self,other):\n try: \n x = other.shape\n except AttributeError:\n x = empty \n new_shape = binary_op_size(self.shape,x)\n return dummy_array(new_shape,1)\n def __cmp__(self,other):\n # This isn't an exact compare, but does work for == \n # cluge for Numeric\n if type(other) in [IntType,LongType,FloatType,ComplexType]:\n return 0\n if len(self.shape) == len(other.shape) == 0:\n return 0\n return not alltrue(equal(self.shape,other.shape))\n\n def __add__(self,other): return self.binary_op(other)\n def __radd__(self,other): return self.binary_op(other)\n def __sub__(self,other): return self.binary_op(other)\n def __rsub__(self,other): return self.binary_op(other)\n def __mul__(self,other): return self.binary_op(other)\n def __rmul__(self,other): return self.binary_op(other)\n def __div__(self,other): return self.binary_op(other)\n def __rdiv__(self,other): return self.binary_op(other)\n def __mod__(self,other): return self.binary_op(other)\n def __rmod__(self,other): return self.binary_op(other)\n def __lshift__(self,other): return self.binary_op(other)\n def __rshift__(self,other): return self.binary_op(other)\n # unary ops\n def __neg__(self,other): return self\n def __pos__(self,other): return self\n def __abs__(self,other): return self\n def __invert__(self,other): return self \n # Not sure what to do with coersion ops. Ignore for now.\n #\n # not currently supported by compiler.\n # __divmod__\n # __pow__\n # __rpow__\n # __and__\n # __or__\n # __xor__\n # item access and slicing \n def __setitem__(self,indices,val):\n #ignore for now\n pass\n def __len__(self):\n return self.shape[0]\n def __getslice__(self,i,j):\n # enabling the following would make class compatible with\n # lists. Its current incarnation is compatible with arrays.\n # Both this and Numeric should have this FIXED to correspond\n # to lists.\n #i = max(i, 0); j = max(j, 0)\n return self.__getitem__((slice(i,j),))\n def __getitem__(self,indices):\n # ayeyaya this is a mess\n #print indices, type(indices), indices.shape \n if type(indices) is not TupleType:\n indices = (indices,)\n if Ellipsis in indices:\n raise IndexError, \"Ellipsis not currently supported\"\n new_dims = [] \n dim = 0 \n for index in indices:\n try:\n dim_len = self.shape[dim]\n except IndexError:\n raise IndexError, \"To many indices specified\"\n \n #if (type(index) is SliceType and index.start == index.stop == index.step):\n if (index is empty_slice):\n slc_len = dim_len\n elif type(index) is SliceType:\n beg,end,step = index.start,index.stop,index.step \n # handle if they are dummy arrays\n #if hasattr(beg,'value') and type(beg.value) != ArrayType:\n # beg = beg.value\n #if hasattr(end,'value') and type(end.value) != ArrayType:\n # end = end.value\n #if hasattr(step,'value') and type(step.value) != ArrayType:\n # step = step.value \n if beg is None: beg = 0\n if end == sys.maxint or end is None:\n end = dim_len\n if step is None: \n step = 1\n \n if beg < 0: beg += dim_len\n if end < 0: end += dim_len\n # the following is list like behavior,\n # which isn't adhered to by arrays. \n # FIX THIS ANOMOLY IN NUMERIC!\n if beg < 0: beg = 0\n if beg > dim_len: beg = dim_len\n if end < 0: end = 0\n if end > dim_len: end = dim_len\n # This is rubbish. \n if beg == end:\n beg,end,step = 0,0,1\n elif beg >= dim_len and step > 0:\n beg,end,step = 0,0,1\n #elif index.step > 0 and beg <= end:\n elif step > 0 and beg <= end:\n pass #slc_len = abs(divide(end-beg-1,step)+1) \n # handle [::-1] and [-1::-1] correctly \n #elif index.step > 0 and beg > end:\n elif step > 0 and beg > end:\n beg,end,step = 0,0,1\n elif(step < 0 and index.start is None and index.stop is None):\n beg,end,step = 0,dim_len,-step\n elif(step < 0 and index.start is None):\n # +1 because negative stepping is inclusive\n beg,end,step = end+1,dim_len,-step \n elif(step < 0 and index.stop is None):\n beg,end,step = 0,beg+1,-step\n elif(step < 0 and beg > end): \n beg,end,step = end,beg,-step\n elif(step < 0 and beg < end): \n beg,end,step = 0,0,-step\n slc_len = abs(divide(end-beg-1,step)+1)\n new_dims.append(slc_len)\n else:\n if index < 0: index += dim_len\n if index >=0 and index < dim_len:\n #this reduces the array dimensions by one\n pass\n else:\n raise IndexError, \"Index out of range\" \n dim += 1 \n new_dims.extend(self.shape[dim:])\n if 0 in new_dims:\n raise IndexError, \"Zero length slices not currently supported\"\n return dummy_array(new_dims,1)\n def __repr__(self):\n val = str((self.name, str(self.shape)))\n return val \n\ndef unary(ary):\n return ary\n\ndef not_implemented(ary):\n return ary\n \n#all imported from Numeric and need to be reassigned.\nunary_op = [arccos, arcsin, arctan, cos, cosh, sin, sinh, \n exp,ceil,floor,fabs,log,log10,sqrt]\n\nunsupported = [argmin,argmax, argsort,around, absolute,sign,negative,floor]\n\nfor func in unary_op:\n func = unary\n \nfor func in unsupported:\n func = not_implemented\n \ndef reduction(ary,axis=0):\n if axis < 0:\n axis += len(ary.shape) \n if axis < 0 or axis >= len(ary.shape):\n raise ValueError, \"Dimension not in array\" \n new_dims = list(ary.shape[:axis]) + list(ary.shape[axis+1:])\n return dummy_array(new_dims,1) \n\n# functions currently not supported by compiler\n# reductions are gonna take some array reordering for the general case,\n# so this is gonna take some thought (probably some tree manipulation).\ndef take(ary,axis=0): raise NotImplemented\n# and all the rest\n \ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "methods": [ + { + "name": "time_it", + "long_name": "time_it( )", + "filename": "size_check.py", + "nloc": 18, + "complexity": 2, + "token_count": 158, + "parameters": [], + "start_line": 13, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "check_expr", + "long_name": "check_expr( expr , local_vars , global_vars = { } )", + "filename": "size_check.py", + "nloc": 21, + "complexity": 9, + "token_count": 159, + "parameters": [ + "expr", + "local_vars", + "global_vars" + ], + "start_line": 34, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "make_same_length", + "long_name": "make_same_length( x , y )", + "filename": "size_check.py", + "nloc": 20, + "complexity": 7, + "token_count": 115, + "parameters": [ + "x", + "y" + ], + "start_line": 65, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "binary_op_size", + "long_name": "binary_op_size( xx , yy )", + "filename": "size_check.py", + "nloc": 13, + "complexity": 5, + "token_count": 100, + "parameters": [ + "xx", + "yy" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , ary , ary_is_shape = 0 , name = None )", + "filename": "size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 47, + "parameters": [ + "self", + "ary", + "ary_is_shape", + "name" + ], + "start_line": 105, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "binary_op", + "long_name": "binary_op( self , other )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 116, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "size_check.py", + "nloc": 6, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "other" + ], + "start_line": 123, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , indices , val )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "indices", + "val" + ], + "start_line": 159, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 162, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 164, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , indices )", + "filename": "size_check.py", + "nloc": 58, + "complexity": 39, + "token_count": 450, + "parameters": [ + "self", + "indices" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unary", + "long_name": "unary( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "not_implemented", + "long_name": "not_implemented( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 257, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "reduction", + "long_name": "reduction( ary , axis = 0 )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 4, + "token_count": 72, + "parameters": [ + "ary", + "axis" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 286, + "end_line": 288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 290, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "time_it", + "long_name": "time_it( )", + "filename": "size_check.py", + "nloc": 18, + "complexity": 2, + "token_count": 158, + "parameters": [], + "start_line": 13, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "check_expr", + "long_name": "check_expr( expr , local_vars , global_vars = { } )", + "filename": "size_check.py", + "nloc": 21, + "complexity": 9, + "token_count": 159, + "parameters": [ + "expr", + "local_vars", + "global_vars" + ], + "start_line": 34, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "make_same_length", + "long_name": "make_same_length( x , y )", + "filename": "size_check.py", + "nloc": 20, + "complexity": 7, + "token_count": 115, + "parameters": [ + "x", + "y" + ], + "start_line": 65, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "binary_op_size", + "long_name": "binary_op_size( xx , yy )", + "filename": "size_check.py", + "nloc": 13, + "complexity": 5, + "token_count": 100, + "parameters": [ + "xx", + "yy" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , ary , ary_is_shape = 0 , name = None )", + "filename": "size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 47, + "parameters": [ + "self", + "ary", + "ary_is_shape", + "name" + ], + "start_line": 105, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "binary_op", + "long_name": "binary_op( self , other )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 116, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "size_check.py", + "nloc": 6, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "other" + ], + "start_line": 123, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , indices , val )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "indices", + "val" + ], + "start_line": 159, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 162, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 164, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , indices )", + "filename": "size_check.py", + "nloc": 58, + "complexity": 39, + "token_count": 450, + "parameters": [ + "self", + "indices" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unary", + "long_name": "unary( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "not_implemented", + "long_name": "not_implemented( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 257, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "reduction", + "long_name": "reduction( ary , axis = 0 )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 4, + "token_count": 72, + "parameters": [ + "ary", + "axis" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 286, + "end_line": 288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 290, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 290, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 286, + "end_line": 288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 213, + "complexity": 82, + "token_count": 1684, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/slice_handler.py", + "new_path": "weave/slice_handler.py", + "filename": "slice_handler.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -155,11 +155,11 @@ def transform_slices(ast_list):\n )\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n if __name__ == \"__main__\": \n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import pprint\nimport string\nfrom ast_tools import * \n\ndef slice_ast_to_dict(ast_seq):\n sl_vars = {}\n if type(ast_seq) in (ListType,TupleType):\n for pattern in slice_patterns:\n found,data = match(pattern,ast_seq)\n if found: \n sl_vars = {'begin':'_beg',\n 'end':'_end', \n 'step':'_stp',\n 'single_index':'_index'}\n for key in data.keys():\n data[key] = ast_to_string(data[key])\n sl_vars.update(data)\n break; \n return sl_vars\n \ndef build_slice_atom(slice_vars, position):\n # Note: This produces slices that are incorrect for Python\n # evaluation because of slicing being exclusive in Python\n # and inclusive for blitz on the top end of the range.\n # This difference should really be handle in a blitz specific transform,\n # but I've put it here for convenience. This doesn't cause any\n # problems in code, its just a maintance hassle (I'll forget I did it here)\n # and inelegant. *FIX ME*.\n \n \n ###########################################################################\n # Handling negative indices.\n #\n # Range indices that begin with a negative sign, '-', are assumed to be\n # negative. Blitz++ interprets negative indices differently than \n # Python. To correct this, we subtract negative indices from the length\n # of the array (at run-time). If indices do not start with a negative \n # sign, they are assumed to be positive.\n #\n # This scheme doesn't work in the general case. For example, if you\n # are calculating negative indices from a math expression that doesn't\n # start with the negative sign, then it will be assumed positive and\n # hence generate wrong results (and maybe a seg-fault).\n # \n # I think this case can might be remedied by calculating all ranges on\n # the fly, and then subtracting them from the length of the array in \n # that dimension if they are negative. This is major code bloat in the\n # funcitons and more work. Save till later...\n ###########################################################################\n # I don't think the strip is necessary, but it insures\n # that '-' is the first sign for negative indices.\n if slice_vars['single_index'] != '_index':\n expr = '%(single_index)s' % slice_vars \n else: \n begin = string.strip(slice_vars['begin'])\n if begin[0] == '-':\n slice_vars['begin'] = 'N' + slice_vars['var']+`position`+begin;\n \n end = string.strip(slice_vars['end'])\n if end != '_end' and end[0] != '-':\n #compensate for blitz using inclusive indexing on top end \n #of slice for positive indices.\n slice_vars['end'] = end + '-1'\n if end[0] == '-':\n slice_vars['end'] = '_N%s[%d]%s-1' % (slice_vars['var'],position,end)\n \n if slice_vars['step'] == '_stp':\n # this if/then isn't strictly necessary, it'll\n # just keep the output code a little cleaner\n expr = 'slice(%(begin)s,%(end)s)' % slice_vars \n else: \n expr = 'slice(%(begin)s,%(end)s,%(step)s)' % slice_vars \n val = atom_list(expr)\n return val\n\ndef transform_subscript_list(subscript_dict):\n # this is gonna edit the ast_list... \n subscript_list = subscript_dict['subscript_list']\n\n var = subscript_dict['var']\n #skip the first entry (the subscript_list symbol)\n slice_position = -1\n for i in range(1,len(subscript_list)):\n #skip commas...\n if subscript_list[i][0] != token.COMMA:\n slice_position += 1\n slice_vars = slice_ast_to_dict(subscript_list[i])\n\n slice_vars['var'] = var\n # create a slice(b,e,s) atom and insert in \n # place of the x:y:z atom in the tree. \n subscript_list[i] = build_slice_atom(slice_vars, slice_position)\n \ndef harvest_subscript_dicts(ast_list):\n \"\"\" Needs Tests!\n \"\"\"\n subscript_lists = []\n if type(ast_list) == ListType:\n found,data = match(indexed_array_pattern,ast_list)\n # data is a dict with 'var' = variable name\n # and 'subscript_list' = to the ast_seq for the subscript list\n if found:\n subscript_lists.append(data)\n for item in ast_list:\n if type(item) == ListType:\n subscript_lists.extend(harvest_subscript_dicts(item))\n return subscript_lists\n\ndef transform_slices(ast_list):\n \"\"\" Walk through an ast_list converting all x:y:z subscripts\n to slice(x,y,z) subscripts.\n \"\"\"\n all_dicts = harvest_subscript_dicts(ast_list)\n for subscript_dict in all_dicts:\n transform_subscript_list(subscript_dict)\n\nslice_patterns = []\nCLN = (token.COLON,':')\nCLN2= (symbol.sliceop, (token.COLON, ':'))\nCLN2_STEP = (symbol.sliceop, (token.COLON, ':'),['step'])\n# [begin:end:step]\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end'], CLN2_STEP ))\n# [:end:step]\nslice_patterns.append((symbol.subscript, CLN,['end'], CLN2_STEP ))\n# [begin::step]\nslice_patterns.append((symbol.subscript, ['begin'],CLN, CLN2_STEP ))\n# [begin:end:]\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end'], CLN2 ))\n# [begin::]\nslice_patterns.append((symbol.subscript, ['begin'],CLN, CLN2 ))\n# [:end:]\nslice_patterns.append((symbol.subscript, CLN,['end'], CLN2, ))\n# [::step]\nslice_patterns.append((symbol.subscript, CLN, CLN2_STEP ))\n# [::]\nslice_patterns.append((symbol.subscript, CLN, CLN2 ))\n\n# begin:end variants\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end']))\nslice_patterns.append((symbol.subscript, CLN,['end']))\nslice_patterns.append((symbol.subscript, ['begin'],CLN))\nslice_patterns.append((symbol.subscript, CLN)) \n\n# a[0] variant -- can't believe I left this out...\nslice_patterns.append((symbol.subscript,['single_index'])) \n\nindexed_array_pattern = \\\n (symbol.power,\n (symbol.atom,(token.NAME, ['var'])),\n (symbol.trailer,\n (token.LSQB, '['),\n ['subscript_list'],\n (token.RSQB, ']')\n )\n )\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\": \n test()", + "source_code_before": "import pprint\nimport string\nfrom ast_tools import * \n\ndef slice_ast_to_dict(ast_seq):\n sl_vars = {}\n if type(ast_seq) in (ListType,TupleType):\n for pattern in slice_patterns:\n found,data = match(pattern,ast_seq)\n if found: \n sl_vars = {'begin':'_beg',\n 'end':'_end', \n 'step':'_stp',\n 'single_index':'_index'}\n for key in data.keys():\n data[key] = ast_to_string(data[key])\n sl_vars.update(data)\n break; \n return sl_vars\n \ndef build_slice_atom(slice_vars, position):\n # Note: This produces slices that are incorrect for Python\n # evaluation because of slicing being exclusive in Python\n # and inclusive for blitz on the top end of the range.\n # This difference should really be handle in a blitz specific transform,\n # but I've put it here for convenience. This doesn't cause any\n # problems in code, its just a maintance hassle (I'll forget I did it here)\n # and inelegant. *FIX ME*.\n \n \n ###########################################################################\n # Handling negative indices.\n #\n # Range indices that begin with a negative sign, '-', are assumed to be\n # negative. Blitz++ interprets negative indices differently than \n # Python. To correct this, we subtract negative indices from the length\n # of the array (at run-time). If indices do not start with a negative \n # sign, they are assumed to be positive.\n #\n # This scheme doesn't work in the general case. For example, if you\n # are calculating negative indices from a math expression that doesn't\n # start with the negative sign, then it will be assumed positive and\n # hence generate wrong results (and maybe a seg-fault).\n # \n # I think this case can might be remedied by calculating all ranges on\n # the fly, and then subtracting them from the length of the array in \n # that dimension if they are negative. This is major code bloat in the\n # funcitons and more work. Save till later...\n ###########################################################################\n # I don't think the strip is necessary, but it insures\n # that '-' is the first sign for negative indices.\n if slice_vars['single_index'] != '_index':\n expr = '%(single_index)s' % slice_vars \n else: \n begin = string.strip(slice_vars['begin'])\n if begin[0] == '-':\n slice_vars['begin'] = 'N' + slice_vars['var']+`position`+begin;\n \n end = string.strip(slice_vars['end'])\n if end != '_end' and end[0] != '-':\n #compensate for blitz using inclusive indexing on top end \n #of slice for positive indices.\n slice_vars['end'] = end + '-1'\n if end[0] == '-':\n slice_vars['end'] = '_N%s[%d]%s-1' % (slice_vars['var'],position,end)\n \n if slice_vars['step'] == '_stp':\n # this if/then isn't strictly necessary, it'll\n # just keep the output code a little cleaner\n expr = 'slice(%(begin)s,%(end)s)' % slice_vars \n else: \n expr = 'slice(%(begin)s,%(end)s,%(step)s)' % slice_vars \n val = atom_list(expr)\n return val\n\ndef transform_subscript_list(subscript_dict):\n # this is gonna edit the ast_list... \n subscript_list = subscript_dict['subscript_list']\n\n var = subscript_dict['var']\n #skip the first entry (the subscript_list symbol)\n slice_position = -1\n for i in range(1,len(subscript_list)):\n #skip commas...\n if subscript_list[i][0] != token.COMMA:\n slice_position += 1\n slice_vars = slice_ast_to_dict(subscript_list[i])\n\n slice_vars['var'] = var\n # create a slice(b,e,s) atom and insert in \n # place of the x:y:z atom in the tree. \n subscript_list[i] = build_slice_atom(slice_vars, slice_position)\n \ndef harvest_subscript_dicts(ast_list):\n \"\"\" Needs Tests!\n \"\"\"\n subscript_lists = []\n if type(ast_list) == ListType:\n found,data = match(indexed_array_pattern,ast_list)\n # data is a dict with 'var' = variable name\n # and 'subscript_list' = to the ast_seq for the subscript list\n if found:\n subscript_lists.append(data)\n for item in ast_list:\n if type(item) == ListType:\n subscript_lists.extend(harvest_subscript_dicts(item))\n return subscript_lists\n\ndef transform_slices(ast_list):\n \"\"\" Walk through an ast_list converting all x:y:z subscripts\n to slice(x,y,z) subscripts.\n \"\"\"\n all_dicts = harvest_subscript_dicts(ast_list)\n for subscript_dict in all_dicts:\n transform_subscript_list(subscript_dict)\n\nslice_patterns = []\nCLN = (token.COLON,':')\nCLN2= (symbol.sliceop, (token.COLON, ':'))\nCLN2_STEP = (symbol.sliceop, (token.COLON, ':'),['step'])\n# [begin:end:step]\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end'], CLN2_STEP ))\n# [:end:step]\nslice_patterns.append((symbol.subscript, CLN,['end'], CLN2_STEP ))\n# [begin::step]\nslice_patterns.append((symbol.subscript, ['begin'],CLN, CLN2_STEP ))\n# [begin:end:]\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end'], CLN2 ))\n# [begin::]\nslice_patterns.append((symbol.subscript, ['begin'],CLN, CLN2 ))\n# [:end:]\nslice_patterns.append((symbol.subscript, CLN,['end'], CLN2, ))\n# [::step]\nslice_patterns.append((symbol.subscript, CLN, CLN2_STEP ))\n# [::]\nslice_patterns.append((symbol.subscript, CLN, CLN2 ))\n\n# begin:end variants\nslice_patterns.append((symbol.subscript, ['begin'],CLN,['end']))\nslice_patterns.append((symbol.subscript, CLN,['end']))\nslice_patterns.append((symbol.subscript, ['begin'],CLN))\nslice_patterns.append((symbol.subscript, CLN)) \n\n# a[0] variant -- can't believe I left this out...\nslice_patterns.append((symbol.subscript,['single_index'])) \n\nindexed_array_pattern = \\\n (symbol.power,\n (symbol.atom,(token.NAME, ['var'])),\n (symbol.trailer,\n (token.LSQB, '['),\n ['subscript_list'],\n (token.RSQB, ']')\n )\n )\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == \"__main__\": \n test()", + "methods": [ + { + "name": "slice_ast_to_dict", + "long_name": "slice_ast_to_dict( ast_seq )", + "filename": "slice_handler.py", + "nloc": 15, + "complexity": 5, + "token_count": 89, + "parameters": [ + "ast_seq" + ], + "start_line": 5, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_slice_atom", + "long_name": "build_slice_atom( slice_vars , position )", + "filename": "slice_handler.py", + "nloc": 18, + "complexity": 7, + "token_count": 143, + "parameters": [ + "slice_vars", + "position" + ], + "start_line": 21, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "transform_subscript_list", + "long_name": "transform_subscript_list( subscript_dict )", + "filename": "slice_handler.py", + "nloc": 10, + "complexity": 3, + "token_count": 76, + "parameters": [ + "subscript_dict" + ], + "start_line": 76, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "harvest_subscript_dicts", + "long_name": "harvest_subscript_dicts( ast_list )", + "filename": "slice_handler.py", + "nloc": 10, + "complexity": 5, + "token_count": 61, + "parameters": [ + "ast_list" + ], + "start_line": 94, + "end_line": 107, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "transform_slices", + "long_name": "transform_slices( ast_list )", + "filename": "slice_handler.py", + "nloc": 4, + "complexity": 2, + "token_count": 21, + "parameters": [ + "ast_list" + ], + "start_line": 109, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 157, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 161, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "slice_ast_to_dict", + "long_name": "slice_ast_to_dict( ast_seq )", + "filename": "slice_handler.py", + "nloc": 15, + "complexity": 5, + "token_count": 89, + "parameters": [ + "ast_seq" + ], + "start_line": 5, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_slice_atom", + "long_name": "build_slice_atom( slice_vars , position )", + "filename": "slice_handler.py", + "nloc": 18, + "complexity": 7, + "token_count": 143, + "parameters": [ + "slice_vars", + "position" + ], + "start_line": 21, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 0 + }, + { + "name": "transform_subscript_list", + "long_name": "transform_subscript_list( subscript_dict )", + "filename": "slice_handler.py", + "nloc": 10, + "complexity": 3, + "token_count": 76, + "parameters": [ + "subscript_dict" + ], + "start_line": 76, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "harvest_subscript_dicts", + "long_name": "harvest_subscript_dicts( ast_list )", + "filename": "slice_handler.py", + "nloc": 10, + "complexity": 5, + "token_count": 61, + "parameters": [ + "ast_list" + ], + "start_line": 94, + "end_line": 107, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "transform_slices", + "long_name": "transform_slices( ast_list )", + "filename": "slice_handler.py", + "nloc": 4, + "complexity": 2, + "token_count": 21, + "parameters": [ + "ast_list" + ], + "start_line": 109, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 157, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 161, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 161, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "slice_handler.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 157, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 94, + "complexity": 24, + "token_count": 780, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/standard_array_spec.py", + "new_path": "weave/standard_array_spec.py", + "filename": "standard_array_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -87,9 +87,9 @@ def __cmp__(self,other):\n cmp(self.__class__, other.__class__)\n \n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "from base_spec import base_converter\nfrom scalar_spec import numeric_to_c_type_mapping\nfrom Numeric import *\nfrom types import *\nimport os\nimport standard_array_info\n\nclass array_converter(base_converter):\n _build_information = [standard_array_info.array_info()]\n \n def type_match(self,value):\n return type(value) is ArrayType\n\n def type_spec(self,name,value):\n # factory\n new_spec = array_converter()\n new_spec.name = name\n new_spec.numeric_type = value.typecode()\n # dims not used, but here for compatibility with blitz_spec\n new_spec.dims = len(shape(value))\n return new_spec\n\n def declaration_code(self,templatize = 0,inline=0):\n if inline:\n code = self.inline_decl_code()\n else:\n code = self.standard_decl_code()\n return code\n \n def inline_decl_code(self):\n type = numeric_to_c_type_mapping[self.numeric_type]\n name = self.name\n var_name = self.retrieve_py_variable(inline=1)\n templ = '// %(name)s array declaration\\n' \\\n 'py_%(name)s= %(var_name)s;\\n' \\\n 'PyArrayObject* %(name)s = convert_to_numpy(py_%(name)s,\"%(name)s\");\\n' \\\n 'int* _N%(name)s = %(name)s->dimensions;\\n' \\\n 'int* _S%(name)s = %(name)s->strides;\\n' \\\n 'int _D%(name)s = %(name)s->nd;\\n' \\\n '%(type)s* %(name)s_data = (%(type)s*) %(name)s->data;\\n' \n code = templ % locals()\n return code\n\n def standard_decl_code(self): \n type = numeric_to_c_type_mapping[self.numeric_type]\n name = self.name\n templ = '// %(name)s array declaration\\n' \\\n 'PyArrayObject* %(name)s = convert_to_numpy(py_%(name)s,\"%(name)s\");\\n' \\\n 'int* _N%(name)s = %(name)s->dimensions;\\n' \\\n 'int* _S%(name)s = %(name)s->strides;\\n' \\\n 'int _D%(name)s = %(name)s->nd;\\n' \\\n '%(type)s* %(name)s_data = (%(type)s*) %(name)s->data;\\n' \n code = templ % locals()\n return code\n #def c_function_declaration_code(self):\n # \"\"\"\n # This doesn't pass the size through. That info is gonna have to \n # be redone in the c function.\n # \"\"\"\n # templ_dict = {}\n # templ_dict['type'] = numeric_to_c_type_mapping[self.numeric_type]\n # templ_dict['dims'] = self.dims\n # templ_dict['name'] = self.name\n # code = 'blitz::Array<%(type)s,%(dims)d> &%(name)s' % templ_dict\n # return code\n \n def local_dict_code(self):\n code = '// for now, array \"%s\" is not returned as arryas are edited' \\\n ' in place (should this change?)\\n' % (self.name) \n return code\n\n def cleanup_code(self):\n # could use Py_DECREF here I think and save NULL test.\n code = \"Py_XDECREF(py_%s);\\n\" % self.name\n return code\n\n def __repr__(self):\n msg = \"(array:: name: %s, type: %s)\" % \\\n (self.name, self.numeric_type)\n return msg\n\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.numeric_type,other.numeric_type) or \\\n cmp(self.dims, other.dims) or \\\n cmp(self.__class__, other.__class__)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "source_code_before": "from base_spec import base_converter\nfrom scalar_spec import numeric_to_c_type_mapping\nfrom Numeric import *\nfrom types import *\nimport os\nimport standard_array_info\n\nclass array_converter(base_converter):\n _build_information = [standard_array_info.array_info()]\n \n def type_match(self,value):\n return type(value) is ArrayType\n\n def type_spec(self,name,value):\n # factory\n new_spec = array_converter()\n new_spec.name = name\n new_spec.numeric_type = value.typecode()\n # dims not used, but here for compatibility with blitz_spec\n new_spec.dims = len(shape(value))\n return new_spec\n\n def declaration_code(self,templatize = 0,inline=0):\n if inline:\n code = self.inline_decl_code()\n else:\n code = self.standard_decl_code()\n return code\n \n def inline_decl_code(self):\n type = numeric_to_c_type_mapping[self.numeric_type]\n name = self.name\n var_name = self.retrieve_py_variable(inline=1)\n templ = '// %(name)s array declaration\\n' \\\n 'py_%(name)s= %(var_name)s;\\n' \\\n 'PyArrayObject* %(name)s = convert_to_numpy(py_%(name)s,\"%(name)s\");\\n' \\\n 'int* _N%(name)s = %(name)s->dimensions;\\n' \\\n 'int* _S%(name)s = %(name)s->strides;\\n' \\\n 'int _D%(name)s = %(name)s->nd;\\n' \\\n '%(type)s* %(name)s_data = (%(type)s*) %(name)s->data;\\n' \n code = templ % locals()\n return code\n\n def standard_decl_code(self): \n type = numeric_to_c_type_mapping[self.numeric_type]\n name = self.name\n templ = '// %(name)s array declaration\\n' \\\n 'PyArrayObject* %(name)s = convert_to_numpy(py_%(name)s,\"%(name)s\");\\n' \\\n 'int* _N%(name)s = %(name)s->dimensions;\\n' \\\n 'int* _S%(name)s = %(name)s->strides;\\n' \\\n 'int _D%(name)s = %(name)s->nd;\\n' \\\n '%(type)s* %(name)s_data = (%(type)s*) %(name)s->data;\\n' \n code = templ % locals()\n return code\n #def c_function_declaration_code(self):\n # \"\"\"\n # This doesn't pass the size through. That info is gonna have to \n # be redone in the c function.\n # \"\"\"\n # templ_dict = {}\n # templ_dict['type'] = numeric_to_c_type_mapping[self.numeric_type]\n # templ_dict['dims'] = self.dims\n # templ_dict['name'] = self.name\n # code = 'blitz::Array<%(type)s,%(dims)d> &%(name)s' % templ_dict\n # return code\n \n def local_dict_code(self):\n code = '// for now, array \"%s\" is not returned as arryas are edited' \\\n ' in place (should this change?)\\n' % (self.name) \n return code\n\n def cleanup_code(self):\n # could use Py_DECREF here I think and save NULL test.\n code = \"Py_XDECREF(py_%s);\\n\" % self.name\n return code\n\n def __repr__(self):\n msg = \"(array:: name: %s, type: %s)\" % \\\n (self.name, self.numeric_type)\n return msg\n\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.numeric_type,other.numeric_type) or \\\n cmp(self.dims, other.dims) or \\\n cmp(self.__class__, other.__class__)\n\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "methods": [ + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "standard_array_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "value" + ], + "start_line": 11, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 14, + "end_line": 21, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 23, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "inline_decl_code", + "long_name": "inline_decl_code( self )", + "filename": "standard_array_spec.py", + "nloc": 13, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 30, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "standard_decl_code", + "long_name": "standard_decl_code( self )", + "filename": "standard_array_spec.py", + "nloc": 11, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "standard_array_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "cleanup_code", + "long_name": "cleanup_code( self )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 72, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "standard_array_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 77, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "standard_array_spec.py", + "nloc": 5, + "complexity": 4, + "token_count": 54, + "parameters": [ + "self", + "other" + ], + "start_line": 82, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 89, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 93, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "standard_array_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "value" + ], + "start_line": 11, + "end_line": 12, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 14, + "end_line": 21, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , templatize = 0 , inline = 0 )", + "filename": "standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 34, + "parameters": [ + "self", + "templatize", + "inline" + ], + "start_line": 23, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "inline_decl_code", + "long_name": "inline_decl_code( self )", + "filename": "standard_array_spec.py", + "nloc": 13, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 30, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "standard_decl_code", + "long_name": "standard_decl_code( self )", + "filename": "standard_array_spec.py", + "nloc": 11, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "local_dict_code", + "long_name": "local_dict_code( self )", + "filename": "standard_array_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "cleanup_code", + "long_name": "cleanup_code( self )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 72, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "standard_array_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 77, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "standard_array_spec.py", + "nloc": 5, + "complexity": 4, + "token_count": 54, + "parameters": [ + "self", + "other" + ], + "start_line": 82, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "level" + ], + "start_line": 89, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "level" + ], + "start_line": 93, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 93, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 89, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 68, + "complexity": 15, + "token_count": 381, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + }, + { + "old_path": "weave/tests/test_scalar_spec.py", + "new_path": "weave/tests/test_scalar_spec.py", + "filename": "test_scalar_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -24,7 +24,7 @@ def remove_whitespace(in_str):\n return out\n \n def print_assert_equal(test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nimport time\nimport os,sys\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport ext_tools\nfrom catalog import unique_file\nfrom build_tools import msvc_exists, gcc_exists\nimport scalar_spec\nrestore_path()\n\ndef unique_mod(d,file_name):\n f = os.path.basename(unique_file(d,file_name))\n m = os.path.splitext(f)[0]\n return m\n \ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_int_converter(unittest.TestCase):\n compiler = '' \n def check_type_match_string(self):\n s = scalar_spec.int_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.int_converter() \n assert(s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.int_converter() \n assert(not s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.int_converter() \n assert(not s.type_match(5.+1j))\n def check_var_in(self):\n test_dir = setup_test_location()\n mod_name = 'int_var_in' + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"a=2;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n \n def check_int_var_local(self):\n test_dir = setup_test_location()\n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"a=2;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler= self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n q={}\n test(b,q)\n teardown_test_location()\n assert(q['a'] == 2)\n def check_int_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"\"\"\n a=a+2;\n return_val = Py::new_reference_to(Py::Int(a));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n c = test(b)\n teardown_test_location()\n assert( c == 3)\n\nclass test_float_converter(unittest.TestCase): \n compiler = ''\n def check_type_match_string(self):\n s = scalar_spec.float_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.float_converter() \n assert(not s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.float_converter() \n assert(s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.float_converter() \n assert(not s.type_match(5.+1j))\n def check_float_var_in(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n\n a = 1.\n code = \"a=2.;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n def check_float_var_local(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.\n code = \"a=2.;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n q={}\n test(b,q)\n teardown_test_location()\n assert(q['a'] == 2.)\n def check_float_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.\n code = \"\"\"\n a=a+2.;\n return_val = Py::new_reference_to(Py::Float(a));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n c = test(b)\n teardown_test_location()\n assert( c == 3.)\n \nclass test_complex_converter(unittest.TestCase): \n compiler = ''\n def check_type_match_string(self):\n s = scalar_spec.complex_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.complex_converter() \n assert(not s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.complex_converter() \n assert(not s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.complex_converter() \n assert(s.type_match(5.+1j))\n def check_complex_var_in(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"a=std::complex(2.,2.);\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n def check_complex_var_local(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"a= a + std::complex(2.,2.);\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n q={}\n test(b,q)\n teardown_test_location() \n assert(q['a'] == 3.+3j)\n def check_complex_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"\"\"\n a= a + std::complex(2.,2.);\n return_val = Py::new_reference_to(Py::Complex(a.real(),a.imag()));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n c = test(b)\n teardown_test_location() \n assert( c == 3.+3j)\n\nclass test_msvc_int_converter(test_int_converter): \n compiler = 'msvc'\nclass test_msvc_float_converter(test_float_converter): \n compiler = 'msvc'\nclass test_msvc_complex_converter(test_complex_converter): \n compiler = 'msvc'\n\nclass test_unix_int_converter(test_int_converter): \n compiler = ''\nclass test_unix_float_converter(test_float_converter): \n compiler = ''\nclass test_unix_complex_converter(test_complex_converter): \n compiler = ''\n\nclass test_gcc_int_converter(test_int_converter): \n compiler = 'gcc'\nclass test_gcc_float_converter(test_float_converter): \n compiler = 'gcc'\nclass test_gcc_complex_converter(test_complex_converter): \n compiler = 'gcc'\n \n\ndef setup_test_location():\n import tempfile\n test_dir = os.path.join(tempfile.gettempdir(),'test_files')\n if not os.path.exists(test_dir):\n os.mkdir(test_dir)\n sys.path.insert(0,test_dir) \n return test_dir\n\ndef teardown_test_location():\n import tempfile\n test_dir = os.path.join(tempfile.gettempdir(),'test_files')\n if sys.path[0] == test_dir:\n sys.path = sys.path[1:]\n return test_dir\n\ndef remove_file(name):\n test_dir = os.path.abspath(name)\n \ndef test_suite(level=1):\n suites = [] \n if level >= 5:\n if msvc_exists():\n suites.append( unittest.makeSuite(test_msvc_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_msvc_float_converter,\n 'check_')) \n suites.append( unittest.makeSuite(test_msvc_complex_converter,\n 'check_'))\n pass\n else: # unix\n suites.append( unittest.makeSuite(test_unix_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_unix_float_converter,\n 'check_')) \n suites.append( unittest.makeSuite(test_unix_complex_converter,\n 'check_'))\n \n if gcc_exists(): \n suites.append( unittest.makeSuite(test_gcc_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_gcc_float_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_gcc_complex_converter,\n 'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest\nimport time\nimport os,sys\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport ext_tools\nfrom catalog import unique_file\nfrom build_tools import msvc_exists, gcc_exists\nimport scalar_spec\nrestore_path()\n\ndef unique_mod(d,file_name):\n f = os.path.basename(unique_file(d,file_name))\n m = os.path.splitext(f)[0]\n return m\n \ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_int_converter(unittest.TestCase):\n compiler = '' \n def check_type_match_string(self):\n s = scalar_spec.int_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.int_converter() \n assert(s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.int_converter() \n assert(not s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.int_converter() \n assert(not s.type_match(5.+1j))\n def check_var_in(self):\n test_dir = setup_test_location()\n mod_name = 'int_var_in' + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"a=2;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n \n def check_int_var_local(self):\n test_dir = setup_test_location()\n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"a=2;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler= self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n q={}\n test(b,q)\n teardown_test_location()\n assert(q['a'] == 2)\n def check_int_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1\n code = \"\"\"\n a=a+2;\n return_val = Py::new_reference_to(Py::Int(a));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1\n c = test(b)\n teardown_test_location()\n assert( c == 3)\n\nclass test_float_converter(unittest.TestCase): \n compiler = ''\n def check_type_match_string(self):\n s = scalar_spec.float_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.float_converter() \n assert(not s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.float_converter() \n assert(s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.float_converter() \n assert(not s.type_match(5.+1j))\n def check_float_var_in(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n\n a = 1.\n code = \"a=2.;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n def check_float_var_local(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.\n code = \"a=2.;\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n q={}\n test(b,q)\n teardown_test_location()\n assert(q['a'] == 2.)\n def check_float_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.\n code = \"\"\"\n a=a+2.;\n return_val = Py::new_reference_to(Py::Float(a));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.\n c = test(b)\n teardown_test_location()\n assert( c == 3.)\n \nclass test_complex_converter(unittest.TestCase): \n compiler = ''\n def check_type_match_string(self):\n s = scalar_spec.complex_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = scalar_spec.complex_converter() \n assert(not s.type_match(5))\n def check_type_match_float(self):\n s = scalar_spec.complex_converter() \n assert(not s.type_match(5.))\n def check_type_match_complex(self):\n s = scalar_spec.complex_converter() \n assert(s.type_match(5.+1j))\n def check_complex_var_in(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"a=std::complex(2.,2.);\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n test(b)\n try:\n b = 1.\n test(b)\n except TypeError:\n pass\n try:\n b = 'abc'\n test(b)\n except TypeError:\n pass\n teardown_test_location()\n def check_complex_var_local(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"a= a + std::complex(2.,2.);\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n q={}\n test(b,q)\n teardown_test_location() \n assert(q['a'] == 3.+3j)\n def check_complex_return(self):\n test_dir = setup_test_location() \n mod_name = sys._getframe().f_code.co_name + self.compiler\n mod_name = unique_mod(test_dir,mod_name)\n mod = ext_tools.ext_module(mod_name)\n a = 1.+1j\n code = \"\"\"\n a= a + std::complex(2.,2.);\n return_val = Py::new_reference_to(Py::Complex(a.real(),a.imag()));\n \"\"\"\n test = ext_tools.ext_function('test',code,['a'])\n mod.add_function(test)\n mod.compile(location = test_dir, compiler = self.compiler)\n exec 'from ' + mod_name + ' import test'\n b=1.+1j\n c = test(b)\n teardown_test_location() \n assert( c == 3.+3j)\n\nclass test_msvc_int_converter(test_int_converter): \n compiler = 'msvc'\nclass test_msvc_float_converter(test_float_converter): \n compiler = 'msvc'\nclass test_msvc_complex_converter(test_complex_converter): \n compiler = 'msvc'\n\nclass test_unix_int_converter(test_int_converter): \n compiler = ''\nclass test_unix_float_converter(test_float_converter): \n compiler = ''\nclass test_unix_complex_converter(test_complex_converter): \n compiler = ''\n\nclass test_gcc_int_converter(test_int_converter): \n compiler = 'gcc'\nclass test_gcc_float_converter(test_float_converter): \n compiler = 'gcc'\nclass test_gcc_complex_converter(test_complex_converter): \n compiler = 'gcc'\n \n\ndef setup_test_location():\n import tempfile\n test_dir = os.path.join(tempfile.gettempdir(),'test_files')\n if not os.path.exists(test_dir):\n os.mkdir(test_dir)\n sys.path.insert(0,test_dir) \n return test_dir\n\ndef teardown_test_location():\n import tempfile\n test_dir = os.path.join(tempfile.gettempdir(),'test_files')\n if sys.path[0] == test_dir:\n sys.path = sys.path[1:]\n return test_dir\n\ndef remove_file(name):\n test_dir = os.path.abspath(name)\n \ndef test_suite(level=1):\n suites = [] \n if level >= 5:\n if msvc_exists():\n suites.append( unittest.makeSuite(test_msvc_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_msvc_float_converter,\n 'check_')) \n suites.append( unittest.makeSuite(test_msvc_complex_converter,\n 'check_'))\n pass\n else: # unix\n suites.append( unittest.makeSuite(test_unix_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_unix_float_converter,\n 'check_')) \n suites.append( unittest.makeSuite(test_unix_complex_converter,\n 'check_'))\n \n if gcc_exists(): \n suites.append( unittest.makeSuite(test_gcc_int_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_gcc_float_converter,\n 'check_'))\n suites.append( unittest.makeSuite(test_gcc_complex_converter,\n 'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "unique_mod", + "long_name": "unique_mod( d , file_name )", + "filename": "test_scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "d", + "file_name" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_scalar_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 19, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_scalar_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 26, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 53, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_var_in", + "long_name": "check_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 116, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + }, + { + "name": "check_int_var_local", + "long_name": "check_int_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 112, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_int_return", + "long_name": "check_int_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 118, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 124, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_float_var_in", + "long_name": "check_float_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 126, + "parameters": [ + "self" + ], + "start_line": 130, + "end_line": 154, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "check_float_var_local", + "long_name": "check_float_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 155, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_float_return", + "long_name": "check_float_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 108, + "parameters": [ + "self" + ], + "start_line": 171, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 197, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 198, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_var_in", + "long_name": "check_complex_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 130, + "parameters": [ + "self" + ], + "start_line": 204, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + }, + { + "name": "check_complex_var_local", + "long_name": "check_complex_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 121, + "parameters": [ + "self" + ], + "start_line": 228, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_complex_return", + "long_name": "check_complex_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 114, + "parameters": [ + "self" + ], + "start_line": 244, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "setup_test_location", + "long_name": "setup_test_location( )", + "filename": "test_scalar_spec.py", + "nloc": 7, + "complexity": 2, + "token_count": 51, + "parameters": [], + "start_line": 285, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "teardown_test_location", + "long_name": "teardown_test_location( )", + "filename": "test_scalar_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 45, + "parameters": [], + "start_line": 293, + "end_line": 298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_file", + "long_name": "remove_file( name )", + "filename": "test_scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "name" + ], + "start_line": 300, + "end_line": 301, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_scalar_spec.py", + "nloc": 27, + "complexity": 4, + "token_count": 156, + "parameters": [ + "level" + ], + "start_line": 303, + "end_line": 331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_scalar_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 333, + "end_line": 337, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "unique_mod", + "long_name": "unique_mod( d , file_name )", + "filename": "test_scalar_spec.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "d", + "file_name" + ], + "start_line": 14, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_scalar_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 19, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_scalar_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 26, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 53, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_var_in", + "long_name": "check_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 116, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + }, + { + "name": "check_int_var_local", + "long_name": "check_int_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 112, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_int_return", + "long_name": "check_int_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 118, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 124, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_float_var_in", + "long_name": "check_float_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 126, + "parameters": [ + "self" + ], + "start_line": 130, + "end_line": 154, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "check_float_var_local", + "long_name": "check_float_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 155, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_float_return", + "long_name": "check_float_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 108, + "parameters": [ + "self" + ], + "start_line": 171, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 197, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_float", + "long_name": "check_type_match_float( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "self" + ], + "start_line": 198, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_complex", + "long_name": "check_type_match_complex( self )", + "filename": "test_scalar_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 201, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_var_in", + "long_name": "check_complex_var_in( self )", + "filename": "test_scalar_spec.py", + "nloc": 24, + "complexity": 3, + "token_count": 130, + "parameters": [ + "self" + ], + "start_line": 204, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 1 + }, + { + "name": "check_complex_var_local", + "long_name": "check_complex_var_local( self )", + "filename": "test_scalar_spec.py", + "nloc": 16, + "complexity": 1, + "token_count": 121, + "parameters": [ + "self" + ], + "start_line": 228, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 1 + }, + { + "name": "check_complex_return", + "long_name": "check_complex_return( self )", + "filename": "test_scalar_spec.py", + "nloc": 18, + "complexity": 1, + "token_count": 114, + "parameters": [ + "self" + ], + "start_line": 244, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "setup_test_location", + "long_name": "setup_test_location( )", + "filename": "test_scalar_spec.py", + "nloc": 7, + "complexity": 2, + "token_count": 51, + "parameters": [], + "start_line": 285, + "end_line": 291, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "teardown_test_location", + "long_name": "teardown_test_location( )", + "filename": "test_scalar_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 45, + "parameters": [], + "start_line": 293, + "end_line": 298, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_file", + "long_name": "remove_file( name )", + "filename": "test_scalar_spec.py", + "nloc": 2, + "complexity": 1, + "token_count": 15, + "parameters": [ + "name" + ], + "start_line": 300, + "end_line": 301, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_scalar_spec.py", + "nloc": 27, + "complexity": 4, + "token_count": 156, + "parameters": [ + "level" + ], + "start_line": 303, + "end_line": 331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_scalar_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 333, + "end_line": 337, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_scalar_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 26, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 316, + "complexity": 41, + "token_count": 1959, + "diff_parsed": { + "added": [ + " \"\"\"this should probably be in scipy_base.testing" + ], + "deleted": [ + " \"\"\"this should probably be in scipy_test" + ] + } + }, + { + "old_path": "weave/tests/test_size_check.py", + "new_path": "weave/tests/test_size_check.py", + "filename": "test_size_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -16,7 +16,7 @@\n empty = array(())\n \n def array_assert_equal(test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n@@ -128,7 +128,7 @@ def check_error2(self):\n \n class test_dummy_array(test_binary_op_size):\n def array_assert_equal(self,test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n@@ -165,7 +165,7 @@ def desired_type(self,val):\n \n class test_dummy_array_indexing(unittest.TestCase):\n def array_assert_equal(self,test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n@@ -363,7 +363,7 @@ def check_error1(self):\n \n class test_expressions(unittest.TestCase): \n def array_assert_equal(self,test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n", + "added_lines": 4, + "deleted_lines": 4, + "source_code": "import unittest, os\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport size_check\nfrom ast_tools import *\nrestore_path()\n\nempty = array(())\n \ndef array_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired)))\n except AssertionError:\n try:\n # kluge for bug in Numeric\n assert (len(actual[0]) == len(actual[1]) == \n len(desired[0]) == len(desired[1]) == 0)\n except: \n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_make_same_length(unittest.TestCase):\n\n def generic_test(self,x,y,desired):\n actual = size_check.make_same_length(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n\n def check_scalar(self):\n x,y = (),()\n desired = empty,empty \n self.generic_test(x,y,desired)\n def check_x_scalar(self):\n x,y = (),(1,2)\n desired = array((1,1)),array((1,2))\n self.generic_test(x,y,desired)\n def check_y_scalar(self):\n x,y = (1,2),()\n desired = array((1,2)),array((1,1))\n self.generic_test(x,y,desired)\n def check_x_short(self):\n x,y = (1,2),(1,2,3)\n desired = array((1,1,2)),array((1,2,3))\n self.generic_test(x,y,desired)\n def check_y_short(self):\n x,y = (1,2,3),(1,2)\n desired = array((1,2,3)),array((1,1,2))\n self.generic_test(x,y,desired)\n\nclass test_binary_op_size(unittest.TestCase):\n def generic_test(self,x,y,desired):\n actual = size_check.binary_op_size(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n actual = size_check.binary_op_size(x,y)\n #print actual\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return array(val) \n def check_scalar(self):\n x,y = (),()\n desired = self.desired_type(())\n self.generic_test(x,y,desired)\n def check_x1(self):\n x,y = (1,),()\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_y1(self):\n x,y = (),(1,)\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_x_y(self):\n x,y = (5,),(5,)\n desired = self.desired_type((5,))\n self.generic_test(x,y,desired)\n def check_x_y2(self):\n x,y = (5,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y3(self):\n x,y = (5,10),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y4(self):\n x,y = (1,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y5(self):\n x,y = (5,1),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y6(self):\n x,y = (1,10),(5,1)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y7(self):\n x,y = (5,4,3,2,1),(3,2,1)\n desired = self.desired_type((5,4,3,2,1))\n self.generic_test(x,y,desired)\n \n def check_error1(self):\n x,y = (5,),(4,)\n self.generic_error_test(x,y)\n def check_error2(self):\n x,y = (5,5),(4,5)\n self.generic_error_test(x,y)\n\nclass test_dummy_array(test_binary_op_size):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue() \n def generic_test(self,x,y,desired):\n if type(x) is type(()):\n x = ones(x)\n if type(y) is type(()):\n y = ones(y)\n xx = size_check.dummy_array(x)\n yy = size_check.dummy_array(y)\n ops = ['+', '-', '/', '*', '<<', '>>']\n for op in ops:\n actual = eval('xx' + op + 'yy')\n desired = desired\n self.array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n self.generic_test('',x,y)\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return size_check.dummy_array(array(val),1)\n\nclass test_dummy_array_indexing(unittest.TestCase):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,ary,expr,desired):\n a = size_check.dummy_array(ary)\n actual = eval(expr).shape \n #print desired, actual\n self.array_assert_equal(expr,actual,desired)\n def generic_wrap(self,a,expr):\n #print expr ,eval(expr)\n desired = array(eval(expr).shape)\n try:\n self.generic_test(a,expr,desired)\n except IndexError:\n if 0 not in desired:\n msg = '%s raised IndexError in dummy_array, but forms\\n' \\\n 'valid array shape -> %s' % (expr, str(desired))\n raise AttributeError, msg \n def generic_1d(self,expr):\n a = arange(10)\n self.generic_wrap(a,expr)\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \n def generic_1d_index(self,expr):\n a = arange(10)\n #print expr ,eval(expr)\n desired = array(())\n self.generic_test(a,expr,desired)\n def check_1d_index_0(self):\n self.generic_1d_index('a[0]')\n def check_1d_index_1(self):\n self.generic_1d_index('a[4]')\n def check_1d_index_2(self):\n self.generic_1d_index('a[-4]')\n def check_1d_index_3(self):\n try: self.generic_1d('a[12]')\n except IndexError: pass \n def check_1d_index_calculated(self):\n self.generic_1d_index('a[0+1]')\n def check_1d_0(self):\n self.generic_1d('a[:]')\n def check_1d_1(self): \n self.generic_1d('a[1:]')\n def check_1d_2(self): \n self.generic_1d('a[-1:]')\n def check_1d_3(self):\n # dummy_array is \"bug for bug\" equiv to Numeric.array\n # on wrapping of indices.\n self.generic_1d('a[-11:]')\n def check_1d_4(self): \n self.generic_1d('a[:1]')\n def check_1d_5(self): \n self.generic_1d('a[:-1]')\n def check_1d_6(self): \n self.generic_1d('a[:-11]')\n def check_1d_7(self): \n self.generic_1d('a[1:5]')\n def check_1d_8(self): \n self.generic_1d('a[1:-5]')\n def check_1d_9(self):\n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[-1:-5]')\n except IndexError: pass \n def check_1d_10(self): \n self.generic_1d('a[-5:-1]')\n \n def check_1d_stride_0(self): \n self.generic_1d('a[::1]') \n def check_1d_stride_1(self): \n self.generic_1d('a[::-1]') \n def check_1d_stride_2(self): \n self.generic_1d('a[1::1]') \n def check_1d_stride_3(self): \n self.generic_1d('a[1::-1]') \n def check_1d_stride_4(self): \n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[1:5:-1]') \n except IndexError: pass \n def check_1d_stride_5(self): \n self.generic_1d('a[5:1:-1]') \n def check_1d_stride_6(self): \n self.generic_1d('a[:4:1]') \n def check_1d_stride_7(self): \n self.generic_1d('a[:4:-1]') \n def check_1d_stride_8(self): \n self.generic_1d('a[:-4:1]') \n def check_1d_stride_9(self): \n self.generic_1d('a[:-4:-1]') \n def check_1d_stride_10(self): \n self.generic_1d('a[:-3:2]') \n def check_1d_stride_11(self): \n self.generic_1d('a[:-3:-2]') \n def check_1d_stride_12(self): \n self.generic_1d('a[:-3:-7]') \n def check_1d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50\n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n self.generic_1d('a[%s:%s:%s]' %(beg,end,step)) \n except IndexError:\n pass\n\n def check_2d_0(self):\n self.generic_2d('a[:]')\n def check_2d_1(self):\n self.generic_2d('a[:2]')\n def check_2d_2(self):\n self.generic_2d('a[:,:]')\n def check_2d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n beg2 = whrandom.choice(choices)\n end2 = whrandom.choice(choices)\n step2 = whrandom.choice(choices) \n expr = 'a[%s:%s:%s,%s:%s:%s]' %(beg,end,step,beg2,end2,step2)\n self.generic_2d(expr) \n except IndexError:\n pass\n def check_3d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n idx = []\n for i in range(9):\n idx.append(whrandom.choice(choices))\n expr = 'a[%s:%s:%s,%s:%s:%s,%s:%s:%s]' % tuple(idx)\n self.generic_3d(expr) \n except IndexError:\n pass\n\nclass test_reduction(unittest.TestCase):\n def check_1d_0(self):\n a = ones((5,))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_0(self):\n a = ones((5,10))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((10,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_1(self):\n a = ones((5,10))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_3d_0(self):\n a = ones((5,6,7))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,7),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_error0(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,-2)\n except ValueError:\n pass \n def check_error1(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,1)\n except ValueError:\n pass \n\nclass test_expressions(unittest.TestCase): \n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,expr,desired,**kw):\n import parser\n ast_list = parser.expr(expr).tolist()\n args = harvest_variables(ast_list)\n loc = locals().update(kw)\n for var in args:\n s='%s = size_check.dummy_array(%s)'% (var,var)\n exec(s,loc)\n try: \n actual = eval(expr,locals()).shape \n except:\n actual = 'failed' \n if actual is 'failed' and desired is 'failed':\n return\n try: \n self.array_assert_equal(expr,actual,desired)\n except:\n print 'EXPR:',expr\n print 'ACTUAL:',actual\n print 'DEISRED:',desired\n def generic_wrap(self,expr,**kw):\n try:\n x = array(eval(expr,kw))\n try:\n desired = x.shape\n except:\n desired = zeros(())\n except:\n desired = 'failed'\n self.generic_test(expr,desired,**kw)\n def check_generic_1d(self):\n a = arange(10) \n expr = 'a[:]' \n self.generic_wrap(expr,a=a)\n expr = 'a[:] + a' \n self.generic_wrap(expr,a=a)\n bad_expr = 'a[4:] + a' \n self.generic_wrap(bad_expr,a=a)\n a = arange(10) \n b = ones((1,10))\n expr = 'a + b' \n self.generic_wrap(expr,a=a,b=b)\n bad_expr = 'a[:5] + b' \n self.generic_wrap(bad_expr,a=a,b=b)\n def check_single_index(self): \n a = arange(10) \n expr = 'a[5] + a[3]' \n self.generic_wrap(expr,a=a)\n \n def check_calculated_index(self): \n a = arange(10) \n nx = 0\n expr = 'a[5] + a[nx+3]' \n size_check.check_expr(expr,locals())\n def check_calculated_index2(self): \n a = arange(10) \n nx = 0\n expr = 'a[1:5] + a[nx+1:5+nx]' \n size_check.check_expr(expr,locals())\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_make_same_length,'check_') )\n suites.append( unittest.makeSuite(test_binary_op_size,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array_indexing,'check_') )\n suites.append( unittest.makeSuite(test_reduction,'check_') )\n suites.append( unittest.makeSuite(test_expressions,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest, os\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport size_check\nfrom ast_tools import *\nrestore_path()\n\nempty = array(())\n \ndef array_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired)))\n except AssertionError:\n try:\n # kluge for bug in Numeric\n assert (len(actual[0]) == len(actual[1]) == \n len(desired[0]) == len(desired[1]) == 0)\n except: \n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_make_same_length(unittest.TestCase):\n\n def generic_test(self,x,y,desired):\n actual = size_check.make_same_length(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n\n def check_scalar(self):\n x,y = (),()\n desired = empty,empty \n self.generic_test(x,y,desired)\n def check_x_scalar(self):\n x,y = (),(1,2)\n desired = array((1,1)),array((1,2))\n self.generic_test(x,y,desired)\n def check_y_scalar(self):\n x,y = (1,2),()\n desired = array((1,2)),array((1,1))\n self.generic_test(x,y,desired)\n def check_x_short(self):\n x,y = (1,2),(1,2,3)\n desired = array((1,1,2)),array((1,2,3))\n self.generic_test(x,y,desired)\n def check_y_short(self):\n x,y = (1,2,3),(1,2)\n desired = array((1,2,3)),array((1,1,2))\n self.generic_test(x,y,desired)\n\nclass test_binary_op_size(unittest.TestCase):\n def generic_test(self,x,y,desired):\n actual = size_check.binary_op_size(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n actual = size_check.binary_op_size(x,y)\n #print actual\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return array(val) \n def check_scalar(self):\n x,y = (),()\n desired = self.desired_type(())\n self.generic_test(x,y,desired)\n def check_x1(self):\n x,y = (1,),()\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_y1(self):\n x,y = (),(1,)\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_x_y(self):\n x,y = (5,),(5,)\n desired = self.desired_type((5,))\n self.generic_test(x,y,desired)\n def check_x_y2(self):\n x,y = (5,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y3(self):\n x,y = (5,10),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y4(self):\n x,y = (1,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y5(self):\n x,y = (5,1),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y6(self):\n x,y = (1,10),(5,1)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y7(self):\n x,y = (5,4,3,2,1),(3,2,1)\n desired = self.desired_type((5,4,3,2,1))\n self.generic_test(x,y,desired)\n \n def check_error1(self):\n x,y = (5,),(4,)\n self.generic_error_test(x,y)\n def check_error2(self):\n x,y = (5,5),(4,5)\n self.generic_error_test(x,y)\n\nclass test_dummy_array(test_binary_op_size):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint \n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue() \n def generic_test(self,x,y,desired):\n if type(x) is type(()):\n x = ones(x)\n if type(y) is type(()):\n y = ones(y)\n xx = size_check.dummy_array(x)\n yy = size_check.dummy_array(y)\n ops = ['+', '-', '/', '*', '<<', '>>']\n for op in ops:\n actual = eval('xx' + op + 'yy')\n desired = desired\n self.array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n self.generic_test('',x,y)\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return size_check.dummy_array(array(val),1)\n\nclass test_dummy_array_indexing(unittest.TestCase):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,ary,expr,desired):\n a = size_check.dummy_array(ary)\n actual = eval(expr).shape \n #print desired, actual\n self.array_assert_equal(expr,actual,desired)\n def generic_wrap(self,a,expr):\n #print expr ,eval(expr)\n desired = array(eval(expr).shape)\n try:\n self.generic_test(a,expr,desired)\n except IndexError:\n if 0 not in desired:\n msg = '%s raised IndexError in dummy_array, but forms\\n' \\\n 'valid array shape -> %s' % (expr, str(desired))\n raise AttributeError, msg \n def generic_1d(self,expr):\n a = arange(10)\n self.generic_wrap(a,expr)\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \n def generic_1d_index(self,expr):\n a = arange(10)\n #print expr ,eval(expr)\n desired = array(())\n self.generic_test(a,expr,desired)\n def check_1d_index_0(self):\n self.generic_1d_index('a[0]')\n def check_1d_index_1(self):\n self.generic_1d_index('a[4]')\n def check_1d_index_2(self):\n self.generic_1d_index('a[-4]')\n def check_1d_index_3(self):\n try: self.generic_1d('a[12]')\n except IndexError: pass \n def check_1d_index_calculated(self):\n self.generic_1d_index('a[0+1]')\n def check_1d_0(self):\n self.generic_1d('a[:]')\n def check_1d_1(self): \n self.generic_1d('a[1:]')\n def check_1d_2(self): \n self.generic_1d('a[-1:]')\n def check_1d_3(self):\n # dummy_array is \"bug for bug\" equiv to Numeric.array\n # on wrapping of indices.\n self.generic_1d('a[-11:]')\n def check_1d_4(self): \n self.generic_1d('a[:1]')\n def check_1d_5(self): \n self.generic_1d('a[:-1]')\n def check_1d_6(self): \n self.generic_1d('a[:-11]')\n def check_1d_7(self): \n self.generic_1d('a[1:5]')\n def check_1d_8(self): \n self.generic_1d('a[1:-5]')\n def check_1d_9(self):\n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[-1:-5]')\n except IndexError: pass \n def check_1d_10(self): \n self.generic_1d('a[-5:-1]')\n \n def check_1d_stride_0(self): \n self.generic_1d('a[::1]') \n def check_1d_stride_1(self): \n self.generic_1d('a[::-1]') \n def check_1d_stride_2(self): \n self.generic_1d('a[1::1]') \n def check_1d_stride_3(self): \n self.generic_1d('a[1::-1]') \n def check_1d_stride_4(self): \n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[1:5:-1]') \n except IndexError: pass \n def check_1d_stride_5(self): \n self.generic_1d('a[5:1:-1]') \n def check_1d_stride_6(self): \n self.generic_1d('a[:4:1]') \n def check_1d_stride_7(self): \n self.generic_1d('a[:4:-1]') \n def check_1d_stride_8(self): \n self.generic_1d('a[:-4:1]') \n def check_1d_stride_9(self): \n self.generic_1d('a[:-4:-1]') \n def check_1d_stride_10(self): \n self.generic_1d('a[:-3:2]') \n def check_1d_stride_11(self): \n self.generic_1d('a[:-3:-2]') \n def check_1d_stride_12(self): \n self.generic_1d('a[:-3:-7]') \n def check_1d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50\n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n self.generic_1d('a[%s:%s:%s]' %(beg,end,step)) \n except IndexError:\n pass\n\n def check_2d_0(self):\n self.generic_2d('a[:]')\n def check_2d_1(self):\n self.generic_2d('a[:2]')\n def check_2d_2(self):\n self.generic_2d('a[:,:]')\n def check_2d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n beg2 = whrandom.choice(choices)\n end2 = whrandom.choice(choices)\n step2 = whrandom.choice(choices) \n expr = 'a[%s:%s:%s,%s:%s:%s]' %(beg,end,step,beg2,end2,step2)\n self.generic_2d(expr) \n except IndexError:\n pass\n def check_3d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n idx = []\n for i in range(9):\n idx.append(whrandom.choice(choices))\n expr = 'a[%s:%s:%s,%s:%s:%s,%s:%s:%s]' % tuple(idx)\n self.generic_3d(expr) \n except IndexError:\n pass\n\nclass test_reduction(unittest.TestCase):\n def check_1d_0(self):\n a = ones((5,))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_0(self):\n a = ones((5,10))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((10,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_1(self):\n a = ones((5,10))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_3d_0(self):\n a = ones((5,6,7))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,7),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_error0(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,-2)\n except ValueError:\n pass \n def check_error1(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,1)\n except ValueError:\n pass \n\nclass test_expressions(unittest.TestCase): \n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,expr,desired,**kw):\n import parser\n ast_list = parser.expr(expr).tolist()\n args = harvest_variables(ast_list)\n loc = locals().update(kw)\n for var in args:\n s='%s = size_check.dummy_array(%s)'% (var,var)\n exec(s,loc)\n try: \n actual = eval(expr,locals()).shape \n except:\n actual = 'failed' \n if actual is 'failed' and desired is 'failed':\n return\n try: \n self.array_assert_equal(expr,actual,desired)\n except:\n print 'EXPR:',expr\n print 'ACTUAL:',actual\n print 'DEISRED:',desired\n def generic_wrap(self,expr,**kw):\n try:\n x = array(eval(expr,kw))\n try:\n desired = x.shape\n except:\n desired = zeros(())\n except:\n desired = 'failed'\n self.generic_test(expr,desired,**kw)\n def check_generic_1d(self):\n a = arange(10) \n expr = 'a[:]' \n self.generic_wrap(expr,a=a)\n expr = 'a[:] + a' \n self.generic_wrap(expr,a=a)\n bad_expr = 'a[4:] + a' \n self.generic_wrap(bad_expr,a=a)\n a = arange(10) \n b = ones((1,10))\n expr = 'a + b' \n self.generic_wrap(expr,a=a,b=b)\n bad_expr = 'a[:5] + b' \n self.generic_wrap(bad_expr,a=a,b=b)\n def check_single_index(self): \n a = arange(10) \n expr = 'a[5] + a[3]' \n self.generic_wrap(expr,a=a)\n \n def check_calculated_index(self): \n a = arange(10) \n nx = 0\n expr = 'a[5] + a[nx+3]' \n size_check.check_expr(expr,locals())\n def check_calculated_index2(self): \n a = arange(10) \n nx = 0\n expr = 'a[1:5] + a[nx+1:5+nx]' \n size_check.check_expr(expr,locals())\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_make_same_length,'check_') )\n suites.append( unittest.makeSuite(test_binary_op_size,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array_indexing,'check_') )\n suites.append( unittest.makeSuite(test_reduction,'check_') )\n suites.append( unittest.makeSuite(test_expressions,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 120, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 18, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_scalar", + "long_name": "check_x_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_scalar", + "long_name": "check_y_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 54, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_short", + "long_name": "check_x_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 58, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_short", + "long_name": "check_y_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 68, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 72, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "val" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x1", + "long_name": "check_x1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 85, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y1", + "long_name": "check_y1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y", + "long_name": "check_x_y( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y2", + "long_name": "check_x_y2( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y3", + "long_name": "check_x_y3( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y4", + "long_name": "check_x_y4( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 105, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y5", + "long_name": "check_x_y5( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y6", + "long_name": "check_x_y6( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y7", + "long_name": "check_x_y7( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_error2", + "long_name": "check_error2( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 76, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 130, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 106, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 145, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 157, + "end_line": 162, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "val" + ], + "start_line": 163, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 167, + "end_line": 181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , ary , expr , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "ary", + "expr", + "desired" + ], + "start_line": 182, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , a , expr )", + "filename": "test_size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "a", + "expr" + ], + "start_line": 187, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "generic_1d", + "long_name": "generic_1d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "expr" + ], + "start_line": 197, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_1d_index", + "long_name": "generic_1d_index( self , expr )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self", + "expr" + ], + "start_line": 207, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_0", + "long_name": "check_1d_index_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 212, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_1", + "long_name": "check_1d_index_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 214, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_2", + "long_name": "check_1d_index_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 216, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_3", + "long_name": "check_1d_index_3( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_calculated", + "long_name": "check_1d_index_calculated( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 221, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 223, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_1", + "long_name": "check_1d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 225, + "end_line": 226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_2", + "long_name": "check_1d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_3", + "long_name": "check_1d_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 229, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_4", + "long_name": "check_1d_4( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_5", + "long_name": "check_1d_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_6", + "long_name": "check_1d_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_7", + "long_name": "check_1d_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 239, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_8", + "long_name": "check_1d_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 242, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_9", + "long_name": "check_1d_9( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_10", + "long_name": "check_1d_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_0", + "long_name": "check_1d_stride_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_1", + "long_name": "check_1d_stride_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_2", + "long_name": "check_1d_stride_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_3", + "long_name": "check_1d_stride_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_4", + "long_name": "check_1d_stride_4( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 258, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_5", + "long_name": "check_1d_stride_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 262, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_6", + "long_name": "check_1d_stride_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_7", + "long_name": "check_1d_stride_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 266, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_8", + "long_name": "check_1d_stride_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_9", + "long_name": "check_1d_stride_9( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 270, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_10", + "long_name": "check_1d_stride_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 272, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_11", + "long_name": "check_1d_stride_11( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 274, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_12", + "long_name": "check_1d_stride_12( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 276, + "end_line": 277, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_random", + "long_name": "check_1d_random( self )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 3, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 278, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 294, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_2", + "long_name": "check_2d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_random", + "long_name": "check_2d_random( self )", + "filename": "test_size_check.py", + "nloc": 15, + "complexity": 3, + "token_count": 120, + "parameters": [ + "self" + ], + "start_line": 298, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_3d_random", + "long_name": "check_3d_random( self )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 315, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 336, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3d_0", + "long_name": "check_3d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_error0", + "long_name": "check_error0( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 357, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 365, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired , ** kw )", + "filename": "test_size_check.py", + "nloc": 20, + "complexity": 6, + "token_count": 117, + "parameters": [ + "self", + "expr", + "desired", + "kw" + ], + "start_line": 380, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , expr , ** kw )", + "filename": "test_size_check.py", + "nloc": 10, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "expr", + "kw" + ], + "start_line": 400, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_generic_1d", + "long_name": "check_generic_1d( self )", + "filename": "test_size_check.py", + "nloc": 14, + "complexity": 1, + "token_count": 100, + "parameters": [ + "self" + ], + "start_line": 410, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 424, + "end_line": 427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index", + "long_name": "check_calculated_index( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index2", + "long_name": "check_calculated_index2( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 434, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 439, + "end_line": 441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 104, + "parameters": [ + "level" + ], + "start_line": 446, + "end_line": 456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 458, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 120, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 18, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_scalar", + "long_name": "check_x_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_scalar", + "long_name": "check_y_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 54, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_short", + "long_name": "check_x_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 58, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_short", + "long_name": "check_y_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 68, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 72, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "val" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x1", + "long_name": "check_x1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 85, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y1", + "long_name": "check_y1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y", + "long_name": "check_x_y( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y2", + "long_name": "check_x_y2( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y3", + "long_name": "check_x_y3( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y4", + "long_name": "check_x_y4( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 105, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y5", + "long_name": "check_x_y5( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y6", + "long_name": "check_x_y6( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y7", + "long_name": "check_x_y7( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_error2", + "long_name": "check_error2( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 76, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 130, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 106, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 145, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 157, + "end_line": 162, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "val" + ], + "start_line": 163, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 167, + "end_line": 181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , ary , expr , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "ary", + "expr", + "desired" + ], + "start_line": 182, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , a , expr )", + "filename": "test_size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "a", + "expr" + ], + "start_line": 187, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "generic_1d", + "long_name": "generic_1d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "expr" + ], + "start_line": 197, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_1d_index", + "long_name": "generic_1d_index( self , expr )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self", + "expr" + ], + "start_line": 207, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_0", + "long_name": "check_1d_index_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 212, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_1", + "long_name": "check_1d_index_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 214, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_2", + "long_name": "check_1d_index_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 216, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_3", + "long_name": "check_1d_index_3( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_calculated", + "long_name": "check_1d_index_calculated( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 221, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 223, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_1", + "long_name": "check_1d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 225, + "end_line": 226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_2", + "long_name": "check_1d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_3", + "long_name": "check_1d_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 229, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_4", + "long_name": "check_1d_4( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_5", + "long_name": "check_1d_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_6", + "long_name": "check_1d_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_7", + "long_name": "check_1d_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 239, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_8", + "long_name": "check_1d_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 242, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_9", + "long_name": "check_1d_9( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_10", + "long_name": "check_1d_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_0", + "long_name": "check_1d_stride_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_1", + "long_name": "check_1d_stride_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_2", + "long_name": "check_1d_stride_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_3", + "long_name": "check_1d_stride_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_4", + "long_name": "check_1d_stride_4( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 258, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_5", + "long_name": "check_1d_stride_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 262, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_6", + "long_name": "check_1d_stride_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_7", + "long_name": "check_1d_stride_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 266, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_8", + "long_name": "check_1d_stride_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_9", + "long_name": "check_1d_stride_9( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 270, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_10", + "long_name": "check_1d_stride_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 272, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_11", + "long_name": "check_1d_stride_11( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 274, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_12", + "long_name": "check_1d_stride_12( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 276, + "end_line": 277, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_random", + "long_name": "check_1d_random( self )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 3, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 278, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 294, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_2", + "long_name": "check_2d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_random", + "long_name": "check_2d_random( self )", + "filename": "test_size_check.py", + "nloc": 15, + "complexity": 3, + "token_count": 120, + "parameters": [ + "self" + ], + "start_line": 298, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_3d_random", + "long_name": "check_3d_random( self )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 315, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 336, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3d_0", + "long_name": "check_3d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_error0", + "long_name": "check_error0( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 357, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 365, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired , ** kw )", + "filename": "test_size_check.py", + "nloc": 20, + "complexity": 6, + "token_count": 117, + "parameters": [ + "self", + "expr", + "desired", + "kw" + ], + "start_line": 380, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , expr , ** kw )", + "filename": "test_size_check.py", + "nloc": 10, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "expr", + "kw" + ], + "start_line": 400, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_generic_1d", + "long_name": "check_generic_1d( self )", + "filename": "test_size_check.py", + "nloc": 14, + "complexity": 1, + "token_count": 100, + "parameters": [ + "self" + ], + "start_line": 410, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 424, + "end_line": 427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index", + "long_name": "check_calculated_index( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index2", + "long_name": "check_calculated_index2( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 434, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 439, + "end_line": 441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 104, + "parameters": [ + "level" + ], + "start_line": 446, + "end_line": 456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 458, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 120, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 18, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 76, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 130, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + } + ], + "nloc": 421, + "complexity": 117, + "token_count": 3159, + "diff_parsed": { + "added": [ + " \"\"\"this should probably be in scipy_base.testing", + " \"\"\"this should probably be in scipy_base.testing", + " \"\"\"this should probably be in scipy_base.testing", + " \"\"\"this should probably be in scipy_base.testing" + ], + "deleted": [ + " \"\"\"this should probably be in scipy_test", + " \"\"\"this should probably be in scipy_test", + " \"\"\"this should probably be in scipy_test", + " \"\"\"this should probably be in scipy_test" + ] + } + }, + { + "old_path": "weave/tests/test_slice_handler.py", + "new_path": "weave/tests/test_slice_handler.py", + "filename": "test_slice_handler.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -10,7 +10,7 @@\n restore_path()\n \n def print_assert_equal(test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\n# Was getting a weird \"no module named slice_handler error with this.\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport slice_handler\nfrom slice_handler import indexed_array_pattern\nfrom ast_tools import *\nrestore_path()\n\ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_build_slice_atom(unittest.TestCase):\n def generic_test(self,slice_vars,desired):\n pos = slice_vars['pos']\n ast_list = slice_handler.build_slice_atom(slice_vars,pos)\n actual = ast_to_string(ast_list)\n print_assert_equal('',actual,desired)\n def check_exclusive_end(self):\n slice_vars = {'begin':'1', 'end':'2', 'step':'_stp',\n 'single_index':'_index','pos':0}\n desired = 'slice(1,2-1)'\n self.generic_test(slice_vars,desired)\n \nclass test_slice(unittest.TestCase):\n\n def generic_test(self,suite_string,desired):\n import parser\n ast_tuple = parser.suite(suite_string).totuple()\n found, data = find_first_pattern(ast_tuple,indexed_array_pattern)\n subscript = data['subscript_list'][1] #[0] is symbol, [1] is the supscript\n actual = slice_handler.slice_ast_to_dict(subscript)\n print_assert_equal(suite_string,actual,desired)\n\n def check_empty_2_slice(self):\n \"\"\"match slice from a[:]\"\"\"\n test =\"a[:]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_2_slice(self):\n \"\"\"match slice from a[1:]\"\"\"\n test =\"a[1:]\"\n desired = {'begin':'1', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_2_slice(self):\n \"\"\"match slice from a[:2]\"\"\"\n test =\"a[:2]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_2_slice(self):\n \"\"\"match slice from a[1:2]\"\"\"\n test =\"a[1:2]\"\n desired = {'begin':'1', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_empty_3_slice(self):\n \"\"\"match slice from a[::]\"\"\"\n test =\"a[::]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_3_slice(self):\n \"\"\"match slice from a[1::]\"\"\"\n test =\"a[1::]\"\n desired = {'begin':'1', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_3_slice(self):\n \"\"\"match slice from a[:2:]\"\"\"\n test =\"a[:2:]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_stp3_slice(self):\n \"\"\"match slice from a[::3]\"\"\"\n test =\"a[::3]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_3_slice(self):\n \"\"\"match slice from a[1:2:]\"\"\"\n test =\"a[1:2:]\"\n desired = {'begin':'1', 'end':'2','step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_step_3_slice(self):\n \"\"\"match slice from a[1::3]\"\"\"\n test =\"a[1::3]\"\n desired = {'begin':'1', 'end':'_end','step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_step_3_slice(self):\n \"\"\"match slice from a[:2:3]\"\"\"\n test =\"a[:2:3]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_stp3_slice(self):\n \"\"\"match slice from a[1:2:3]\"\"\"\n test =\"a[1:2:3]\"\n desired = {'begin':'1', 'end':'2', 'step':'3','single_index':'_index'}\n self.generic_test(test,desired)\n def check_expr_3_slice(self):\n \"\"\"match slice from a[:1+i+2:]\"\"\"\n test =\"a[:1+i+2:]\"\n desired = {'begin':'_beg', 'end':\"1+i+2\",'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_single_index(self):\n \"\"\"match slice from a[0]\"\"\"\n test =\"a[0]\"\n desired = {'begin':'_beg', 'end':\"_end\",'step':'_stp',\n 'single_index':'0'}\n self.generic_test(test,desired)\n\ndef replace_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \nclass test_transform_slices(unittest.TestCase):\n def generic_test(self,suite_string,desired):\n import parser\n ast_list = parser.suite(suite_string).tolist()\n slice_handler.transform_slices(ast_list)\n actual = ast_to_string(ast_list)\n # Remove white space from expressions so that equivelant \n # but differently formatted string will compare equally\n import string\n actual = replace_whitespace(actual)\n desired = replace_whitespace(desired)\n print_assert_equal(suite_string,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"transform a[:] to slice notation\"\"\"\n test =\"a[:]\"\n desired = 'a[slice(_beg,_end,_stp)]'\n self.generic_test(test,desired)\n def check_simple_expr(self):\n \"\"\"transform a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])\"\"\"\n test =\"a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])\"\n desired = \" a[slice(_beg,_end),slice(_beg,_end)] = \"\\\n \" b[slice(_beg,_end), slice(1,1+2-1,3)] *\"\\\n \" (c[slice(1-2+i,_end), slice(_beg,_end)] -\"\\\n \" c[slice(_beg,_end), slice(_beg,_end)])\"\n self.generic_test(test,desired)\n\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_slice,'check_') )\n suites.append( unittest.makeSuite(test_transform_slices,'check_') )\n suites.append( unittest.makeSuite(test_build_slice_atom,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()", + "source_code_before": "import unittest\n# Was getting a weird \"no module named slice_handler error with this.\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport slice_handler\nfrom slice_handler import indexed_array_pattern\nfrom ast_tools import *\nrestore_path()\n\ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_build_slice_atom(unittest.TestCase):\n def generic_test(self,slice_vars,desired):\n pos = slice_vars['pos']\n ast_list = slice_handler.build_slice_atom(slice_vars,pos)\n actual = ast_to_string(ast_list)\n print_assert_equal('',actual,desired)\n def check_exclusive_end(self):\n slice_vars = {'begin':'1', 'end':'2', 'step':'_stp',\n 'single_index':'_index','pos':0}\n desired = 'slice(1,2-1)'\n self.generic_test(slice_vars,desired)\n \nclass test_slice(unittest.TestCase):\n\n def generic_test(self,suite_string,desired):\n import parser\n ast_tuple = parser.suite(suite_string).totuple()\n found, data = find_first_pattern(ast_tuple,indexed_array_pattern)\n subscript = data['subscript_list'][1] #[0] is symbol, [1] is the supscript\n actual = slice_handler.slice_ast_to_dict(subscript)\n print_assert_equal(suite_string,actual,desired)\n\n def check_empty_2_slice(self):\n \"\"\"match slice from a[:]\"\"\"\n test =\"a[:]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_2_slice(self):\n \"\"\"match slice from a[1:]\"\"\"\n test =\"a[1:]\"\n desired = {'begin':'1', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_2_slice(self):\n \"\"\"match slice from a[:2]\"\"\"\n test =\"a[:2]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_2_slice(self):\n \"\"\"match slice from a[1:2]\"\"\"\n test =\"a[1:2]\"\n desired = {'begin':'1', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_empty_3_slice(self):\n \"\"\"match slice from a[::]\"\"\"\n test =\"a[::]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_3_slice(self):\n \"\"\"match slice from a[1::]\"\"\"\n test =\"a[1::]\"\n desired = {'begin':'1', 'end':'_end', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_3_slice(self):\n \"\"\"match slice from a[:2:]\"\"\"\n test =\"a[:2:]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_stp3_slice(self):\n \"\"\"match slice from a[::3]\"\"\"\n test =\"a[::3]\"\n desired = {'begin':'_beg', 'end':'_end', 'step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_3_slice(self):\n \"\"\"match slice from a[1:2:]\"\"\"\n test =\"a[1:2:]\"\n desired = {'begin':'1', 'end':'2','step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_step_3_slice(self):\n \"\"\"match slice from a[1::3]\"\"\"\n test =\"a[1::3]\"\n desired = {'begin':'1', 'end':'_end','step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_end_step_3_slice(self):\n \"\"\"match slice from a[:2:3]\"\"\"\n test =\"a[:2:3]\"\n desired = {'begin':'_beg', 'end':'2', 'step':'3',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_begin_end_stp3_slice(self):\n \"\"\"match slice from a[1:2:3]\"\"\"\n test =\"a[1:2:3]\"\n desired = {'begin':'1', 'end':'2', 'step':'3','single_index':'_index'}\n self.generic_test(test,desired)\n def check_expr_3_slice(self):\n \"\"\"match slice from a[:1+i+2:]\"\"\"\n test =\"a[:1+i+2:]\"\n desired = {'begin':'_beg', 'end':\"1+i+2\",'step':'_stp',\n 'single_index':'_index'}\n self.generic_test(test,desired)\n def check_single_index(self):\n \"\"\"match slice from a[0]\"\"\"\n test =\"a[0]\"\n desired = {'begin':'_beg', 'end':\"_end\",'step':'_stp',\n 'single_index':'0'}\n self.generic_test(test,desired)\n\ndef replace_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \nclass test_transform_slices(unittest.TestCase):\n def generic_test(self,suite_string,desired):\n import parser\n ast_list = parser.suite(suite_string).tolist()\n slice_handler.transform_slices(ast_list)\n actual = ast_to_string(ast_list)\n # Remove white space from expressions so that equivelant \n # but differently formatted string will compare equally\n import string\n actual = replace_whitespace(actual)\n desired = replace_whitespace(desired)\n print_assert_equal(suite_string,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"transform a[:] to slice notation\"\"\"\n test =\"a[:]\"\n desired = 'a[slice(_beg,_end,_stp)]'\n self.generic_test(test,desired)\n def check_simple_expr(self):\n \"\"\"transform a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])\"\"\"\n test =\"a[:,:] = b[:,1:1+2:3] *(c[1-2+i:,:] - c[:,:])\"\n desired = \" a[slice(_beg,_end),slice(_beg,_end)] = \"\\\n \" b[slice(_beg,_end), slice(1,1+2-1,3)] *\"\\\n \" (c[slice(1-2+i,_end), slice(_beg,_end)] -\"\\\n \" c[slice(_beg,_end), slice(_beg,_end)])\"\n self.generic_test(test,desired)\n\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_slice,'check_') )\n suites.append( unittest.makeSuite(test_transform_slices,'check_') )\n suites.append( unittest.makeSuite(test_build_slice_atom,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()", + "methods": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_slice_handler.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 12, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , slice_vars , desired )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "slice_vars", + "desired" + ], + "start_line": 29, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_exclusive_end", + "long_name": "check_exclusive_end( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 34, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , suite_string , desired )", + "filename": "test_slice_handler.py", + "nloc": 7, + "complexity": 1, + "token_count": 58, + "parameters": [ + "self", + "suite_string", + "desired" + ], + "start_line": 42, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_empty_2_slice", + "long_name": "check_empty_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_2_slice", + "long_name": "check_begin_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_2_slice", + "long_name": "check_end_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_2_slice", + "long_name": "check_begin_end_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_empty_3_slice", + "long_name": "check_empty_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 74, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_3_slice", + "long_name": "check_begin_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 80, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_3_slice", + "long_name": "check_end_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 86, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_stp3_slice", + "long_name": "check_stp3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 92, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_3_slice", + "long_name": "check_begin_end_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 98, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_step_3_slice", + "long_name": "check_begin_step_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 104, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_step_3_slice", + "long_name": "check_end_step_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_stp3_slice", + "long_name": "check_begin_end_stp3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 116, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_expr_3_slice", + "long_name": "check_expr_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "replace_whitespace", + "long_name": "replace_whitespace( in_str )", + "filename": "test_slice_handler.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 134, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , suite_string , desired )", + "filename": "test_slice_handler.py", + "nloc": 9, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self", + "suite_string", + "desired" + ], + "start_line": 142, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_slice_handler.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 154, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_slice_handler.py", + "nloc": 7, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_slice_handler.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "level" + ], + "start_line": 169, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 178, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_slice_handler.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 12, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , slice_vars , desired )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "slice_vars", + "desired" + ], + "start_line": 29, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_exclusive_end", + "long_name": "check_exclusive_end( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 34, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , suite_string , desired )", + "filename": "test_slice_handler.py", + "nloc": 7, + "complexity": 1, + "token_count": 58, + "parameters": [ + "self", + "suite_string", + "desired" + ], + "start_line": 42, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_empty_2_slice", + "long_name": "check_empty_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_2_slice", + "long_name": "check_begin_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_2_slice", + "long_name": "check_end_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_2_slice", + "long_name": "check_begin_end_2_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_empty_3_slice", + "long_name": "check_empty_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 74, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_3_slice", + "long_name": "check_begin_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 80, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_3_slice", + "long_name": "check_end_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 86, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_stp3_slice", + "long_name": "check_stp3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 92, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_3_slice", + "long_name": "check_begin_end_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 98, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_step_3_slice", + "long_name": "check_begin_step_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 104, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_end_step_3_slice", + "long_name": "check_end_step_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 110, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_begin_end_stp3_slice", + "long_name": "check_begin_end_stp3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 116, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_expr_3_slice", + "long_name": "check_expr_3_slice( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 132, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "replace_whitespace", + "long_name": "replace_whitespace( in_str )", + "filename": "test_slice_handler.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 134, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , suite_string , desired )", + "filename": "test_slice_handler.py", + "nloc": 9, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self", + "suite_string", + "desired" + ], + "start_line": 142, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_slice_handler.py", + "nloc": 4, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 154, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_slice_handler.py", + "nloc": 7, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 166, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_slice_handler.py", + "nloc": 8, + "complexity": 2, + "token_count": 65, + "parameters": [ + "level" + ], + "start_line": 169, + "end_line": 176, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_slice_handler.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 178, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_slice_handler.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 12, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 150, + "complexity": 26, + "token_count": 1038, + "diff_parsed": { + "added": [ + " \"\"\"this should probably be in scipy_base.testing" + ], + "deleted": [ + " \"\"\"this should probably be in scipy_test" + ] + } + }, + { + "old_path": "weave/tests/test_standard_array_spec.py", + "new_path": "weave/tests/test_standard_array_spec.py", + "filename": "test_standard_array_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -22,7 +22,7 @@ def remove_whitespace(in_str):\n return out\n \n def print_assert_equal(test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport standard_array_spec\nrestore_path()\n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_array_converter(unittest.TestCase): \n def check_type_match_string(self):\n s = standard_array_spec.array_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = standard_array_spec.array_converter() \n assert(not s.type_match(5))\n def check_type_match_array(self):\n s = standard_array_spec.array_converter() \n assert(s.type_match(arange(4)))\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_array_converter,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport standard_array_spec\nrestore_path()\n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_array_converter(unittest.TestCase): \n def check_type_match_string(self):\n s = standard_array_spec.array_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = standard_array_spec.array_converter() \n assert(not s.type_match(5))\n def check_type_match_array(self):\n s = standard_array_spec.array_converter() \n assert(s.type_match(arange(4)))\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_array_converter,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 17, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_standard_array_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 24, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_array", + "long_name": "check_type_match_array( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_standard_array_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 59, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 17, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_standard_array_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 24, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_array", + "long_name": "check_type_match_array( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_standard_array_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 59, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_standard_array_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 24, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 54, + "complexity": 9, + "token_count": 315, + "diff_parsed": { + "added": [ + " \"\"\"this should probably be in scipy_base.testing" + ], + "deleted": [ + " \"\"\"this should probably be in scipy_test" + ] + } + }, + { + "old_path": "weave/tests/weave_test_utils.py", + "new_path": "weave/tests/weave_test_utils.py", + "filename": "weave_test_utils.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -9,7 +9,7 @@ def remove_whitespace(in_str):\n return out\n \n def print_assert_equal(test_string,actual,desired):\n- \"\"\"this should probably be in scipy_test\n+ \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n try:\n assert(actual == desired)\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import os,sys,string\nimport pprint \n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\n###################################################\n# mainly used by catalog tests \n###################################################\nfrom scipy_distutils.misc_util import add_grandparent_to_path,restore_path\n\nadd_grandparent_to_path(__name__)\nimport catalog\nrestore_path()\n\nimport glob\n\ndef temp_catalog_files(prefix=''):\n # might need to add some more platform specific catalog file\n # suffixes to remove. The .pag was recently added for SunOS\n d = catalog.default_dir()\n f = catalog.os_dependent_catalog_name()\n return glob.glob(os.path.join(d,prefix+f+'*'))\n\nimport tempfile\n\ndef clear_temp_catalog():\n \"\"\" Remove any catalog from the temp dir\n \"\"\"\n global backup_dir \n backup_dir =tempfile.mktemp()\n os.mkdir(backup_dir)\n for file in temp_catalog_files():\n move_file(file,backup_dir)\n #d,f = os.path.split(file)\n #backup = os.path.join(backup_dir,f)\n #os.rename(file,backup)\n\ndef restore_temp_catalog():\n \"\"\" Remove any catalog from the temp dir\n \"\"\"\n global backup_dir\n cat_dir = catalog.default_dir()\n for file in os.listdir(backup_dir):\n file = os.path.join(backup_dir,file)\n d,f = os.path.split(file)\n dst_file = os.path.join(cat_dir, f)\n if os.path.exists(dst_file):\n os.remove(dst_file)\n #os.rename(file,dst_file)\n move_file(file,dst_file)\n os.rmdir(backup_dir)\n backup_dir = None\n \ndef empty_temp_dir():\n \"\"\" Create a sub directory in the temp directory for use in tests\n \"\"\"\n import tempfile\n d = catalog.default_dir()\n for i in range(10000):\n new_d = os.path.join(d,tempfile.gettempprefix()[1:-1]+`i`)\n if not os.path.exists(new_d):\n os.mkdir(new_d)\n break\n return new_d\n\ndef cleanup_temp_dir(d):\n \"\"\" Remove a directory created by empty_temp_dir\n should probably catch errors\n \"\"\"\n files = map(lambda x,d=d: os.path.join(d,x),os.listdir(d))\n for i in files:\n try:\n if os.path.isdir(i):\n cleanup_temp_dir(i)\n else:\n os.remove(i)\n except OSError:\n pass # failed to remove file for whatever reason \n # (maybe it is a DLL Python is currently using) \n try:\n os.rmdir(d)\n except OSError:\n pass \n \n\n# from distutils -- old versions had bug, so copying here to make sure \n# a working version is available.\nfrom distutils.errors import DistutilsFileError\nimport distutils.file_util\ndef move_file (src, dst,\n verbose=0,\n dry_run=0):\n\n \"\"\"Move a file 'src' to 'dst'. If 'dst' is a directory, the file will\n be moved into it with the same name; otherwise, 'src' is just renamed\n to 'dst'. Return the new full name of the file.\n\n Handles cross-device moves on Unix using 'copy_file()'. What about\n other systems???\n \"\"\"\n from os.path import exists, isfile, isdir, basename, dirname\n import errno\n\n if verbose:\n print \"moving %s -> %s\" % (src, dst)\n\n if dry_run:\n return dst\n\n if not isfile(src):\n raise DistutilsFileError, \\\n \"can't move '%s': not a regular file\" % src\n\n if isdir(dst):\n dst = os.path.join(dst, basename(src))\n elif exists(dst):\n raise DistutilsFileError, \\\n \"can't move '%s': destination '%s' already exists\" % \\\n (src, dst)\n\n if not isdir(dirname(dst)):\n raise DistutilsFileError, \\\n \"can't move '%s': destination '%s' not a valid path\" % \\\n (src, dst)\n\n copy_it = 0\n try:\n os.rename(src, dst)\n except os.error, (num, msg):\n if num == errno.EXDEV:\n copy_it = 1\n else:\n raise DistutilsFileError, \\\n \"couldn't move '%s' to '%s': %s\" % (src, dst, msg)\n\n if copy_it:\n distutils.file_util.copy_file(src, dst)\n try:\n os.unlink(src)\n except os.error, (num, msg):\n try:\n os.unlink(dst)\n except os.error:\n pass\n raise DistutilsFileError, \\\n (\"couldn't move '%s' to '%s' by copy/delete: \" +\n \"delete '%s' failed: %s\") % \\\n (src, dst, src, msg)\n\n return dst\n\n ", + "source_code_before": "import os,sys,string\nimport pprint \n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_test\n \"\"\"\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\n###################################################\n# mainly used by catalog tests \n###################################################\nfrom scipy_distutils.misc_util import add_grandparent_to_path,restore_path\n\nadd_grandparent_to_path(__name__)\nimport catalog\nrestore_path()\n\nimport glob\n\ndef temp_catalog_files(prefix=''):\n # might need to add some more platform specific catalog file\n # suffixes to remove. The .pag was recently added for SunOS\n d = catalog.default_dir()\n f = catalog.os_dependent_catalog_name()\n return glob.glob(os.path.join(d,prefix+f+'*'))\n\nimport tempfile\n\ndef clear_temp_catalog():\n \"\"\" Remove any catalog from the temp dir\n \"\"\"\n global backup_dir \n backup_dir =tempfile.mktemp()\n os.mkdir(backup_dir)\n for file in temp_catalog_files():\n move_file(file,backup_dir)\n #d,f = os.path.split(file)\n #backup = os.path.join(backup_dir,f)\n #os.rename(file,backup)\n\ndef restore_temp_catalog():\n \"\"\" Remove any catalog from the temp dir\n \"\"\"\n global backup_dir\n cat_dir = catalog.default_dir()\n for file in os.listdir(backup_dir):\n file = os.path.join(backup_dir,file)\n d,f = os.path.split(file)\n dst_file = os.path.join(cat_dir, f)\n if os.path.exists(dst_file):\n os.remove(dst_file)\n #os.rename(file,dst_file)\n move_file(file,dst_file)\n os.rmdir(backup_dir)\n backup_dir = None\n \ndef empty_temp_dir():\n \"\"\" Create a sub directory in the temp directory for use in tests\n \"\"\"\n import tempfile\n d = catalog.default_dir()\n for i in range(10000):\n new_d = os.path.join(d,tempfile.gettempprefix()[1:-1]+`i`)\n if not os.path.exists(new_d):\n os.mkdir(new_d)\n break\n return new_d\n\ndef cleanup_temp_dir(d):\n \"\"\" Remove a directory created by empty_temp_dir\n should probably catch errors\n \"\"\"\n files = map(lambda x,d=d: os.path.join(d,x),os.listdir(d))\n for i in files:\n try:\n if os.path.isdir(i):\n cleanup_temp_dir(i)\n else:\n os.remove(i)\n except OSError:\n pass # failed to remove file for whatever reason \n # (maybe it is a DLL Python is currently using) \n try:\n os.rmdir(d)\n except OSError:\n pass \n \n\n# from distutils -- old versions had bug, so copying here to make sure \n# a working version is available.\nfrom distutils.errors import DistutilsFileError\nimport distutils.file_util\ndef move_file (src, dst,\n verbose=0,\n dry_run=0):\n\n \"\"\"Move a file 'src' to 'dst'. If 'dst' is a directory, the file will\n be moved into it with the same name; otherwise, 'src' is just renamed\n to 'dst'. Return the new full name of the file.\n\n Handles cross-device moves on Unix using 'copy_file()'. What about\n other systems???\n \"\"\"\n from os.path import exists, isfile, isdir, basename, dirname\n import errno\n\n if verbose:\n print \"moving %s -> %s\" % (src, dst)\n\n if dry_run:\n return dst\n\n if not isfile(src):\n raise DistutilsFileError, \\\n \"can't move '%s': not a regular file\" % src\n\n if isdir(dst):\n dst = os.path.join(dst, basename(src))\n elif exists(dst):\n raise DistutilsFileError, \\\n \"can't move '%s': destination '%s' already exists\" % \\\n (src, dst)\n\n if not isdir(dirname(dst)):\n raise DistutilsFileError, \\\n \"can't move '%s': destination '%s' not a valid path\" % \\\n (src, dst)\n\n copy_it = 0\n try:\n os.rename(src, dst)\n except os.error, (num, msg):\n if num == errno.EXDEV:\n copy_it = 1\n else:\n raise DistutilsFileError, \\\n \"couldn't move '%s' to '%s': %s\" % (src, dst, msg)\n\n if copy_it:\n distutils.file_util.copy_file(src, dst)\n try:\n os.unlink(src)\n except os.error, (num, msg):\n try:\n os.unlink(dst)\n except os.error:\n pass\n raise DistutilsFileError, \\\n (\"couldn't move '%s' to '%s' by copy/delete: \" +\n \"delete '%s' failed: %s\") % \\\n (src, dst, src, msg)\n\n return dst\n\n ", + "methods": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "weave_test_utils.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 4, + "end_line": 9, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "weave_test_utils.py", + "nloc": 12, + "complexity": 2, + "token_count": 72, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 11, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "temp_catalog_files", + "long_name": "temp_catalog_files( prefix = '' )", + "filename": "weave_test_utils.py", + "nloc": 4, + "complexity": 1, + "token_count": 41, + "parameters": [ + "prefix" + ], + "start_line": 37, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "clear_temp_catalog", + "long_name": "clear_temp_catalog( )", + "filename": "weave_test_utils.py", + "nloc": 6, + "complexity": 2, + "token_count": 33, + "parameters": [], + "start_line": 46, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "restore_temp_catalog", + "long_name": "restore_temp_catalog( )", + "filename": "weave_test_utils.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [], + "start_line": 58, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "empty_temp_dir", + "long_name": "empty_temp_dir( )", + "filename": "weave_test_utils.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [], + "start_line": 74, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "cleanup_temp_dir", + "long_name": "cleanup_temp_dir( d )", + "filename": "weave_test_utils.py", + "nloc": 14, + "complexity": 5, + "token_count": 80, + "parameters": [ + "d" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "move_file", + "long_name": "move_file( src , dst , verbose = 0 , dry_run = 0 )", + "filename": "weave_test_utils.py", + "nloc": 45, + "complexity": 12, + "token_count": 240, + "parameters": [ + "src", + "dst", + "verbose", + "dry_run" + ], + "start_line": 110, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "weave_test_utils.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 4, + "end_line": 9, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "weave_test_utils.py", + "nloc": 12, + "complexity": 2, + "token_count": 72, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 11, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "temp_catalog_files", + "long_name": "temp_catalog_files( prefix = '' )", + "filename": "weave_test_utils.py", + "nloc": 4, + "complexity": 1, + "token_count": 41, + "parameters": [ + "prefix" + ], + "start_line": 37, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "clear_temp_catalog", + "long_name": "clear_temp_catalog( )", + "filename": "weave_test_utils.py", + "nloc": 6, + "complexity": 2, + "token_count": 33, + "parameters": [], + "start_line": 46, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "restore_temp_catalog", + "long_name": "restore_temp_catalog( )", + "filename": "weave_test_utils.py", + "nloc": 12, + "complexity": 3, + "token_count": 91, + "parameters": [], + "start_line": 58, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "empty_temp_dir", + "long_name": "empty_temp_dir( )", + "filename": "weave_test_utils.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [], + "start_line": 74, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "cleanup_temp_dir", + "long_name": "cleanup_temp_dir( d )", + "filename": "weave_test_utils.py", + "nloc": 14, + "complexity": 5, + "token_count": 80, + "parameters": [ + "d" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "move_file", + "long_name": "move_file( src , dst , verbose = 0 , dry_run = 0 )", + "filename": "weave_test_utils.py", + "nloc": 45, + "complexity": 12, + "token_count": 240, + "parameters": [ + "src", + "dst", + "verbose", + "dry_run" + ], + "start_line": 110, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 61, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "weave_test_utils.py", + "nloc": 12, + "complexity": 2, + "token_count": 72, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 11, + "end_line": 24, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + } + ], + "nloc": 118, + "complexity": 29, + "token_count": 717, + "diff_parsed": { + "added": [ + " \"\"\"this should probably be in scipy_base.testing" + ], + "deleted": [ + " \"\"\"this should probably be in scipy_test" + ] + } + }, + { + "old_path": "weave/wx_spec.py", + "new_path": "weave/wx_spec.py", + "filename": "wx_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -77,10 +77,10 @@ def __cmp__(self,other):\n # this should only be enabled on machines with access to a display device\n # It'll cause problems otherwise.\n def test(level=10):\n- from scipy_test import module_test\n+ from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n \n def test_suite(level=1):\n- from scipy_test import module_test_suite\n+ from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \"\"\" \n\\ No newline at end of file\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import wx_info\nimport base_info\nfrom base_spec import base_converter\nfrom types import *\nimport os\n\nwx_support_template = \\\n\"\"\"\nstatic %(wx_class)s* convert_to_%(wx_class)s(PyObject* py_obj,char* name)\n{\n %(wx_class)s *wx_ptr;\n \n // work on this error reporting...\n if (SWIG_GetPtrObj(py_obj,(void **) &wx_ptr,\"_%(wx_class)s_p\"))\n handle_conversion_error(py_obj,\"%(wx_class)s\", name);\n return wx_ptr;\n} \n\nstatic %(wx_class)s* py_to_%(wx_class)s(PyObject* py_obj,char* name)\n{\n %(wx_class)s *wx_ptr;\n \n // work on this error reporting...\n if (SWIG_GetPtrObj(py_obj,(void **) &wx_ptr,\"_%(wx_class)s_p\"))\n handle_bad_type(py_obj,\"%(wx_class)s\", name);\n return wx_ptr;\n} \n\"\"\" \n\nclass wx_converter(base_converter):\n _build_information = [wx_info.wx_info()]\n def __init__(self,class_name=None):\n self.type_name = 'unkown wx_object'\n if class_name:\n # customize support_code for whatever type I was handed.\n vals = {'wx_class': class_name}\n specialized_support = wx_support_template % vals\n custom = base_info.base_info()\n custom._support_code = [specialized_support]\n self._build_information = self._build_information + [custom]\n self.type_name = class_name\n\n def type_match(self,value):\n try:\n class_name = value.this.split('_')[-2]\n if class_name[:2] == 'wx':\n return 1\n except AttributeError:\n pass\n return 0\n \n def type_spec(self,name,value):\n # factory\n class_name = value.this.split('_')[-2]\n new_spec = self.__class__(class_name)\n new_spec.name = name \n return new_spec\n def declaration_code(self,inline=0):\n type = self.type_name\n name = self.name\n var_name = self.retrieve_py_variable(inline)\n template = '%(type)s *%(name)s = '\\\n 'convert_to_%(type)s(%(var_name)s,\"%(name)s\");\\n'\n code = template % locals()\n return code\n \n def __repr__(self):\n msg = \"(%s:: name: %s)\" % (self.type_name,self.name)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__) or \\\n cmp(self.type_name,other.type_name)\n\n\"\"\"\n# this should only be enabled on machines with access to a display device\n# It'll cause problems otherwise.\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\"\"\" ", + "source_code_before": "import wx_info\nimport base_info\nfrom base_spec import base_converter\nfrom types import *\nimport os\n\nwx_support_template = \\\n\"\"\"\nstatic %(wx_class)s* convert_to_%(wx_class)s(PyObject* py_obj,char* name)\n{\n %(wx_class)s *wx_ptr;\n \n // work on this error reporting...\n if (SWIG_GetPtrObj(py_obj,(void **) &wx_ptr,\"_%(wx_class)s_p\"))\n handle_conversion_error(py_obj,\"%(wx_class)s\", name);\n return wx_ptr;\n} \n\nstatic %(wx_class)s* py_to_%(wx_class)s(PyObject* py_obj,char* name)\n{\n %(wx_class)s *wx_ptr;\n \n // work on this error reporting...\n if (SWIG_GetPtrObj(py_obj,(void **) &wx_ptr,\"_%(wx_class)s_p\"))\n handle_bad_type(py_obj,\"%(wx_class)s\", name);\n return wx_ptr;\n} \n\"\"\" \n\nclass wx_converter(base_converter):\n _build_information = [wx_info.wx_info()]\n def __init__(self,class_name=None):\n self.type_name = 'unkown wx_object'\n if class_name:\n # customize support_code for whatever type I was handed.\n vals = {'wx_class': class_name}\n specialized_support = wx_support_template % vals\n custom = base_info.base_info()\n custom._support_code = [specialized_support]\n self._build_information = self._build_information + [custom]\n self.type_name = class_name\n\n def type_match(self,value):\n try:\n class_name = value.this.split('_')[-2]\n if class_name[:2] == 'wx':\n return 1\n except AttributeError:\n pass\n return 0\n \n def type_spec(self,name,value):\n # factory\n class_name = value.this.split('_')[-2]\n new_spec = self.__class__(class_name)\n new_spec.name = name \n return new_spec\n def declaration_code(self,inline=0):\n type = self.type_name\n name = self.name\n var_name = self.retrieve_py_variable(inline)\n template = '%(type)s *%(name)s = '\\\n 'convert_to_%(type)s(%(var_name)s,\"%(name)s\");\\n'\n code = template % locals()\n return code\n \n def __repr__(self):\n msg = \"(%s:: name: %s)\" % (self.type_name,self.name)\n return msg\n def __cmp__(self,other):\n #only works for equal\n return cmp(self.name,other.name) or \\\n cmp(self.__class__, other.__class__) or \\\n cmp(self.type_name,other.type_name)\n\n\"\"\"\n# this should only be enabled on machines with access to a display device\n# It'll cause problems otherwise.\ndef test(level=10):\n from scipy_test import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_test import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\"\"\" ", + "methods": [ + { + "name": "__init__", + "long_name": "__init__( self , class_name = None )", + "filename": "wx_spec.py", + "nloc": 9, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "class_name" + ], + "start_line": 32, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "wx_spec.py", + "nloc": 8, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self", + "value" + ], + "start_line": 43, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "wx_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 52, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , inline = 0 )", + "filename": "wx_spec.py", + "nloc": 8, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "inline" + ], + "start_line": 58, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "wx_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "wx_spec.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self", + "other" + ], + "start_line": 70, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "__init__", + "long_name": "__init__( self , class_name = None )", + "filename": "wx_spec.py", + "nloc": 9, + "complexity": 2, + "token_count": 59, + "parameters": [ + "self", + "class_name" + ], + "start_line": 32, + "end_line": 41, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "type_match", + "long_name": "type_match( self , value )", + "filename": "wx_spec.py", + "nloc": 8, + "complexity": 3, + "token_count": 40, + "parameters": [ + "self", + "value" + ], + "start_line": 43, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "type_spec", + "long_name": "type_spec( self , name , value )", + "filename": "wx_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "self", + "name", + "value" + ], + "start_line": 52, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "declaration_code", + "long_name": "declaration_code( self , inline = 0 )", + "filename": "wx_spec.py", + "nloc": 8, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "inline" + ], + "start_line": 58, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "wx_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "wx_spec.py", + "nloc": 4, + "complexity": 3, + "token_count": 42, + "parameters": [ + "self", + "other" + ], + "start_line": 70, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 77, + "complexity": 11, + "token_count": 280, + "diff_parsed": { + "added": [ + " from scipy_base.testing import module_test", + " from scipy_base.testing import module_test_suite" + ], + "deleted": [ + " from scipy_test import module_test", + " from scipy_test import module_test_suite" + ] + } + } + ] + }, + { + "hash": "0d0d0eb1e84aad16beead216d272855fc3edc11e", + "msg": "added helpmod.py and fixed a few import errors", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T04:40:11+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T04:40:11+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "c117d3173e31d74ed97c811a5ef208ab1c72c263" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 0, + "insertions": 5, + "lines": 5, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_base/type_check.py", + "new_path": "scipy_base/type_check.py", + "filename": "type_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -26,6 +26,11 @@\n toComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\n toComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n \n+# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\n+if not hasattr(Numeric,'Character'):\n+ Numeric.Character = 'c'\n+ \n+ \n cast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n", + "added_lines": 5, + "deleted_lines": 0, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n# stuff. Perhaps move to cephes in the future??\nfrom ieee_754 import PINF,MINF,NAN\n\n__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntoChar = lambda x: Numeric.array(x, Numeric.Character)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef array_iscomplex(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef array_isreal(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\ndef isnan(val):\n # fast, but apparently not portable (according to notes by Tim Peters)\n #return val != val\n # very slow -- should really use cephes methods or *something* different\n import ieee_754\n vals = ravel(val)\n if array_iscomplex(vals):\n r = array(map(ieee_754.isnan,real(vals))) \n i = array(map(ieee_754.isnan,imag(vals)))\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == MINF\n \ndef isinf(val):\n return Numeric.logical_or(isposinf(val),isneginf(val))\n\ndef isfinite(val):\n vals = asarray(val)\n if array_iscomplex(vals):\n r = isfinite(real(vals))\n i = isfinite(imag(vals))\n results = Numeric.logical_and(r,i)\n else: \n fin = Numeric.logical_not(isinf(val))\n an = Numeric.logical_not(isnan(val))\n results = Numeric.logical_and(fin,an)\n return results \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n# stuff. Perhaps move to cephes in the future??\nfrom ieee_754 import PINF,MINF,NAN\n\n__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntoChar = lambda x: Numeric.array(x, Numeric.Character)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef array_iscomplex(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef array_isreal(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\ndef isnan(val):\n # fast, but apparently not portable (according to notes by Tim Peters)\n #return val != val\n # very slow -- should really use cephes methods or *something* different\n import ieee_754\n vals = ravel(val)\n if array_iscomplex(vals):\n r = array(map(ieee_754.isnan,real(vals))) \n i = array(map(ieee_754.isnan,imag(vals)))\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == MINF\n \ndef isinf(val):\n return Numeric.logical_or(isposinf(val),isneginf(val))\n\ndef isfinite(val):\n vals = asarray(val)\n if array_iscomplex(vals):\n r = isfinite(real(vals))\n i = isfinite(imag(vals))\n results = Numeric.logical_and(r,i)\n else: \n fin = Numeric.logical_not(isinf(val))\n an = Numeric.logical_not(isnan(val))\n results = Numeric.logical_and(fin,an)\n return results \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 10, + "complexity": 2, + "token_count": 78, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 91, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 99, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 101, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 104, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 115, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 140, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 162, + "end_line": 165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 173, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 186, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 190, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 39, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 44, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 51, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 58, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 61, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 64, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 10, + "complexity": 2, + "token_count": 78, + "parameters": [ + "val" + ], + "start_line": 72, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 86, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 91, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 99, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 110, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 135, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 157, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 168, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 181, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 140, + "complexity": 29, + "token_count": 1118, + "diff_parsed": { + "added": [ + "# This is for pre Numeric 21.x compatiblity. Adding it is harmless.", + "if not hasattr(Numeric,'Character'):", + " Numeric.Character = 'c'", + "", + "" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "3c2d8ed5be22cfb91ae89643594508d2c8d6c9c6", + "msg": "added index_tricks tests", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T05:02:27+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T05:02:27+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "0d0d0eb1e84aad16beead216d272855fc3edc11e" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 0, + "insertions": 10, + "lines": 10, + "files": 1, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": "scipy_base/index_tricks.py", + "new_path": "scipy_base/index_tricks.py", + "filename": "index_tricks.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -175,3 +175,13 @@ def __getslice__(self, start, stop):\n index_exp = _index_expression_class()\n \n # End contribution from Konrad.\n+\n+#-----------------------------------------------------------------------------\n+\n+def test(level=10):\n+ from scipy_base.testing import module_test\n+ module_test(__name__,__file__,level=level)\n+\n+def test_suite(level=1):\n+ from scipy_base.testing import module_test_suite\n+ return module_test_suite(__name__,__file__,level=level)\n", + "added_lines": 10, + "deleted_lines": 0, + "source_code": "import types\nimport Numeric\n\n__all__ = ['mgrid','r_','c_','index_exp']\n\nfrom type_check import ScalarType\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 complex\n number, then the stop is not inclusive.\n \n However, if the step length is a COMPLEX NUMBER (e.g. 5j), then the integer\n part of it's magnitude is interpreted as specifying the number of points to\n create between the start and stop values, where the stop value\n IS INCLUSIVE.\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 def __getitem__(self,key):\n try:\n\t size = []\n typecode = Numeric.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:\n step = 1\n if type(step) is type(1j):\n size.append(int(abs(step)))\n typecode = Numeric.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 = Numeric.Float\n nn = Numeric.indices(size,typecode)\n\t for k in range(len(size)):\n step = key[k].step\n if step is None:\n step = 1\n if type(step) is type(1j):\n step = int(abs(step))\n step = (key[k].stop - key[k].start)/float(step-1)\n nn[k] = (nn[k]*step+key[k].start)\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 Numeric.arange(0,length,1,Numeric.Float)*step + start\n else:\n return Numeric.arange(start, stop, step)\n\t \n def __getslice__(self,i,j):\n return Numeric.arange(i,j)\n\n def __len__(self):\n return 0\n\nmgrid = nd_grid()\n\nclass concatenator:\n \"\"\" Translates slice objects to concatenation along an axis.\n \"\"\"\n def __init__(self, axis=0):\n self.axis = axis\n def __getitem__(self,key):\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 = Numeric.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 = Numeric.Float\n endpoint = 1\n else:\n size = int((stop - start)/(step*1.0))\n endpoint = 0\n if isinstance(step,types.FloatType) or \\\n isinstance(start, types.FloatType) or \\\n isinstance(stop, types.FloatType):\n typecode = Numeric.Float\n newobj = linspace(start, stop, num=size, endpoint=endpoint)\n elif type(key[k]) in ScalarType:\n newobj = Numeric.asarray([key[k]])\n else:\n newobj = key[k]\n objs.append(newobj)\n return Numeric.concatenate(tuple(objs),axis=self.axis)\n \n def __getslice__(self,i,j):\n return Numeric.arange(i,j)\n\n def __len__(self):\n return 0\n\nr_=concatenator(0)\nc_=concatenator(-1)\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 \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#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n", + "source_code_before": "import types\nimport Numeric\n\n__all__ = ['mgrid','r_','c_','index_exp']\n\nfrom type_check import ScalarType\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 complex\n number, then the stop is not inclusive.\n \n However, if the step length is a COMPLEX NUMBER (e.g. 5j), then the integer\n part of it's magnitude is interpreted as specifying the number of points to\n create between the start and stop values, where the stop value\n IS INCLUSIVE.\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 def __getitem__(self,key):\n try:\n\t size = []\n typecode = Numeric.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:\n step = 1\n if type(step) is type(1j):\n size.append(int(abs(step)))\n typecode = Numeric.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 = Numeric.Float\n nn = Numeric.indices(size,typecode)\n\t for k in range(len(size)):\n step = key[k].step\n if step is None:\n step = 1\n if type(step) is type(1j):\n step = int(abs(step))\n step = (key[k].stop - key[k].start)/float(step-1)\n nn[k] = (nn[k]*step+key[k].start)\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 Numeric.arange(0,length,1,Numeric.Float)*step + start\n else:\n return Numeric.arange(start, stop, step)\n\t \n def __getslice__(self,i,j):\n return Numeric.arange(i,j)\n\n def __len__(self):\n return 0\n\nmgrid = nd_grid()\n\nclass concatenator:\n \"\"\" Translates slice objects to concatenation along an axis.\n \"\"\"\n def __init__(self, axis=0):\n self.axis = axis\n def __getitem__(self,key):\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 = Numeric.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 = Numeric.Float\n endpoint = 1\n else:\n size = int((stop - start)/(step*1.0))\n endpoint = 0\n if isinstance(step,types.FloatType) or \\\n isinstance(start, types.FloatType) or \\\n isinstance(stop, types.FloatType):\n typecode = Numeric.Float\n newobj = linspace(start, stop, num=size, endpoint=endpoint)\n elif type(key[k]) in ScalarType:\n newobj = Numeric.asarray([key[k]])\n else:\n newobj = key[k]\n objs.append(newobj)\n return Numeric.concatenate(tuple(objs),axis=self.axis)\n \n def __getslice__(self,i,j):\n return Numeric.arange(i,j)\n\n def __len__(self):\n return 0\n\nr_=concatenator(0)\nc_=concatenator(-1)\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 \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", + "methods": [ + { + "name": "__getitem__", + "long_name": "__getitem__( self , key )", + "filename": "index_tricks.py", + "nloc": 42, + "complexity": 14, + "token_count": 368, + "parameters": [ + "self", + "key" + ], + "start_line": 38, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "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": 81, + "end_line": 82, + "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": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , axis = 0 )", + "filename": "index_tricks.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "axis" + ], + "start_line": 92, + "end_line": 93, + "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": 31, + "complexity": 11, + "token_count": 253, + "parameters": [ + "self", + "key" + ], + "start_line": 94, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "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": 126, + "end_line": 127, + "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": 129, + "end_line": 130, + "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": 161, + "end_line": 165, + "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": 167, + "end_line": 168, + "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": 170, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "index_tricks.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 181, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "index_tricks.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "__getitem__", + "long_name": "__getitem__( self , key )", + "filename": "index_tricks.py", + "nloc": 42, + "complexity": 14, + "token_count": 368, + "parameters": [ + "self", + "key" + ], + "start_line": 38, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 42, + "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": 81, + "end_line": 82, + "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": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , axis = 0 )", + "filename": "index_tricks.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "axis" + ], + "start_line": 92, + "end_line": 93, + "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": 31, + "complexity": 11, + "token_count": 253, + "parameters": [ + "self", + "key" + ], + "start_line": 94, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "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": 126, + "end_line": 127, + "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": 129, + "end_line": 130, + "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": 161, + "end_line": 165, + "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": 167, + "end_line": 168, + "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": 170, + "end_line": 173, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "index_tricks.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "index_tricks.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 181, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "nloc": 144, + "complexity": 37, + "token_count": 869, + "diff_parsed": { + "added": [ + "", + "#-----------------------------------------------------------------------------", + "", + "def test(level=10):", + " from scipy_base.testing import module_test", + " module_test(__name__,__file__,level=level)", + "", + "def test_suite(level=1):", + " from scipy_base.testing import module_test_suite", + " return module_test_suite(__name__,__file__,level=level)" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "853710928d90fecb9c3a25bbef2cc9040ecc3f90", + "msg": "removed transform_base files -- all routines added fftpack.fft", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T05:03:49+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T05:03:49+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "3c2d8ed5be22cfb91ae89643594508d2c8d6c9c6" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 76, + "insertions": 0, + "lines": 76, + "files": 1, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.15789473684210525, + "modified_files": [ + { + "old_path": "scipy_base/transform_base.py", + "new_path": null, + "filename": "transform_base.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,76 +0,0 @@\n-import Numeric\n-\n-\n-def fftshift(x,axes=None):\n- \"\"\" Shift the result of an FFT operation.\n-\n- Return a shifted version of x (useful for obtaining centered spectra).\n- This function swaps \"half-spaces\" for all axes listed (defaults to all)\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.ceil(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def ifftshift(x,axes=None):\n- \"\"\" Reverse the effect of fftshift.\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.floor(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def fftfreq(N,sample=1.0):\n- \"\"\" FFT sample frequencies\n- \n- Return the frequency bins in cycles/unit (with zero at the start) given a\n- window length N and a sample spacing.\n- \"\"\"\n- N = int(N)\n- sample = float(sample)\n- return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n-\n-def cont_ft(gn,fr,delta=1.0,n=None):\n- \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n-\n- If the gn are alias-free samples of a continuous time function then the\n- correct value for the spacing, delta, will give the properly scaled,\n- continuous Fourier spectrum.\n- \n- The DFT is obtained when delta=1.0\n- \"\"\"\n- if n is None:\n- n = Numeric.arange(len(gn))\n- dT = delta\n- trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n- return dT*Numeric.dot(trans_kernel,gn)\n-\n-#-----------------------------------------------------------------------------\n-# Test Routines\n-#-----------------------------------------------------------------------------\n-\n-def test(level=10):\n- from scipy_base.testing import module_test\n- module_test(__name__,__file__,level=level)\n-\n-def test_suite(level=1):\n- from scipy_base.testing import module_test_suite\n- return module_test_suite(__name__,__file__,level=level)\n-\n-if __name__ == '__main__':\n- print 'float epsilon:',float_epsilon\n- print 'float tiny:',float_tiny\n- print 'double epsilon:',double_epsilon\n- print 'double tiny:',double_tiny\n", + "added_lines": 0, + "deleted_lines": 76, + "source_code": null, + "source_code_before": "import Numeric\n\n\ndef fftshift(x,axes=None):\n \"\"\" Shift the result of an FFT operation.\n\n Return a shifted version of x (useful for obtaining centered spectra).\n This function swaps \"half-spaces\" for all axes listed (defaults to all)\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.ceil(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef ifftshift(x,axes=None):\n \"\"\" Reverse the effect of fftshift.\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.floor(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef fftfreq(N,sample=1.0):\n \"\"\" FFT sample frequencies\n \n Return the frequency bins in cycles/unit (with zero at the start) given a\n window length N and a sample spacing.\n \"\"\"\n N = int(N)\n sample = float(sample)\n return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n\ndef cont_ft(gn,fr,delta=1.0,n=None):\n \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n\n If the gn are alias-free samples of a continuous time function then the\n correct value for the spacing, delta, will give the properly scaled,\n continuous Fourier spectrum.\n \n The DFT is obtained when delta=1.0\n \"\"\"\n if n is None:\n n = Numeric.arange(len(gn))\n dT = delta\n trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n return dT*Numeric.dot(trans_kernel,gn)\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [], + "methods_before": [ + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "import Numeric", + "", + "", + "def fftshift(x,axes=None):", + " \"\"\" Shift the result of an FFT operation.", + "", + " Return a shifted version of x (useful for obtaining centered spectra).", + " This function swaps \"half-spaces\" for all axes listed (defaults to all)", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.ceil(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def ifftshift(x,axes=None):", + " \"\"\" Reverse the effect of fftshift.", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.floor(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def fftfreq(N,sample=1.0):", + " \"\"\" FFT sample frequencies", + "", + " Return the frequency bins in cycles/unit (with zero at the start) given a", + " window length N and a sample spacing.", + " \"\"\"", + " N = int(N)", + " sample = float(sample)", + " return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample", + "", + "def cont_ft(gn,fr,delta=1.0,n=None):", + " \"\"\" Compute the (scaled) DFT of gn at frequencies fr.", + "", + " If the gn are alias-free samples of a continuous time function then the", + " correct value for the spacing, delta, will give the properly scaled,", + " continuous Fourier spectrum.", + "", + " The DFT is obtained when delta=1.0", + " \"\"\"", + " if n is None:", + " n = Numeric.arange(len(gn))", + " dT = delta", + " trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)", + " return dT*Numeric.dot(trans_kernel,gn)", + "", + "#-----------------------------------------------------------------------------", + "# Test Routines", + "#-----------------------------------------------------------------------------", + "", + "def test(level=10):", + " from scipy_base.testing import module_test", + " module_test(__name__,__file__,level=level)", + "", + "def test_suite(level=1):", + " from scipy_base.testing import module_test_suite", + " return module_test_suite(__name__,__file__,level=level)", + "", + "if __name__ == '__main__':", + " print 'float epsilon:',float_epsilon", + " print 'float tiny:',float_tiny", + " print 'double epsilon:',double_epsilon", + " print 'double tiny:',double_tiny" + ] + } + } + ] + }, + { + "hash": "44869d64fc324e72f50bf1f99b58eec9f56db0cb", + "msg": "added test methods for scipy_base", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T13:59:07+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T13:59:07+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "853710928d90fecb9c3a25bbef2cc9040ecc3f90" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 0, + "insertions": 1136, + "lines": 1136, + "files": 6, + "dmm_unit_size": 0.829736211031175, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": null, + "new_path": "scipy_base/tests/test_function_base.py", + "filename": "test_function_base.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,242 @@\n+# only for short term testing\n+import sys\n+sys.path.insert(0,'../..')\n+\n+import unittest\n+from scipy_base.testing import assert_array_equal, assert_equal, rand\n+from scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n+\n+from scipy_base import *\n+# This won't be needed when we get scipy_base finished.\n+from scipy_base.index_tricks import *\n+from scipy_base.function_base import *\n+\n+\n+class test_any(unittest.TestCase):\n+ def check_basic(self):\n+ y1 = [0,0,1,0]\n+ y2 = [0,0,0,0]\n+ y3 = [1,0,1,0]\n+ assert(any(y1))\n+ assert(any(y3))\n+ assert(not any(y2))\n+\n+ def check_nd(self):\n+ y1 = [[0,0,0],[0,1,0],[1,1,0]]\n+ assert_array_equal(any(y1),[1,1,0])\n+ assert_array_equal(any(y1,axis=1),[0,1,1])\n+ \n+class test_all(unittest.TestCase):\n+ def check_basic(self):\n+ y1 = [0,1,1,0]\n+ y2 = [0,0,0,0]\n+ y3 = [1,1,1,1]\n+ assert(not all(y1))\n+ assert(all(y3))\n+ assert(not all(y2))\n+ assert(all(~array(y2)))\n+\n+ def check_nd(self):\n+ y1 = [[0,0,1],[0,1,1],[1,1,1]]\n+ assert_array_equal(all(y1),[0,0,1])\n+ assert_array_equal(all(y1,axis=1),[0,0,1])\n+\n+class test_logspace(unittest.TestCase):\n+ def check_basic(self):\n+ y = logspace(0,6)\n+ assert(len(y)==50)\n+ y = logspace(0,6,num=100)\n+ assert(y[-1] == 10**6)\n+ y = logspace(0,6,endpoint=0)\n+ assert(y[-1] < 10**6)\n+ y = logspace(0,6,num=7)\n+ assert_array_equal(y,[1,10,100,1e3,1e4,1e5,1e6])\n+\n+class test_linspace(unittest.TestCase):\n+ def check_basic(self):\n+ y = linspace(0,10)\n+ assert(len(y)==50)\n+ y = linspace(2,10,num=100)\n+ assert(y[-1] == 10)\n+ y = linspace(2,10,endpoint=0)\n+ assert(y[-1] < 10)\n+ y,st = linspace(2,10,retstep=1)\n+ assert_almost_equal(st,8/49.0)\n+ assert_array_almost_equal(y,mgrid[2:10:50j],13)\n+\n+class test_amax(unittest.TestCase):\n+ def check_basic(self):\n+ a = [3,4,5,10,-3,-5,6.0]\n+ assert_equal(amax(a),10.0)\n+ b = [[3,6.0, 9.0],\n+ [4,10.0,5.0],\n+ [8,3.0,2.0]]\n+ assert_equal(amax(b),[8.0,10.0,9.0])\n+ assert_equal(amax(b,axis=1),[9.0,10.0,8.0])\n+ \n+class test_amin(unittest.TestCase):\n+ def check_basic(self):\n+ a = [3,4,5,10,-3,-5,6.0]\n+ assert_equal(amin(a),-5.0)\n+ b = [[3,6.0, 9.0],\n+ [4,10.0,5.0],\n+ [8,3.0,2.0]]\n+ assert_equal(amin(b),[3.0,3.0,2.0])\n+ assert_equal(amin(b,axis=1),[3.0,4.0,2.0])\n+\n+class test_ptp(unittest.TestCase):\n+ def check_basic(self):\n+ a = [3,4,5,10,-3,-5,6.0]\n+ assert_equal(ptp(a),15.0)\n+ b = [[3,6.0, 9.0],\n+ [4,10.0,5.0],\n+ [8,3.0,2.0]]\n+ assert_equal(ptp(b,axis=0),[5.0,7.0,7.0])\n+ assert_equal(ptp(b),[6.0,6.0,6.0])\n+\n+class test_cumsum(unittest.TestCase):\n+ def check_basic(self):\n+ ba = [1,2,10,11,6,5,4]\n+ ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n+ for ctype in ['1','b','s','i','l','f','d','F','D']:\n+ a = array(ba,ctype)\n+ a2 = array(ba2,ctype)\n+ assert_array_equal(cumsum(a), array([1,3,13,24,30,35,39],ctype))\n+ assert_array_equal(cumsum(a2,axis=0), array([[1,2,3,4],[6,8,10,13],\n+ [16,11,14,18]],ctype))\n+ assert_array_equal(cumsum(a2,axis=1),\n+ array([[1,3,6,10],\n+ [5,11,18,27],\n+ [10,13,17,22]],ctype))\n+\n+class test_prod(unittest.TestCase):\n+ def check_basic(self):\n+ ba = [1,2,10,11,6,5,4]\n+ ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n+ for ctype in ['1','b','s','i','l','f','d','F','D']:\n+ a = array(ba,ctype)\n+ a2 = array(ba2,ctype)\n+ if ctype in ['1', 'b']:\n+ self.failUnlessRaises(ArithmeticError, prod, a)\n+ self.failUnlessRaises(ArithmeticError, prod, a2, 1)\n+ self.failUnlessRaises(ArithmeticError, prod, a)\n+ else: \n+ assert_equal(prod(a),26400)\n+ assert_array_equal(prod(a2,axis=0), \n+ array([50,36,84,180],ctype))\n+ assert_array_equal(prod(a2),array([24, 1890, 600],ctype))\n+\n+class test_cumprod(unittest.TestCase):\n+ def check_basic(self):\n+ ba = [1,2,10,11,6,5,4]\n+ ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n+ for ctype in ['1','b','s','i','l','f','d','F','D']:\n+ a = array(ba,ctype)\n+ a2 = array(ba2,ctype)\n+ if ctype in ['1', 'b']:\n+ self.failUnlessRaises(ArithmeticError, cumprod, a)\n+ self.failUnlessRaises(ArithmeticError, cumprod, a2, 1)\n+ self.failUnlessRaises(ArithmeticError, cumprod, a)\n+ else: \n+ assert_array_equal(cumprod(a),\n+ array([1, 2, 20, 220,\n+ 1320, 6600, 26400],ctype))\n+ assert_array_equal(cumprod(a2,axis=0),\n+ array([[ 1, 2, 3, 4],\n+ [ 5, 12, 21, 36],\n+ [50, 36, 84, 180]],ctype))\n+ assert_array_equal(cumprod(a2),\n+ array([[ 1, 2, 6, 24],\n+ [ 5, 30, 210, 1890],\n+ [10, 30, 120, 600]],ctype))\n+\n+class test_diff(unittest.TestCase):\n+ def check_basic(self):\n+ x = [1,4,6,7,12]\n+ out = array([3,2,1,5])\n+ out2 = array([-1,-1,4])\n+ out3 = array([0,5])\n+ assert_array_equal(diff(x),out)\n+ assert_array_equal(diff(x,n=2),out2)\n+ assert_array_equal(diff(x,n=3),out3)\n+\n+ def check_nd(self):\n+ x = 20*rand(10,20,30)\n+ out1 = x[:,:,1:] - x[:,:,:-1]\n+ out2 = out1[:,:,1:] - out1[:,:,:-1]\n+ out3 = x[1:,:,:] - x[:-1,:,:]\n+ out4 = out3[1:,:,:] - out3[:-1,:,:]\n+ assert_array_equal(diff(x),out1)\n+ assert_array_equal(diff(x,n=2),out2)\n+ assert_array_equal(diff(x,axis=0),out3)\n+ assert_array_equal(diff(x,n=2,axis=0),out4)\n+\n+class test_angle(unittest.TestCase):\n+ def check_basic(self):\n+ x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j]\n+ y = angle(x)\n+ yo = [arctan(3.0/1.0),arctan(1.0),0,pi/2,pi,-pi/2.0,\n+ -arctan(3.0/1.0),pi-arctan(3.0/1.0)]\n+ z = angle(x,deg=1)\n+ zo = array(yo)*180/pi\n+ assert_array_almost_equal(y,yo,11)\n+ assert_array_almost_equal(z,zo,11)\n+\n+class test_trim_zeros(unittest.TestCase):\n+ \"\"\" only testing for integer splits.\n+ \"\"\"\n+ def check_basic(self):\n+ a= array([0,0,1,2,3,4,0])\n+ res = trim_zeros(a)\n+ assert_array_equal(res,array([1,2,3,4]))\n+ def check_leading_skip(self):\n+ a= array([0,0,1,0,2,3,4,0])\n+ res = trim_zeros(a)\n+ assert_array_equal(res,array([1,0,2,3,4]))\n+ def check_trailing_skip(self):\n+ a= array([0,0,1,0,2,3,0,4,0])\n+ res = trim_zeros(a)\n+ assert_array_equal(res,array([1,0,2,3,0,4]))\n+ \n+# Utility\n+\n+def compare_results(res,desired):\n+ for i in range(len(desired)):\n+ assert_array_equal(res[i],desired[i])\n+\n+\n+#-----------------------------------------------------------------------------\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_linspace,'check_') )\n+ suites.append( unittest.makeSuite(test_logspace,'check_') )\n+ suites.append( unittest.makeSuite(test_all,'check_') )\n+ suites.append( unittest.makeSuite(test_any,'check_') )\n+\n+ suites.append( unittest.makeSuite(test_amax,'check_') )\n+ suites.append( unittest.makeSuite(test_amin,'check_') )\n+ suites.append( unittest.makeSuite(test_ptp,'check_') ) \n+\n+ suites.append( unittest.makeSuite(test_cumsum,'check_') )\n+ suites.append( unittest.makeSuite(test_prod,'check_') )\n+ suites.append( unittest.makeSuite(test_cumprod,'check_') )\n+ suites.append( unittest.makeSuite(test_diff,'check_') )\n+\n+ suites.append( unittest.makeSuite(test_angle,'check_') )\n+ \n+ suites.append( unittest.makeSuite(test_trim_zeros,'check_') )\n+\n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n", + "added_lines": 242, + "deleted_lines": 0, + "source_code": "# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.index_tricks import *\nfrom scipy_base.function_base import *\n\n\nclass test_any(unittest.TestCase):\n def check_basic(self):\n y1 = [0,0,1,0]\n y2 = [0,0,0,0]\n y3 = [1,0,1,0]\n assert(any(y1))\n assert(any(y3))\n assert(not any(y2))\n\n def check_nd(self):\n y1 = [[0,0,0],[0,1,0],[1,1,0]]\n assert_array_equal(any(y1),[1,1,0])\n assert_array_equal(any(y1,axis=1),[0,1,1])\n \nclass test_all(unittest.TestCase):\n def check_basic(self):\n y1 = [0,1,1,0]\n y2 = [0,0,0,0]\n y3 = [1,1,1,1]\n assert(not all(y1))\n assert(all(y3))\n assert(not all(y2))\n assert(all(~array(y2)))\n\n def check_nd(self):\n y1 = [[0,0,1],[0,1,1],[1,1,1]]\n assert_array_equal(all(y1),[0,0,1])\n assert_array_equal(all(y1,axis=1),[0,0,1])\n\nclass test_logspace(unittest.TestCase):\n def check_basic(self):\n y = logspace(0,6)\n assert(len(y)==50)\n y = logspace(0,6,num=100)\n assert(y[-1] == 10**6)\n y = logspace(0,6,endpoint=0)\n assert(y[-1] < 10**6)\n y = logspace(0,6,num=7)\n assert_array_equal(y,[1,10,100,1e3,1e4,1e5,1e6])\n\nclass test_linspace(unittest.TestCase):\n def check_basic(self):\n y = linspace(0,10)\n assert(len(y)==50)\n y = linspace(2,10,num=100)\n assert(y[-1] == 10)\n y = linspace(2,10,endpoint=0)\n assert(y[-1] < 10)\n y,st = linspace(2,10,retstep=1)\n assert_almost_equal(st,8/49.0)\n assert_array_almost_equal(y,mgrid[2:10:50j],13)\n\nclass test_amax(unittest.TestCase):\n def check_basic(self):\n a = [3,4,5,10,-3,-5,6.0]\n assert_equal(amax(a),10.0)\n b = [[3,6.0, 9.0],\n [4,10.0,5.0],\n [8,3.0,2.0]]\n assert_equal(amax(b),[8.0,10.0,9.0])\n assert_equal(amax(b,axis=1),[9.0,10.0,8.0])\n \nclass test_amin(unittest.TestCase):\n def check_basic(self):\n a = [3,4,5,10,-3,-5,6.0]\n assert_equal(amin(a),-5.0)\n b = [[3,6.0, 9.0],\n [4,10.0,5.0],\n [8,3.0,2.0]]\n assert_equal(amin(b),[3.0,3.0,2.0])\n assert_equal(amin(b,axis=1),[3.0,4.0,2.0])\n\nclass test_ptp(unittest.TestCase):\n def check_basic(self):\n a = [3,4,5,10,-3,-5,6.0]\n assert_equal(ptp(a),15.0)\n b = [[3,6.0, 9.0],\n [4,10.0,5.0],\n [8,3.0,2.0]]\n assert_equal(ptp(b,axis=0),[5.0,7.0,7.0])\n assert_equal(ptp(b),[6.0,6.0,6.0])\n\nclass test_cumsum(unittest.TestCase):\n def check_basic(self):\n ba = [1,2,10,11,6,5,4]\n ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n for ctype in ['1','b','s','i','l','f','d','F','D']:\n a = array(ba,ctype)\n a2 = array(ba2,ctype)\n assert_array_equal(cumsum(a), array([1,3,13,24,30,35,39],ctype))\n assert_array_equal(cumsum(a2,axis=0), array([[1,2,3,4],[6,8,10,13],\n [16,11,14,18]],ctype))\n assert_array_equal(cumsum(a2,axis=1),\n array([[1,3,6,10],\n [5,11,18,27],\n [10,13,17,22]],ctype))\n\nclass test_prod(unittest.TestCase):\n def check_basic(self):\n ba = [1,2,10,11,6,5,4]\n ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n for ctype in ['1','b','s','i','l','f','d','F','D']:\n a = array(ba,ctype)\n a2 = array(ba2,ctype)\n if ctype in ['1', 'b']:\n self.failUnlessRaises(ArithmeticError, prod, a)\n self.failUnlessRaises(ArithmeticError, prod, a2, 1)\n self.failUnlessRaises(ArithmeticError, prod, a)\n else: \n assert_equal(prod(a),26400)\n assert_array_equal(prod(a2,axis=0), \n array([50,36,84,180],ctype))\n assert_array_equal(prod(a2),array([24, 1890, 600],ctype))\n\nclass test_cumprod(unittest.TestCase):\n def check_basic(self):\n ba = [1,2,10,11,6,5,4]\n ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]\n for ctype in ['1','b','s','i','l','f','d','F','D']:\n a = array(ba,ctype)\n a2 = array(ba2,ctype)\n if ctype in ['1', 'b']:\n self.failUnlessRaises(ArithmeticError, cumprod, a)\n self.failUnlessRaises(ArithmeticError, cumprod, a2, 1)\n self.failUnlessRaises(ArithmeticError, cumprod, a)\n else: \n assert_array_equal(cumprod(a),\n array([1, 2, 20, 220,\n 1320, 6600, 26400],ctype))\n assert_array_equal(cumprod(a2,axis=0),\n array([[ 1, 2, 3, 4],\n [ 5, 12, 21, 36],\n [50, 36, 84, 180]],ctype))\n assert_array_equal(cumprod(a2),\n array([[ 1, 2, 6, 24],\n [ 5, 30, 210, 1890],\n [10, 30, 120, 600]],ctype))\n\nclass test_diff(unittest.TestCase):\n def check_basic(self):\n x = [1,4,6,7,12]\n out = array([3,2,1,5])\n out2 = array([-1,-1,4])\n out3 = array([0,5])\n assert_array_equal(diff(x),out)\n assert_array_equal(diff(x,n=2),out2)\n assert_array_equal(diff(x,n=3),out3)\n\n def check_nd(self):\n x = 20*rand(10,20,30)\n out1 = x[:,:,1:] - x[:,:,:-1]\n out2 = out1[:,:,1:] - out1[:,:,:-1]\n out3 = x[1:,:,:] - x[:-1,:,:]\n out4 = out3[1:,:,:] - out3[:-1,:,:]\n assert_array_equal(diff(x),out1)\n assert_array_equal(diff(x,n=2),out2)\n assert_array_equal(diff(x,axis=0),out3)\n assert_array_equal(diff(x,n=2,axis=0),out4)\n\nclass test_angle(unittest.TestCase):\n def check_basic(self):\n x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j]\n y = angle(x)\n yo = [arctan(3.0/1.0),arctan(1.0),0,pi/2,pi,-pi/2.0,\n -arctan(3.0/1.0),pi-arctan(3.0/1.0)]\n z = angle(x,deg=1)\n zo = array(yo)*180/pi\n assert_array_almost_equal(y,yo,11)\n assert_array_almost_equal(z,zo,11)\n\nclass test_trim_zeros(unittest.TestCase):\n \"\"\" only testing for integer splits.\n \"\"\"\n def check_basic(self):\n a= array([0,0,1,2,3,4,0])\n res = trim_zeros(a)\n assert_array_equal(res,array([1,2,3,4]))\n def check_leading_skip(self):\n a= array([0,0,1,0,2,3,4,0])\n res = trim_zeros(a)\n assert_array_equal(res,array([1,0,2,3,4]))\n def check_trailing_skip(self):\n a= array([0,0,1,0,2,3,0,4,0])\n res = trim_zeros(a)\n assert_array_equal(res,array([1,0,2,3,0,4]))\n \n# Utility\n\ndef compare_results(res,desired):\n for i in range(len(desired)):\n assert_array_equal(res[i],desired[i])\n\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_linspace,'check_') )\n suites.append( unittest.makeSuite(test_logspace,'check_') )\n suites.append( unittest.makeSuite(test_all,'check_') )\n suites.append( unittest.makeSuite(test_any,'check_') )\n\n suites.append( unittest.makeSuite(test_amax,'check_') )\n suites.append( unittest.makeSuite(test_amin,'check_') )\n suites.append( unittest.makeSuite(test_ptp,'check_') ) \n\n suites.append( unittest.makeSuite(test_cumsum,'check_') )\n suites.append( unittest.makeSuite(test_prod,'check_') )\n suites.append( unittest.makeSuite(test_cumprod,'check_') )\n suites.append( unittest.makeSuite(test_diff,'check_') )\n\n suites.append( unittest.makeSuite(test_angle,'check_') )\n \n suites.append( unittest.makeSuite(test_trim_zeros,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": null, + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 60, + "parameters": [ + "self" + ], + "start_line": 16, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 24, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 30, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 102, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 105, + "parameters": [ + "self" + ], + "start_line": 56, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 122, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 75, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 123, + "parameters": [ + "self" + ], + "start_line": 78, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 122, + "parameters": [ + "self" + ], + "start_line": 88, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 13, + "complexity": 2, + "token_count": 218, + "parameters": [ + "self" + ], + "start_line": 98, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 15, + "complexity": 3, + "token_count": 192, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 22, + "complexity": 3, + "token_count": 257, + "parameters": [ + "self" + ], + "start_line": 130, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 91, + "parameters": [ + "self" + ], + "start_line": 154, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_function_base.py", + "nloc": 10, + "complexity": 1, + "token_count": 157, + "parameters": [ + "self" + ], + "start_line": 163, + "end_line": 172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 152, + "parameters": [ + "self" + ], + "start_line": 175, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 48, + "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": "check_leading_skip", + "long_name": "check_leading_skip( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_trailing_skip", + "long_name": "check_trailing_skip( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 196, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "compare_results", + "long_name": "compare_results( res , desired )", + "filename": "test_function_base.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "res", + "desired" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_function_base.py", + "nloc": 18, + "complexity": 2, + "token_count": 195, + "parameters": [ + "level" + ], + "start_line": 210, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 234, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 24, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "compare_results", + "long_name": "compare_results( res , desired )", + "filename": "test_function_base.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "res", + "desired" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_function_base.py", + "nloc": 18, + "complexity": 2, + "token_count": 195, + "parameters": [ + "level" + ], + "start_line": 210, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_function_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 234, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_function_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 60, + "parameters": [ + "self" + ], + "start_line": 16, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_trailing_skip", + "long_name": "check_trailing_skip( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 196, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_leading_skip", + "long_name": "check_leading_skip( self )", + "filename": "test_function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 192, + "end_line": 195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + } + ], + "nloc": 206, + "complexity": 28, + "token_count": 2496, + "diff_parsed": { + "added": [ + "# only for short term testing", + "import sys", + "sys.path.insert(0,'../..')", + "", + "import unittest", + "from scipy_base.testing import assert_array_equal, assert_equal, rand", + "from scipy_base.testing import assert_almost_equal, assert_array_almost_equal", + "", + "from scipy_base import *", + "# This won't be needed when we get scipy_base finished.", + "from scipy_base.index_tricks import *", + "from scipy_base.function_base import *", + "", + "", + "class test_any(unittest.TestCase):", + " def check_basic(self):", + " y1 = [0,0,1,0]", + " y2 = [0,0,0,0]", + " y3 = [1,0,1,0]", + " assert(any(y1))", + " assert(any(y3))", + " assert(not any(y2))", + "", + " def check_nd(self):", + " y1 = [[0,0,0],[0,1,0],[1,1,0]]", + " assert_array_equal(any(y1),[1,1,0])", + " assert_array_equal(any(y1,axis=1),[0,1,1])", + "", + "class test_all(unittest.TestCase):", + " def check_basic(self):", + " y1 = [0,1,1,0]", + " y2 = [0,0,0,0]", + " y3 = [1,1,1,1]", + " assert(not all(y1))", + " assert(all(y3))", + " assert(not all(y2))", + " assert(all(~array(y2)))", + "", + " def check_nd(self):", + " y1 = [[0,0,1],[0,1,1],[1,1,1]]", + " assert_array_equal(all(y1),[0,0,1])", + " assert_array_equal(all(y1,axis=1),[0,0,1])", + "", + "class test_logspace(unittest.TestCase):", + " def check_basic(self):", + " y = logspace(0,6)", + " assert(len(y)==50)", + " y = logspace(0,6,num=100)", + " assert(y[-1] == 10**6)", + " y = logspace(0,6,endpoint=0)", + " assert(y[-1] < 10**6)", + " y = logspace(0,6,num=7)", + " assert_array_equal(y,[1,10,100,1e3,1e4,1e5,1e6])", + "", + "class test_linspace(unittest.TestCase):", + " def check_basic(self):", + " y = linspace(0,10)", + " assert(len(y)==50)", + " y = linspace(2,10,num=100)", + " assert(y[-1] == 10)", + " y = linspace(2,10,endpoint=0)", + " assert(y[-1] < 10)", + " y,st = linspace(2,10,retstep=1)", + " assert_almost_equal(st,8/49.0)", + " assert_array_almost_equal(y,mgrid[2:10:50j],13)", + "", + "class test_amax(unittest.TestCase):", + " def check_basic(self):", + " a = [3,4,5,10,-3,-5,6.0]", + " assert_equal(amax(a),10.0)", + " b = [[3,6.0, 9.0],", + " [4,10.0,5.0],", + " [8,3.0,2.0]]", + " assert_equal(amax(b),[8.0,10.0,9.0])", + " assert_equal(amax(b,axis=1),[9.0,10.0,8.0])", + "", + "class test_amin(unittest.TestCase):", + " def check_basic(self):", + " a = [3,4,5,10,-3,-5,6.0]", + " assert_equal(amin(a),-5.0)", + " b = [[3,6.0, 9.0],", + " [4,10.0,5.0],", + " [8,3.0,2.0]]", + " assert_equal(amin(b),[3.0,3.0,2.0])", + " assert_equal(amin(b,axis=1),[3.0,4.0,2.0])", + "", + "class test_ptp(unittest.TestCase):", + " def check_basic(self):", + " a = [3,4,5,10,-3,-5,6.0]", + " assert_equal(ptp(a),15.0)", + " b = [[3,6.0, 9.0],", + " [4,10.0,5.0],", + " [8,3.0,2.0]]", + " assert_equal(ptp(b,axis=0),[5.0,7.0,7.0])", + " assert_equal(ptp(b),[6.0,6.0,6.0])", + "", + "class test_cumsum(unittest.TestCase):", + " def check_basic(self):", + " ba = [1,2,10,11,6,5,4]", + " ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]", + " for ctype in ['1','b','s','i','l','f','d','F','D']:", + " a = array(ba,ctype)", + " a2 = array(ba2,ctype)", + " assert_array_equal(cumsum(a), array([1,3,13,24,30,35,39],ctype))", + " assert_array_equal(cumsum(a2,axis=0), array([[1,2,3,4],[6,8,10,13],", + " [16,11,14,18]],ctype))", + " assert_array_equal(cumsum(a2,axis=1),", + " array([[1,3,6,10],", + " [5,11,18,27],", + " [10,13,17,22]],ctype))", + "", + "class test_prod(unittest.TestCase):", + " def check_basic(self):", + " ba = [1,2,10,11,6,5,4]", + " ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]", + " for ctype in ['1','b','s','i','l','f','d','F','D']:", + " a = array(ba,ctype)", + " a2 = array(ba2,ctype)", + " if ctype in ['1', 'b']:", + " self.failUnlessRaises(ArithmeticError, prod, a)", + " self.failUnlessRaises(ArithmeticError, prod, a2, 1)", + " self.failUnlessRaises(ArithmeticError, prod, a)", + " else:", + " assert_equal(prod(a),26400)", + " assert_array_equal(prod(a2,axis=0),", + " array([50,36,84,180],ctype))", + " assert_array_equal(prod(a2),array([24, 1890, 600],ctype))", + "", + "class test_cumprod(unittest.TestCase):", + " def check_basic(self):", + " ba = [1,2,10,11,6,5,4]", + " ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]", + " for ctype in ['1','b','s','i','l','f','d','F','D']:", + " a = array(ba,ctype)", + " a2 = array(ba2,ctype)", + " if ctype in ['1', 'b']:", + " self.failUnlessRaises(ArithmeticError, cumprod, a)", + " self.failUnlessRaises(ArithmeticError, cumprod, a2, 1)", + " self.failUnlessRaises(ArithmeticError, cumprod, a)", + " else:", + " assert_array_equal(cumprod(a),", + " array([1, 2, 20, 220,", + " 1320, 6600, 26400],ctype))", + " assert_array_equal(cumprod(a2,axis=0),", + " array([[ 1, 2, 3, 4],", + " [ 5, 12, 21, 36],", + " [50, 36, 84, 180]],ctype))", + " assert_array_equal(cumprod(a2),", + " array([[ 1, 2, 6, 24],", + " [ 5, 30, 210, 1890],", + " [10, 30, 120, 600]],ctype))", + "", + "class test_diff(unittest.TestCase):", + " def check_basic(self):", + " x = [1,4,6,7,12]", + " out = array([3,2,1,5])", + " out2 = array([-1,-1,4])", + " out3 = array([0,5])", + " assert_array_equal(diff(x),out)", + " assert_array_equal(diff(x,n=2),out2)", + " assert_array_equal(diff(x,n=3),out3)", + "", + " def check_nd(self):", + " x = 20*rand(10,20,30)", + " out1 = x[:,:,1:] - x[:,:,:-1]", + " out2 = out1[:,:,1:] - out1[:,:,:-1]", + " out3 = x[1:,:,:] - x[:-1,:,:]", + " out4 = out3[1:,:,:] - out3[:-1,:,:]", + " assert_array_equal(diff(x),out1)", + " assert_array_equal(diff(x,n=2),out2)", + " assert_array_equal(diff(x,axis=0),out3)", + " assert_array_equal(diff(x,n=2,axis=0),out4)", + "", + "class test_angle(unittest.TestCase):", + " def check_basic(self):", + " x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j]", + " y = angle(x)", + " yo = [arctan(3.0/1.0),arctan(1.0),0,pi/2,pi,-pi/2.0,", + " -arctan(3.0/1.0),pi-arctan(3.0/1.0)]", + " z = angle(x,deg=1)", + " zo = array(yo)*180/pi", + " assert_array_almost_equal(y,yo,11)", + " assert_array_almost_equal(z,zo,11)", + "", + "class test_trim_zeros(unittest.TestCase):", + " \"\"\" only testing for integer splits.", + " \"\"\"", + " def check_basic(self):", + " a= array([0,0,1,2,3,4,0])", + " res = trim_zeros(a)", + " assert_array_equal(res,array([1,2,3,4]))", + " def check_leading_skip(self):", + " a= array([0,0,1,0,2,3,4,0])", + " res = trim_zeros(a)", + " assert_array_equal(res,array([1,0,2,3,4]))", + " def check_trailing_skip(self):", + " a= array([0,0,1,0,2,3,0,4,0])", + " res = trim_zeros(a)", + " assert_array_equal(res,array([1,0,2,3,0,4]))", + "", + "# Utility", + "", + "def compare_results(res,desired):", + " for i in range(len(desired)):", + " assert_array_equal(res[i],desired[i])", + "", + "", + "#-----------------------------------------------------------------------------", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_linspace,'check_') )", + " suites.append( unittest.makeSuite(test_logspace,'check_') )", + " suites.append( unittest.makeSuite(test_all,'check_') )", + " suites.append( unittest.makeSuite(test_any,'check_') )", + "", + " suites.append( unittest.makeSuite(test_amax,'check_') )", + " suites.append( unittest.makeSuite(test_amin,'check_') )", + " suites.append( unittest.makeSuite(test_ptp,'check_') )", + "", + " suites.append( unittest.makeSuite(test_cumsum,'check_') )", + " suites.append( unittest.makeSuite(test_prod,'check_') )", + " suites.append( unittest.makeSuite(test_cumprod,'check_') )", + " suites.append( unittest.makeSuite(test_diff,'check_') )", + "", + " suites.append( unittest.makeSuite(test_angle,'check_') )", + "", + " suites.append( unittest.makeSuite(test_trim_zeros,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/tests/test_index_tricks.py", + "filename": "test_index_tricks.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,71 @@\n+import unittest\n+from scipy_base.testing import assert_array_equal, assert_equal\n+from scipy_base.testing import assert_almost_equal, assert_array_almost_equal\n+from scipy_base import *\n+\n+class test_grid(unittest.TestCase):\n+ def check_basic(self):\n+ a = mgrid[-1:1:10j]\n+ b = mgrid[-1:1:0.1]\n+ assert(a.shape == (10,))\n+ assert(b.shape == (20,))\n+ assert(a[0] == -1)\n+ assert_almost_equal(a[-1],1)\n+ assert(b[0] == -1)\n+ assert_almost_equal(b[1]-b[0],0.1,11)\n+ assert_almost_equal(b[-1],b[0]+19*0.1,11)\n+ assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n+\n+ def check_nd(self):\n+ c = mgrid[-1:1:10j,-2:2:10j]\n+ d = mgrid[-1:1:0.1,-2:2:0.2]\n+ assert(c.shape == (2,10,10))\n+ assert(d.shape == (2,20,20))\n+ assert_array_equal(c[0][0,:],-ones(10,'d'))\n+ assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n+ assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n+ assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n+ assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n+ assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n+\n+class test_concatenator(unittest.TestCase):\n+ def check_1d(self):\n+ assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n+ b = ones(5)\n+ c = r_[b,0,0,b]\n+ assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n+ c = c_[b,0,0,b]\n+ assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n+\n+ def check_2d(self):\n+ b = rand(5,5)\n+ c = rand(5,5)\n+ d = c_[b,c] # append columns\n+ assert(d.shape == (5,10))\n+ assert_array_equal(d[:,:5],b)\n+ assert_array_equal(d[:,5:],c)\n+ d = r_[b,c]\n+ assert(d.shape == (10,5))\n+ assert_array_equal(d[:5,:],b)\n+ assert_array_equal(d[5:,:],c)\n+\n+#-----------------------------------------------------------------------------\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_grid,'check_') )\n+ suites.append( unittest.makeSuite(test_concatenator,'check_') )\n+ \n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n\\ No newline at end of file\n", + "added_lines": 71, + "deleted_lines": 0, + "source_code": "import unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal\nfrom scipy_base import *\n\nclass test_grid(unittest.TestCase):\n def check_basic(self):\n a = mgrid[-1:1:10j]\n b = mgrid[-1:1:0.1]\n assert(a.shape == (10,))\n assert(b.shape == (20,))\n assert(a[0] == -1)\n assert_almost_equal(a[-1],1)\n assert(b[0] == -1)\n assert_almost_equal(b[1]-b[0],0.1,11)\n assert_almost_equal(b[-1],b[0]+19*0.1,11)\n assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n\n def check_nd(self):\n c = mgrid[-1:1:10j,-2:2:10j]\n d = mgrid[-1:1:0.1,-2:2:0.2]\n assert(c.shape == (2,10,10))\n assert(d.shape == (2,20,20))\n assert_array_equal(c[0][0,:],-ones(10,'d'))\n assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n\nclass test_concatenator(unittest.TestCase):\n def check_1d(self):\n assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n b = ones(5)\n c = r_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n c = c_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n\n def check_2d(self):\n b = rand(5,5)\n c = rand(5,5)\n d = c_[b,c] # append columns\n assert(d.shape == (5,10))\n assert_array_equal(d[:,:5],b)\n assert_array_equal(d[:,5:],c)\n d = r_[b,c]\n assert(d.shape == (10,5))\n assert_array_equal(d[:5,:],b)\n assert_array_equal(d[5:,:],c)\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_grid,'check_') )\n suites.append( unittest.makeSuite(test_concatenator,'check_') )\n \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()", + "source_code_before": null, + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 1, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 54, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 63, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 1, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 54, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 63, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + } + ], + "nloc": 60, + "complexity": 7, + "token_count": 739, + "diff_parsed": { + "added": [ + "import unittest", + "from scipy_base.testing import assert_array_equal, assert_equal", + "from scipy_base.testing import assert_almost_equal, assert_array_almost_equal", + "from scipy_base import *", + "", + "class test_grid(unittest.TestCase):", + " def check_basic(self):", + " a = mgrid[-1:1:10j]", + " b = mgrid[-1:1:0.1]", + " assert(a.shape == (10,))", + " assert(b.shape == (20,))", + " assert(a[0] == -1)", + " assert_almost_equal(a[-1],1)", + " assert(b[0] == -1)", + " assert_almost_equal(b[1]-b[0],0.1,11)", + " assert_almost_equal(b[-1],b[0]+19*0.1,11)", + " assert_almost_equal(a[1]-a[0],2.0/9.0,11)", + "", + " def check_nd(self):", + " c = mgrid[-1:1:10j,-2:2:10j]", + " d = mgrid[-1:1:0.1,-2:2:0.2]", + " assert(c.shape == (2,10,10))", + " assert(d.shape == (2,20,20))", + " assert_array_equal(c[0][0,:],-ones(10,'d'))", + " assert_array_equal(c[1][:,0],-2*ones(10,'d'))", + " assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)", + " assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)", + " assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)", + " assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)", + "", + "class test_concatenator(unittest.TestCase):", + " def check_1d(self):", + " assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))", + " b = ones(5)", + " c = r_[b,0,0,b]", + " assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])", + " c = c_[b,0,0,b]", + " assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])", + "", + " def check_2d(self):", + " b = rand(5,5)", + " c = rand(5,5)", + " d = c_[b,c] # append columns", + " assert(d.shape == (5,10))", + " assert_array_equal(d[:,:5],b)", + " assert_array_equal(d[:,5:],c)", + " d = r_[b,c]", + " assert(d.shape == (10,5))", + " assert_array_equal(d[:5,:],b)", + " assert_array_equal(d[5:,:],c)", + "", + "#-----------------------------------------------------------------------------", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_grid,'check_') )", + " suites.append( unittest.makeSuite(test_concatenator,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/tests/test_limits.py", + "filename": "test_limits.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,44 @@\n+\"\"\" Test functions for limits module.\n+\n+ Currently empty -- not sure how to test these values\n+ and routines as they are machine dependent. Suggestions?\n+\"\"\"\n+\n+from scipy_base import *\n+import unittest\n+import scipy_base.limits\n+\n+\n+\n+##################################################\n+### Test for sum\n+\n+class test_float(unittest.TestCase):\n+ def check_nothing(self):\n+ pass\n+\n+class test_double(unittest.TestCase):\n+ def check_nothing(self):\n+ pass\n+\n+##################################################\n+\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_float,'check_') )\n+ suites.append( unittest.makeSuite(test_double,'check_') )\n+ \n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n\\ No newline at end of file\n", + "added_lines": 44, + "deleted_lines": 0, + "source_code": "\"\"\" Test functions for limits module.\n\n Currently empty -- not sure how to test these values\n and routines as they are machine dependent. Suggestions?\n\"\"\"\n\nfrom scipy_base import *\nimport unittest\nimport scipy_base.limits\n\n\n\n##################################################\n### Test for sum\n\nclass test_float(unittest.TestCase):\n def check_nothing(self):\n pass\n\nclass test_double(unittest.TestCase):\n def check_nothing(self):\n pass\n\n##################################################\n\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_float,'check_') )\n suites.append( unittest.makeSuite(test_double,'check_') )\n \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()", + "source_code_before": null, + "methods": [ + { + "name": "check_nothing", + "long_name": "check_nothing( self )", + "filename": "test_limits.py", + "nloc": 2, + "complexity": 1, + "token_count": 6, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_nothing", + "long_name": "check_nothing( self )", + "filename": "test_limits.py", + "nloc": 2, + "complexity": 1, + "token_count": 6, + "parameters": [ + "self" + ], + "start_line": 21, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_limits.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 27, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_limits.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 36, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "check_nothing", + "long_name": "check_nothing( self )", + "filename": "test_limits.py", + "nloc": 2, + "complexity": 1, + "token_count": 6, + "parameters": [ + "self" + ], + "start_line": 17, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_limits.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 27, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_limits.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 36, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "nloc": 28, + "complexity": 5, + "token_count": 131, + "diff_parsed": { + "added": [ + "\"\"\" Test functions for limits module.", + "", + " Currently empty -- not sure how to test these values", + " and routines as they are machine dependent. Suggestions?", + "\"\"\"", + "", + "from scipy_base import *", + "import unittest", + "import scipy_base.limits", + "", + "", + "", + "##################################################", + "### Test for sum", + "", + "class test_float(unittest.TestCase):", + " def check_nothing(self):", + " pass", + "", + "class test_double(unittest.TestCase):", + " def check_nothing(self):", + " pass", + "", + "##################################################", + "", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_float,'check_') )", + " suites.append( unittest.makeSuite(test_double,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/tests/test_matrix_base.py", + "filename": "test_matrix_base.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,171 @@\n+\"\"\" Test functions for basic module\n+\n+\"\"\"\n+\n+# only for short term testing\n+import sys\n+sys.path.insert(0,'../..')\n+\n+import unittest\n+from scipy_base.testing import assert_array_equal, assert_equal\n+from scipy_base.testing import assert_almost_equal, assert_array_almost_equal\n+\n+\n+from scipy_base import *\n+# This won't be needed when we get scipy_base finished.\n+from scipy_base.type_check import isscalar \n+from scipy_base import limits\n+from scipy_base.matrix_base import *\n+\n+##################################################\n+\n+val = limits.double_resolution\n+\n+\n+def get_mat(n):\n+ data = arange(n)\n+ data = add.outer(data,data)\n+ return data\n+\n+class test_eye(unittest.TestCase):\n+ def check_basic(self):\n+ assert_equal(eye(4),array([[1,0,0,0],\n+ [0,1,0,0],\n+ [0,0,1,0],\n+ [0,0,0,1]]))\n+ assert_equal(eye(4,typecode='f'),array([[1,0,0,0],\n+ [0,1,0,0],\n+ [0,0,1,0],\n+ [0,0,0,1]],'f'))\n+ def check_diag(self):\n+ assert_equal(eye(4,k=1),array([[0,1,0,0],\n+ [0,0,1,0],\n+ [0,0,0,1],\n+ [0,0,0,0]]))\n+ assert_equal(eye(4,k=-1),array([[0,0,0,0],\n+ [1,0,0,0],\n+ [0,1,0,0],\n+ [0,0,1,0]]))\n+ def check_2d(self):\n+ assert_equal(eye(4,3),array([[1,0,0],\n+ [0,1,0],\n+ [0,0,1],\n+ [0,0,0]]))\n+ assert_equal(eye(3,4),array([[1,0,0,0],\n+ [0,1,0,0],\n+ [0,0,1,0]])) \n+ def check_diag2d(self):\n+ assert_equal(eye(3,4,k=2),array([[0,0,1,0],\n+ [0,0,0,1],\n+ [0,0,0,0]]))\n+ assert_equal(eye(4,3,k=-2),array([[0,0,0],\n+ [0,0,0],\n+ [1,0,0],\n+ [0,1,0]]))\n+\n+class test_diag(unittest.TestCase):\n+ def check_vector(self):\n+ vals = (100*arange(5)).astype('l')\n+ b = zeros((5,5))\n+ for k in range(5):\n+ b[k,k] = vals[k]\n+ assert_equal(diag(vals),b)\n+ b = zeros((7,7))\n+ c = b.copy()\n+ for k in range(5):\n+ b[k,k+2] = vals[k]\n+ c[k+2,k] = vals[k]\n+ assert_equal(diag(vals,k=2), b)\n+ assert_equal(diag(vals,k=-2), c)\n+\n+ def check_matrix(self):\n+ vals = (100*get_mat(5)+1).astype('l')\n+ b = zeros((5,))\n+ for k in range(5):\n+ b[k] = vals[k,k]\n+ assert_equal(diag(vals),b)\n+ b = b*0\n+ for k in range(3):\n+ b[k] = vals[k,k+2]\n+ assert_equal(diag(vals,2),b[:3])\n+ for k in range(3):\n+ b[k] = vals[k+2,k]\n+ assert_equal(diag(vals,-2),b[:3])\n+\n+class test_fliplr(unittest.TestCase):\n+ def check_basic(self):\n+ self.failUnlessRaises(ValueError, fliplr, ones(4)) \n+ self.failUnlessRaises(ValueError, fliplr, ones((4,3,2)))\n+ a = get_mat(4)\n+ b = a[:,::-1]\n+ assert_equal(fliplr(a),b)\n+ a = [[0,1,2],\n+ [3,4,5]]\n+ b = [[2,1,0],\n+ [5,4,3]]\n+ assert_equal(fliplr(a),b)\n+\n+class test_flipud(unittest.TestCase):\n+ def check_basic(self):\n+ self.failUnlessRaises(ValueError, flipud, ones(4))\n+ self.failUnlessRaises(ValueError, flipud, ones((4,3,2)))\n+ a = get_mat(4)\n+ b = a[::-1,:]\n+ assert_equal(flipud(a),b)\n+ a = [[0,1,2],\n+ [3,4,5]]\n+ b = [[3,4,5],\n+ [0,1,2]]\n+ assert_equal(flipud(a),b)\n+\n+class test_rot90(unittest.TestCase):\n+ def check_basic(self):\n+ self.failUnlessRaises(ValueError, rot90, ones(4))\n+ self.failUnlessRaises(ValueError, rot90, ones((4,3,2)))\n+\n+ a = [[0,1,2],\n+ [3,4,5]]\n+ b1 = [[2,5],\n+ [1,4],\n+ [0,3]]\n+ b2 = [[5,4,3],\n+ [2,1,0]]\n+ b3 = [[3,0],\n+ [4,1],\n+ [5,2]]\n+ b4 = [[0,1,2],\n+ [3,4,5]]\n+\n+ for k in range(-3,13,4):\n+ assert_equal(rot90(a,k=k),b1)\n+ for k in range(-2,13,4):\n+ assert_equal(rot90(a,k=k),b2)\n+ for k in range(-1,13,4):\n+ assert_equal(rot90(a,k=k),b3)\n+ for k in range(0,13,4):\n+ assert_equal(rot90(a,k=k),b4)\n+\n+ \n+#-----------------------------------------------------------------------------\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_eye,'check_') )\n+ suites.append( unittest.makeSuite(test_diag,'check_') )\n+ suites.append( unittest.makeSuite(test_fliplr,'check_') )\n+ suites.append( unittest.makeSuite(test_flipud,'check_') )\n+ suites.append( unittest.makeSuite(test_rot90,'check_') )\n+\n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n", + "added_lines": 171, + "deleted_lines": 0, + "source_code": "\"\"\" Test functions for basic module\n\n\"\"\"\n\n# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal\n\n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.type_check import isscalar \nfrom scipy_base import limits\nfrom scipy_base.matrix_base import *\n\n##################################################\n\nval = limits.double_resolution\n\n\ndef get_mat(n):\n data = arange(n)\n data = add.outer(data,data)\n return data\n\nclass test_eye(unittest.TestCase):\n def check_basic(self):\n assert_equal(eye(4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]]))\n assert_equal(eye(4,typecode='f'),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0],\n [0,0,0,1]],'f'))\n def check_diag(self):\n assert_equal(eye(4,k=1),array([[0,1,0,0],\n [0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,k=-1),array([[0,0,0,0],\n [1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]]))\n def check_2d(self):\n assert_equal(eye(4,3),array([[1,0,0],\n [0,1,0],\n [0,0,1],\n [0,0,0]]))\n assert_equal(eye(3,4),array([[1,0,0,0],\n [0,1,0,0],\n [0,0,1,0]])) \n def check_diag2d(self):\n assert_equal(eye(3,4,k=2),array([[0,0,1,0],\n [0,0,0,1],\n [0,0,0,0]]))\n assert_equal(eye(4,3,k=-2),array([[0,0,0],\n [0,0,0],\n [1,0,0],\n [0,1,0]]))\n\nclass test_diag(unittest.TestCase):\n def check_vector(self):\n vals = (100*arange(5)).astype('l')\n b = zeros((5,5))\n for k in range(5):\n b[k,k] = vals[k]\n assert_equal(diag(vals),b)\n b = zeros((7,7))\n c = b.copy()\n for k in range(5):\n b[k,k+2] = vals[k]\n c[k+2,k] = vals[k]\n assert_equal(diag(vals,k=2), b)\n assert_equal(diag(vals,k=-2), c)\n\n def check_matrix(self):\n vals = (100*get_mat(5)+1).astype('l')\n b = zeros((5,))\n for k in range(5):\n b[k] = vals[k,k]\n assert_equal(diag(vals),b)\n b = b*0\n for k in range(3):\n b[k] = vals[k,k+2]\n assert_equal(diag(vals,2),b[:3])\n for k in range(3):\n b[k] = vals[k+2,k]\n assert_equal(diag(vals,-2),b[:3])\n\nclass test_fliplr(unittest.TestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, fliplr, ones(4)) \n self.failUnlessRaises(ValueError, fliplr, ones((4,3,2)))\n a = get_mat(4)\n b = a[:,::-1]\n assert_equal(fliplr(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[2,1,0],\n [5,4,3]]\n assert_equal(fliplr(a),b)\n\nclass test_flipud(unittest.TestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, flipud, ones(4))\n self.failUnlessRaises(ValueError, flipud, ones((4,3,2)))\n a = get_mat(4)\n b = a[::-1,:]\n assert_equal(flipud(a),b)\n a = [[0,1,2],\n [3,4,5]]\n b = [[3,4,5],\n [0,1,2]]\n assert_equal(flipud(a),b)\n\nclass test_rot90(unittest.TestCase):\n def check_basic(self):\n self.failUnlessRaises(ValueError, rot90, ones(4))\n self.failUnlessRaises(ValueError, rot90, ones((4,3,2)))\n\n a = [[0,1,2],\n [3,4,5]]\n b1 = [[2,5],\n [1,4],\n [0,3]]\n b2 = [[5,4,3],\n [2,1,0]]\n b3 = [[3,0],\n [4,1],\n [5,2]]\n b4 = [[0,1,2],\n [3,4,5]]\n\n for k in range(-3,13,4):\n assert_equal(rot90(a,k=k),b1)\n for k in range(-2,13,4):\n assert_equal(rot90(a,k=k),b2)\n for k in range(-1,13,4):\n assert_equal(rot90(a,k=k),b3)\n for k in range(0,13,4):\n assert_equal(rot90(a,k=k),b4)\n\n \n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_eye,'check_') )\n suites.append( unittest.makeSuite(test_diag,'check_') )\n suites.append( unittest.makeSuite(test_fliplr,'check_') )\n suites.append( unittest.makeSuite(test_flipud,'check_') )\n suites.append( unittest.makeSuite(test_rot90,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": null, + "methods": [ + { + "name": "get_mat", + "long_name": "get_mat( n )", + "filename": "test_matrix_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "n" + ], + "start_line": 25, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_matrix_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 31, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_diag", + "long_name": "check_diag( self )", + "filename": "test_matrix_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 118, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_matrix_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 49, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_diag2d", + "long_name": "check_diag2d( self )", + "filename": "test_matrix_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 104, + "parameters": [ + "self" + ], + "start_line": 57, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_vector", + "long_name": "check_vector( self )", + "filename": "test_matrix_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 136, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_matrix", + "long_name": "check_matrix( self )", + "filename": "test_matrix_base.py", + "nloc": 13, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_matrix_base.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_matrix_base.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_matrix_base.py", + "nloc": 23, + "complexity": 5, + "token_count": 239, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 25, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_matrix_base.py", + "nloc": 10, + "complexity": 2, + "token_count": 91, + "parameters": [ + "level" + ], + "start_line": 151, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_matrix_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 163, + "end_line": 167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "get_mat", + "long_name": "get_mat( n )", + "filename": "test_matrix_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 23, + "parameters": [ + "n" + ], + "start_line": 25, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "check_matrix", + "long_name": "check_matrix( self )", + "filename": "test_matrix_base.py", + "nloc": 13, + "complexity": 4, + "token_count": 137, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_matrix_base.py", + "nloc": 10, + "complexity": 2, + "token_count": 91, + "parameters": [ + "level" + ], + "start_line": 151, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_matrix_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 163, + "end_line": 167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_matrix_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 115, + "parameters": [ + "self" + ], + "start_line": 31, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_matrix_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 95, + "parameters": [ + "self" + ], + "start_line": 49, + "end_line": 56, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_diag2d", + "long_name": "check_diag2d( self )", + "filename": "test_matrix_base.py", + "nloc": 8, + "complexity": 1, + "token_count": 104, + "parameters": [ + "self" + ], + "start_line": 57, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_diag", + "long_name": "check_diag( self )", + "filename": "test_matrix_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 118, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_vector", + "long_name": "check_vector( self )", + "filename": "test_matrix_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 136, + "parameters": [ + "self" + ], + "start_line": 67, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + } + ], + "nloc": 144, + "complexity": 22, + "token_count": 1420, + "diff_parsed": { + "added": [ + "\"\"\" Test functions for basic module", + "", + "\"\"\"", + "", + "# only for short term testing", + "import sys", + "sys.path.insert(0,'../..')", + "", + "import unittest", + "from scipy_base.testing import assert_array_equal, assert_equal", + "from scipy_base.testing import assert_almost_equal, assert_array_almost_equal", + "", + "", + "from scipy_base import *", + "# This won't be needed when we get scipy_base finished.", + "from scipy_base.type_check import isscalar", + "from scipy_base import limits", + "from scipy_base.matrix_base import *", + "", + "##################################################", + "", + "val = limits.double_resolution", + "", + "", + "def get_mat(n):", + " data = arange(n)", + " data = add.outer(data,data)", + " return data", + "", + "class test_eye(unittest.TestCase):", + " def check_basic(self):", + " assert_equal(eye(4),array([[1,0,0,0],", + " [0,1,0,0],", + " [0,0,1,0],", + " [0,0,0,1]]))", + " assert_equal(eye(4,typecode='f'),array([[1,0,0,0],", + " [0,1,0,0],", + " [0,0,1,0],", + " [0,0,0,1]],'f'))", + " def check_diag(self):", + " assert_equal(eye(4,k=1),array([[0,1,0,0],", + " [0,0,1,0],", + " [0,0,0,1],", + " [0,0,0,0]]))", + " assert_equal(eye(4,k=-1),array([[0,0,0,0],", + " [1,0,0,0],", + " [0,1,0,0],", + " [0,0,1,0]]))", + " def check_2d(self):", + " assert_equal(eye(4,3),array([[1,0,0],", + " [0,1,0],", + " [0,0,1],", + " [0,0,0]]))", + " assert_equal(eye(3,4),array([[1,0,0,0],", + " [0,1,0,0],", + " [0,0,1,0]]))", + " def check_diag2d(self):", + " assert_equal(eye(3,4,k=2),array([[0,0,1,0],", + " [0,0,0,1],", + " [0,0,0,0]]))", + " assert_equal(eye(4,3,k=-2),array([[0,0,0],", + " [0,0,0],", + " [1,0,0],", + " [0,1,0]]))", + "", + "class test_diag(unittest.TestCase):", + " def check_vector(self):", + " vals = (100*arange(5)).astype('l')", + " b = zeros((5,5))", + " for k in range(5):", + " b[k,k] = vals[k]", + " assert_equal(diag(vals),b)", + " b = zeros((7,7))", + " c = b.copy()", + " for k in range(5):", + " b[k,k+2] = vals[k]", + " c[k+2,k] = vals[k]", + " assert_equal(diag(vals,k=2), b)", + " assert_equal(diag(vals,k=-2), c)", + "", + " def check_matrix(self):", + " vals = (100*get_mat(5)+1).astype('l')", + " b = zeros((5,))", + " for k in range(5):", + " b[k] = vals[k,k]", + " assert_equal(diag(vals),b)", + " b = b*0", + " for k in range(3):", + " b[k] = vals[k,k+2]", + " assert_equal(diag(vals,2),b[:3])", + " for k in range(3):", + " b[k] = vals[k+2,k]", + " assert_equal(diag(vals,-2),b[:3])", + "", + "class test_fliplr(unittest.TestCase):", + " def check_basic(self):", + " self.failUnlessRaises(ValueError, fliplr, ones(4))", + " self.failUnlessRaises(ValueError, fliplr, ones((4,3,2)))", + " a = get_mat(4)", + " b = a[:,::-1]", + " assert_equal(fliplr(a),b)", + " a = [[0,1,2],", + " [3,4,5]]", + " b = [[2,1,0],", + " [5,4,3]]", + " assert_equal(fliplr(a),b)", + "", + "class test_flipud(unittest.TestCase):", + " def check_basic(self):", + " self.failUnlessRaises(ValueError, flipud, ones(4))", + " self.failUnlessRaises(ValueError, flipud, ones((4,3,2)))", + " a = get_mat(4)", + " b = a[::-1,:]", + " assert_equal(flipud(a),b)", + " a = [[0,1,2],", + " [3,4,5]]", + " b = [[3,4,5],", + " [0,1,2]]", + " assert_equal(flipud(a),b)", + "", + "class test_rot90(unittest.TestCase):", + " def check_basic(self):", + " self.failUnlessRaises(ValueError, rot90, ones(4))", + " self.failUnlessRaises(ValueError, rot90, ones((4,3,2)))", + "", + " a = [[0,1,2],", + " [3,4,5]]", + " b1 = [[2,5],", + " [1,4],", + " [0,3]]", + " b2 = [[5,4,3],", + " [2,1,0]]", + " b3 = [[3,0],", + " [4,1],", + " [5,2]]", + " b4 = [[0,1,2],", + " [3,4,5]]", + "", + " for k in range(-3,13,4):", + " assert_equal(rot90(a,k=k),b1)", + " for k in range(-2,13,4):", + " assert_equal(rot90(a,k=k),b2)", + " for k in range(-1,13,4):", + " assert_equal(rot90(a,k=k),b3)", + " for k in range(0,13,4):", + " assert_equal(rot90(a,k=k),b4)", + "", + "", + "#-----------------------------------------------------------------------------", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_eye,'check_') )", + " suites.append( unittest.makeSuite(test_diag,'check_') )", + " suites.append( unittest.makeSuite(test_fliplr,'check_') )", + " suites.append( unittest.makeSuite(test_flipud,'check_') )", + " suites.append( unittest.makeSuite(test_rot90,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/tests/test_shape_base.py", + "filename": "test_shape_base.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,388 @@\n+# only for short term testing\n+import sys\n+sys.path.insert(0,'../..')\n+\n+import unittest\n+from scipy_base.testing import assert_array_equal, assert_equal, rand\n+from scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n+\n+from scipy_base import *\n+# This won't be needed when we get scipy_base finished.\n+from scipy_base.shape_base import *\n+\n+\n+class test_array_split(unittest.TestCase):\n+ def check_integer_0_split(self):\n+ a = arange(10)\n+ try:\n+ res = array_split(a,0)\n+ assert(0) # it should have thrown a value error\n+ except ValueError:\n+ pass\n+ def check_integer_split(self):\n+ a = arange(10)\n+ res = array_split(a,1)\n+ desired = [arange(10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,2)\n+ desired = [arange(5),arange(5,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,3)\n+ desired = [arange(4),arange(4,7),arange(7,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,4)\n+ desired = [arange(3),arange(3,6),arange(6,8),arange(8,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,5)\n+ desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,6)\n+ desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,9),\n+ arange(9,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,7)\n+ desired = [arange(2),arange(2,4),arange(4,6),arange(6,7),arange(7,8),\n+ arange(8,9), arange(9,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,8)\n+ desired = [arange(2),arange(2,4),arange(4,5),arange(5,6),arange(6,7),\n+ arange(7,8), arange(8,9), arange(9,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,9)\n+ desired = [arange(2),arange(2,3),arange(3,4),arange(4,5),arange(5,6),\n+ arange(6,7), arange(7,8), arange(8,9), arange(9,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,10)\n+ desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),\n+ arange(4,5),arange(5,6), arange(6,7), arange(7,8),\n+ arange(8,9), arange(9,10)]\n+ compare_results(res,desired)\n+\n+ res = array_split(a,11)\n+ desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),\n+ arange(4,5),arange(5,6), arange(6,7), arange(7,8),\n+ arange(8,9), arange(9,10),array([])]\n+ compare_results(res,desired)\n+ def check_integer_split_2D_rows(self):\n+ a = array([arange(10),arange(10)])\n+ res = array_split(a,3,axis=0)\n+ desired = [array([arange(10)]),array([arange(10)]),array([])]\n+ compare_results(res,desired)\n+ def check_integer_split_2D_cols(self):\n+ a = array([arange(10),arange(10)])\n+ res = array_split(a,3,axis=-1)\n+ desired = [array([arange(4),arange(4)]),\n+ array([arange(4,7),arange(4,7)]),\n+ array([arange(7,10),arange(7,10)])]\n+ compare_results(res,desired)\n+ def check_integer_split_2D_default(self):\n+ \"\"\" This will fail if we change default axis\n+ \"\"\"\n+ a = array([arange(10),arange(10)])\n+ res = array_split(a,3)\n+ desired = [array([arange(10)]),array([arange(10)]),array([])]\n+ compare_results(res,desired)\n+ #perhaps should check higher dimensions\n+\n+ def check_index_split_simple(self):\n+ a = arange(10)\n+ indices = [1,5,7]\n+ res = array_split(a,indices,axis=-1)\n+ desired = [arange(0,1),arange(1,5),arange(5,7),arange(7,10)]\n+ compare_results(res,desired)\n+\n+ def check_index_split_low_bound(self):\n+ a = arange(10)\n+ indices = [0,5,7]\n+ res = array_split(a,indices,axis=-1)\n+ desired = [array([]),arange(0,5),arange(5,7),arange(7,10)]\n+ compare_results(res,desired)\n+ def check_index_split_high_bound(self):\n+ a = arange(10)\n+ indices = [0,5,7,10,12]\n+ res = array_split(a,indices,axis=-1)\n+ desired = [array([]),arange(0,5),arange(5,7),arange(7,10),\n+ array([]),array([])]\n+ compare_results(res,desired)\n+ \n+class test_split(unittest.TestCase):\n+ \"\"\"* This function is essentially the same as array_split,\n+ except that it test if splitting will result in an\n+ equal split. Only test for this case.\n+ *\"\"\"\n+ def check_equal_split(self):\n+ a = arange(10)\n+ res = split(a,2)\n+ desired = [arange(5),arange(5,10)]\n+ compare_results(res,desired)\n+\n+ def check_unequal_split(self):\n+ a = arange(10) \n+ try:\n+ res = split(a,3)\n+ assert(0) # should raise an error\n+ except ValueError:\n+ pass\n+\n+class test_atleast_1d(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=map(atleast_1d,[a,b])\n+ desired = [array([1]),array([2])]\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1,2]); b = array([2,3]);\n+ res=map(atleast_1d,[a,b])\n+ desired = [array([1,2]),array([2,3])]\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ res=map(atleast_1d,[a,b])\n+ desired = [a,b]\n+ assert_array_equal(res,desired)\n+ def check_3D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ a = array([a,a]);b = array([b,b]);\n+ res=map(atleast_1d,[a,b])\n+ desired = [a,b]\n+ assert_array_equal(res,desired)\n+ def check_r1array(self):\n+ \"\"\" Test to make sure equivalent Travis O's r1array function\n+ \"\"\"\n+ assert(atleast_1d(3).shape == (1,))\n+ assert(atleast_1d(3j).shape == (1,))\n+ assert(atleast_1d(3L).shape == (1,))\n+ assert(atleast_1d(3.0).shape == (1,))\n+ assert(atleast_1d([[2,3],[4,5]]).shape == (2,2))\n+\n+class test_atleast_2d(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=map(atleast_2d,[a,b])\n+ desired = [array([[1]]),array([[2]])]\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1,2]); b = array([2,3]);\n+ res=map(atleast_2d,[a,b])\n+ desired = [array([[1,2]]),array([[2,3]])]\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ res=map(atleast_2d,[a,b])\n+ desired = [a,b]\n+ assert_array_equal(res,desired)\n+ def check_3D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ a = array([a,a]);b = array([b,b]);\n+ res=map(atleast_2d,[a,b])\n+ desired = [a,b]\n+ assert_array_equal(res,desired)\n+ def check_r2array(self):\n+ \"\"\" Test to make sure equivalent Travis O's r2array function\n+ \"\"\"\n+ assert(atleast_2d(3).shape == (1,1))\n+ assert(atleast_2d([3j,1]).shape == (1,2))\n+ assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2))\n+\n+class test_atleast_3d(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=map(atleast_3d,[a,b])\n+ desired = [array([[[1]]]),array([[[2]]])]\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1,2]); b = array([2,3]);\n+ res=map(atleast_3d,[a,b])\n+ desired = [array([[[1],[2]]]),array([[[2],[3]]])]\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ res=map(atleast_3d,[a,b])\n+ desired = [a[:,:,NewAxis],b[:,:,NewAxis]]\n+ assert_array_equal(res,desired)\n+ def check_3D_array(self):\n+ a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n+ a = array([a,a]);b = array([b,b]);\n+ res=map(atleast_3d,[a,b])\n+ desired = [a,b]\n+ assert_array_equal(res,desired)\n+\n+class test_hstack(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=hstack([a,b])\n+ desired = array([1,2])\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1]); b = array([2]);\n+ res=hstack([a,b])\n+ desired = array([1,2])\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1],[2]]); b = array([[1],[2]]);\n+ res=hstack([a,b])\n+ desired = array([[1,1],[2,2]])\n+ assert_array_equal(res,desired)\n+\n+class test_vstack(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=vstack([a,b])\n+ desired = array([[1],[2]])\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1]); b = array([2]);\n+ res=vstack([a,b])\n+ desired = array([[1],[2]])\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1],[2]]); b = array([[1],[2]]);\n+ res=vstack([a,b])\n+ desired = array([[1],[2],[1],[2]])\n+ assert_array_equal(res,desired)\n+ def check_2D_array2(self):\n+ a = array([1,2]); b = array([1,2]);\n+ res=vstack([a,b])\n+ desired = array([[1,2],[1,2]])\n+ assert_array_equal(res,desired)\n+\n+class test_dstack(unittest.TestCase):\n+ def check_0D_array(self):\n+ a = array(1); b = array(2);\n+ res=dstack([a,b])\n+ desired = array([[[1,2]]])\n+ assert_array_equal(res,desired)\n+ def check_1D_array(self):\n+ a = array([1]); b = array([2]);\n+ res=dstack([a,b])\n+ desired = array([[[1,2]]])\n+ assert_array_equal(res,desired)\n+ def check_2D_array(self):\n+ a = array([[1],[2]]); b = array([[1],[2]]);\n+ res=dstack([a,b])\n+ desired = array([[[1,1]],[[2,2,]]])\n+ assert_array_equal(res,desired)\n+ def check_2D_array2(self):\n+ a = array([1,2]); b = array([1,2]);\n+ res=dstack([a,b])\n+ desired = array([[[1,1],[2,2]]])\n+ assert_array_equal(res,desired)\n+\n+\"\"\" array_split has more comprehensive test of splitting.\n+ only do simple test on hsplit, vsplit, and dsplit\n+\"\"\"\n+class test_hsplit(unittest.TestCase):\n+ \"\"\" only testing for integer splits.\n+ \"\"\"\n+ def check_0D_array(self):\n+ a= array(1)\n+ try:\n+ hsplit(a,2)\n+ assert(0)\n+ except ValueError:\n+ pass\n+ def check_1D_array(self):\n+ a= array([1,2,3,4])\n+ res = hsplit(a,2)\n+ desired = [array([1,2]),array([3,4])]\n+ compare_results(res,desired)\n+ def check_2D_array(self):\n+ a= array([[1,2,3,4],\n+ [1,2,3,4]])\n+ res = hsplit(a,2)\n+ desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])]\n+ compare_results(res,desired)\n+\n+class test_vsplit(unittest.TestCase):\n+ \"\"\" only testing for integer splits.\n+ \"\"\"\n+ def check_1D_array(self):\n+ a= array([1,2,3,4])\n+ try:\n+ vsplit(a,2)\n+ assert(0)\n+ except ValueError:\n+ pass\n+ def check_2D_array(self):\n+ a= array([[1,2,3,4],\n+ [1,2,3,4]])\n+ res = vsplit(a,2)\n+ desired = [array([[1,2,3,4]]),array([[1,2,3,4]])]\n+ compare_results(res,desired)\n+\n+class test_dsplit(unittest.TestCase):\n+ \"\"\" only testing for integer splits.\n+ \"\"\"\n+ def check_2D_array(self):\n+ a= array([[1,2,3,4],\n+ [1,2,3,4]])\n+ try:\n+ dsplit(a,2)\n+ assert(0)\n+ except ValueError:\n+ pass\n+ def check_3D_array(self):\n+ a= array([[[1,2,3,4],\n+ [1,2,3,4]],\n+ [[1,2,3,4],\n+ [1,2,3,4]]])\n+ res = dsplit(a,2)\n+ desired = [array([[[1,2],[1,2]],[[1,2],[1,2]]]),\n+ array([[[3,4],[3,4]],[[3,4],[3,4]]])]\n+ compare_results(res,desired)\n+\n+class test_squeeze(unittest.TestCase):\n+ def check_basic(self):\n+ a = rand(20,10,10,1,1)\n+ b = rand(20,1,10,1,20)\n+ c = rand(1,1,20,10)\n+ assert_array_equal(squeeze(a),reshape(a,(20,10,10)))\n+ assert_array_equal(squeeze(b),reshape(b,(20,10,20)))\n+ assert_array_equal(squeeze(c),reshape(c,(20,10)))\n+ \n+# Utility\n+\n+def compare_results(res,desired):\n+ for i in range(len(desired)):\n+ assert_array_equal(res[i],desired[i])\n+\n+\n+#-----------------------------------------------------------------------------\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_array_split,'check_') )\n+ suites.append( unittest.makeSuite(test_split,'check_') )\n+ suites.append( unittest.makeSuite(test_atleast_1d,'check_') )\n+ suites.append( unittest.makeSuite(test_atleast_2d,'check_') )\n+ suites.append( unittest.makeSuite(test_atleast_3d,'check_') )\n+ suites.append( unittest.makeSuite(test_hstack,'check_') )\n+ suites.append( unittest.makeSuite(test_vstack,'check_') )\n+ suites.append( unittest.makeSuite(test_dstack,'check_') )\n+ suites.append( unittest.makeSuite(test_hsplit,'check_') ) \n+ suites.append( unittest.makeSuite(test_vsplit,'check_') )\n+ suites.append( unittest.makeSuite(test_dsplit,'check_') )\n+ suites.append( unittest.makeSuite(test_squeeze,'check_') )\n+\n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n", + "added_lines": 388, + "deleted_lines": 0, + "source_code": "# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.shape_base import *\n\n\nclass test_array_split(unittest.TestCase):\n def check_integer_0_split(self):\n a = arange(10)\n try:\n res = array_split(a,0)\n assert(0) # it should have thrown a value error\n except ValueError:\n pass\n def check_integer_split(self):\n a = arange(10)\n res = array_split(a,1)\n desired = [arange(10)]\n compare_results(res,desired)\n\n res = array_split(a,2)\n desired = [arange(5),arange(5,10)]\n compare_results(res,desired)\n\n res = array_split(a,3)\n desired = [arange(4),arange(4,7),arange(7,10)]\n compare_results(res,desired)\n\n res = array_split(a,4)\n desired = [arange(3),arange(3,6),arange(6,8),arange(8,10)]\n compare_results(res,desired)\n\n res = array_split(a,5)\n desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,10)]\n compare_results(res,desired)\n\n res = array_split(a,6)\n desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,9),\n arange(9,10)]\n compare_results(res,desired)\n\n res = array_split(a,7)\n desired = [arange(2),arange(2,4),arange(4,6),arange(6,7),arange(7,8),\n arange(8,9), arange(9,10)]\n compare_results(res,desired)\n\n res = array_split(a,8)\n desired = [arange(2),arange(2,4),arange(4,5),arange(5,6),arange(6,7),\n arange(7,8), arange(8,9), arange(9,10)]\n compare_results(res,desired)\n\n res = array_split(a,9)\n desired = [arange(2),arange(2,3),arange(3,4),arange(4,5),arange(5,6),\n arange(6,7), arange(7,8), arange(8,9), arange(9,10)]\n compare_results(res,desired)\n\n res = array_split(a,10)\n desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),\n arange(4,5),arange(5,6), arange(6,7), arange(7,8),\n arange(8,9), arange(9,10)]\n compare_results(res,desired)\n\n res = array_split(a,11)\n desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),\n arange(4,5),arange(5,6), arange(6,7), arange(7,8),\n arange(8,9), arange(9,10),array([])]\n compare_results(res,desired)\n def check_integer_split_2D_rows(self):\n a = array([arange(10),arange(10)])\n res = array_split(a,3,axis=0)\n desired = [array([arange(10)]),array([arange(10)]),array([])]\n compare_results(res,desired)\n def check_integer_split_2D_cols(self):\n a = array([arange(10),arange(10)])\n res = array_split(a,3,axis=-1)\n desired = [array([arange(4),arange(4)]),\n array([arange(4,7),arange(4,7)]),\n array([arange(7,10),arange(7,10)])]\n compare_results(res,desired)\n def check_integer_split_2D_default(self):\n \"\"\" This will fail if we change default axis\n \"\"\"\n a = array([arange(10),arange(10)])\n res = array_split(a,3)\n desired = [array([arange(10)]),array([arange(10)]),array([])]\n compare_results(res,desired)\n #perhaps should check higher dimensions\n\n def check_index_split_simple(self):\n a = arange(10)\n indices = [1,5,7]\n res = array_split(a,indices,axis=-1)\n desired = [arange(0,1),arange(1,5),arange(5,7),arange(7,10)]\n compare_results(res,desired)\n\n def check_index_split_low_bound(self):\n a = arange(10)\n indices = [0,5,7]\n res = array_split(a,indices,axis=-1)\n desired = [array([]),arange(0,5),arange(5,7),arange(7,10)]\n compare_results(res,desired)\n def check_index_split_high_bound(self):\n a = arange(10)\n indices = [0,5,7,10,12]\n res = array_split(a,indices,axis=-1)\n desired = [array([]),arange(0,5),arange(5,7),arange(7,10),\n array([]),array([])]\n compare_results(res,desired)\n \nclass test_split(unittest.TestCase):\n \"\"\"* This function is essentially the same as array_split,\n except that it test if splitting will result in an\n equal split. Only test for this case.\n *\"\"\"\n def check_equal_split(self):\n a = arange(10)\n res = split(a,2)\n desired = [arange(5),arange(5,10)]\n compare_results(res,desired)\n\n def check_unequal_split(self):\n a = arange(10) \n try:\n res = split(a,3)\n assert(0) # should raise an error\n except ValueError:\n pass\n\nclass test_atleast_1d(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=map(atleast_1d,[a,b])\n desired = [array([1]),array([2])]\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1,2]); b = array([2,3]);\n res=map(atleast_1d,[a,b])\n desired = [array([1,2]),array([2,3])]\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n res=map(atleast_1d,[a,b])\n desired = [a,b]\n assert_array_equal(res,desired)\n def check_3D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n a = array([a,a]);b = array([b,b]);\n res=map(atleast_1d,[a,b])\n desired = [a,b]\n assert_array_equal(res,desired)\n def check_r1array(self):\n \"\"\" Test to make sure equivalent Travis O's r1array function\n \"\"\"\n assert(atleast_1d(3).shape == (1,))\n assert(atleast_1d(3j).shape == (1,))\n assert(atleast_1d(3L).shape == (1,))\n assert(atleast_1d(3.0).shape == (1,))\n assert(atleast_1d([[2,3],[4,5]]).shape == (2,2))\n\nclass test_atleast_2d(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=map(atleast_2d,[a,b])\n desired = [array([[1]]),array([[2]])]\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1,2]); b = array([2,3]);\n res=map(atleast_2d,[a,b])\n desired = [array([[1,2]]),array([[2,3]])]\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n res=map(atleast_2d,[a,b])\n desired = [a,b]\n assert_array_equal(res,desired)\n def check_3D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n a = array([a,a]);b = array([b,b]);\n res=map(atleast_2d,[a,b])\n desired = [a,b]\n assert_array_equal(res,desired)\n def check_r2array(self):\n \"\"\" Test to make sure equivalent Travis O's r2array function\n \"\"\"\n assert(atleast_2d(3).shape == (1,1))\n assert(atleast_2d([3j,1]).shape == (1,2))\n assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2))\n\nclass test_atleast_3d(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=map(atleast_3d,[a,b])\n desired = [array([[[1]]]),array([[[2]]])]\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1,2]); b = array([2,3]);\n res=map(atleast_3d,[a,b])\n desired = [array([[[1],[2]]]),array([[[2],[3]]])]\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n res=map(atleast_3d,[a,b])\n desired = [a[:,:,NewAxis],b[:,:,NewAxis]]\n assert_array_equal(res,desired)\n def check_3D_array(self):\n a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);\n a = array([a,a]);b = array([b,b]);\n res=map(atleast_3d,[a,b])\n desired = [a,b]\n assert_array_equal(res,desired)\n\nclass test_hstack(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=hstack([a,b])\n desired = array([1,2])\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1]); b = array([2]);\n res=hstack([a,b])\n desired = array([1,2])\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1],[2]]); b = array([[1],[2]]);\n res=hstack([a,b])\n desired = array([[1,1],[2,2]])\n assert_array_equal(res,desired)\n\nclass test_vstack(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=vstack([a,b])\n desired = array([[1],[2]])\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1]); b = array([2]);\n res=vstack([a,b])\n desired = array([[1],[2]])\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1],[2]]); b = array([[1],[2]]);\n res=vstack([a,b])\n desired = array([[1],[2],[1],[2]])\n assert_array_equal(res,desired)\n def check_2D_array2(self):\n a = array([1,2]); b = array([1,2]);\n res=vstack([a,b])\n desired = array([[1,2],[1,2]])\n assert_array_equal(res,desired)\n\nclass test_dstack(unittest.TestCase):\n def check_0D_array(self):\n a = array(1); b = array(2);\n res=dstack([a,b])\n desired = array([[[1,2]]])\n assert_array_equal(res,desired)\n def check_1D_array(self):\n a = array([1]); b = array([2]);\n res=dstack([a,b])\n desired = array([[[1,2]]])\n assert_array_equal(res,desired)\n def check_2D_array(self):\n a = array([[1],[2]]); b = array([[1],[2]]);\n res=dstack([a,b])\n desired = array([[[1,1]],[[2,2,]]])\n assert_array_equal(res,desired)\n def check_2D_array2(self):\n a = array([1,2]); b = array([1,2]);\n res=dstack([a,b])\n desired = array([[[1,1],[2,2]]])\n assert_array_equal(res,desired)\n\n\"\"\" array_split has more comprehensive test of splitting.\n only do simple test on hsplit, vsplit, and dsplit\n\"\"\"\nclass test_hsplit(unittest.TestCase):\n \"\"\" only testing for integer splits.\n \"\"\"\n def check_0D_array(self):\n a= array(1)\n try:\n hsplit(a,2)\n assert(0)\n except ValueError:\n pass\n def check_1D_array(self):\n a= array([1,2,3,4])\n res = hsplit(a,2)\n desired = [array([1,2]),array([3,4])]\n compare_results(res,desired)\n def check_2D_array(self):\n a= array([[1,2,3,4],\n [1,2,3,4]])\n res = hsplit(a,2)\n desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])]\n compare_results(res,desired)\n\nclass test_vsplit(unittest.TestCase):\n \"\"\" only testing for integer splits.\n \"\"\"\n def check_1D_array(self):\n a= array([1,2,3,4])\n try:\n vsplit(a,2)\n assert(0)\n except ValueError:\n pass\n def check_2D_array(self):\n a= array([[1,2,3,4],\n [1,2,3,4]])\n res = vsplit(a,2)\n desired = [array([[1,2,3,4]]),array([[1,2,3,4]])]\n compare_results(res,desired)\n\nclass test_dsplit(unittest.TestCase):\n \"\"\" only testing for integer splits.\n \"\"\"\n def check_2D_array(self):\n a= array([[1,2,3,4],\n [1,2,3,4]])\n try:\n dsplit(a,2)\n assert(0)\n except ValueError:\n pass\n def check_3D_array(self):\n a= array([[[1,2,3,4],\n [1,2,3,4]],\n [[1,2,3,4],\n [1,2,3,4]]])\n res = dsplit(a,2)\n desired = [array([[[1,2],[1,2]],[[1,2],[1,2]]]),\n array([[[3,4],[3,4]],[[3,4],[3,4]]])]\n compare_results(res,desired)\n\nclass test_squeeze(unittest.TestCase):\n def check_basic(self):\n a = rand(20,10,10,1,1)\n b = rand(20,1,10,1,20)\n c = rand(1,1,20,10)\n assert_array_equal(squeeze(a),reshape(a,(20,10,10)))\n assert_array_equal(squeeze(b),reshape(b,(20,10,20)))\n assert_array_equal(squeeze(c),reshape(c,(20,10)))\n \n# Utility\n\ndef compare_results(res,desired):\n for i in range(len(desired)):\n assert_array_equal(res[i],desired[i])\n\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_array_split,'check_') )\n suites.append( unittest.makeSuite(test_split,'check_') )\n suites.append( unittest.makeSuite(test_atleast_1d,'check_') )\n suites.append( unittest.makeSuite(test_atleast_2d,'check_') )\n suites.append( unittest.makeSuite(test_atleast_3d,'check_') )\n suites.append( unittest.makeSuite(test_hstack,'check_') )\n suites.append( unittest.makeSuite(test_vstack,'check_') )\n suites.append( unittest.makeSuite(test_dstack,'check_') )\n suites.append( unittest.makeSuite(test_hsplit,'check_') ) \n suites.append( unittest.makeSuite(test_vsplit,'check_') )\n suites.append( unittest.makeSuite(test_dsplit,'check_') )\n suites.append( unittest.makeSuite(test_squeeze,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": null, + "methods": [ + { + "name": "check_integer_0_split", + "long_name": "check_integer_0_split( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 15, + "end_line": 21, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split", + "long_name": "check_integer_split( self )", + "filename": "test_shape_base.py", + "nloc": 43, + "complexity": 1, + "token_count": 637, + "parameters": [ + "self" + ], + "start_line": 22, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split_2D_rows", + "long_name": "check_integer_split_2D_rows( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 68, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split_2D_cols", + "long_name": "check_integer_split_2D_cols( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 96, + "parameters": [ + "self" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split_2D_default", + "long_name": "check_integer_split_2D_default( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_simple", + "long_name": "check_index_split_simple( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 70, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_low_bound", + "long_name": "check_index_split_low_bound( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_high_bound", + "long_name": "check_index_split_high_bound( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_equal_split", + "long_name": "check_equal_split( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_unequal_split", + "long_name": "check_unequal_split( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 128, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self" + ], + "start_line": 137, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 142, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 68, + "parameters": [ + "self" + ], + "start_line": 147, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3D_array", + "long_name": "check_3D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 152, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_r1array", + "long_name": "check_r1array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 91, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 58, + "parameters": [ + "self" + ], + "start_line": 168, + "end_line": 172, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 70, + "parameters": [ + "self" + ], + "start_line": 173, + "end_line": 177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 68, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3D_array", + "long_name": "check_3D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 183, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_r2array", + "long_name": "check_r2array( self )", + "filename": "test_shape_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 62, + "parameters": [ + "self" + ], + "start_line": 197, + "end_line": 201, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 202, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 82, + "parameters": [ + "self" + ], + "start_line": 207, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3D_array", + "long_name": "check_3D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 212, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 220, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 225, + "end_line": 229, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 230, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 242, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 73, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array2", + "long_name": "check_2D_array2( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 259, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 269, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array2", + "long_name": "check_2D_array2( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 63, + "parameters": [ + "self" + ], + "start_line": 274, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 286, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self" + ], + "start_line": 293, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 82, + "parameters": [ + "self" + ], + "start_line": 298, + "end_line": 303, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 308, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 78, + "parameters": [ + "self" + ], + "start_line": 315, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 325, + "end_line": 332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_3D_array", + "long_name": "check_3D_array( self )", + "filename": "test_shape_base.py", + "nloc": 9, + "complexity": 1, + "token_count": 138, + "parameters": [ + "self" + ], + "start_line": 333, + "end_line": 341, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 103, + "parameters": [ + "self" + ], + "start_line": 344, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "compare_results", + "long_name": "compare_results( res , desired )", + "filename": "test_shape_base.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "res", + "desired" + ], + "start_line": 354, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_shape_base.py", + "nloc": 17, + "complexity": 2, + "token_count": 182, + "parameters": [ + "level" + ], + "start_line": 361, + "end_line": 378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 380, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "check_2D_array2", + "long_name": "check_2D_array2( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_shape_base.py", + "nloc": 17, + "complexity": 2, + "token_count": 182, + "parameters": [ + "level" + ], + "start_line": 361, + "end_line": 378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "check_integer_split_2D_rows", + "long_name": "check_integer_split_2D_rows( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 68, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 79, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 380, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "check_0D_array", + "long_name": "check_0D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self" + ], + "start_line": 137, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_low_bound", + "long_name": "check_index_split_low_bound( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_equal_split", + "long_name": "check_equal_split( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_simple", + "long_name": "check_index_split_simple( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 70, + "parameters": [ + "self" + ], + "start_line": 96, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_integer_0_split", + "long_name": "check_integer_0_split( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 15, + "end_line": 21, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_3D_array", + "long_name": "check_3D_array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 90, + "parameters": [ + "self" + ], + "start_line": 152, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split_2D_default", + "long_name": "check_integer_split_2D_default( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 103, + "parameters": [ + "self" + ], + "start_line": 344, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split_2D_cols", + "long_name": "check_integer_split_2D_cols( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 96, + "parameters": [ + "self" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_2D_array", + "long_name": "check_2D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 68, + "parameters": [ + "self" + ], + "start_line": 147, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_r1array", + "long_name": "check_r1array( self )", + "filename": "test_shape_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 91, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "compare_results", + "long_name": "compare_results( res , desired )", + "filename": "test_shape_base.py", + "nloc": 3, + "complexity": 2, + "token_count": 30, + "parameters": [ + "res", + "desired" + ], + "start_line": 354, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "check_r2array", + "long_name": "check_r2array( self )", + "filename": "test_shape_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 189, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_1D_array", + "long_name": "check_1D_array( self )", + "filename": "test_shape_base.py", + "nloc": 5, + "complexity": 1, + "token_count": 66, + "parameters": [ + "self" + ], + "start_line": 142, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_unequal_split", + "long_name": "check_unequal_split( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 128, + "end_line": 134, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_index_split_high_bound", + "long_name": "check_index_split_high_bound( self )", + "filename": "test_shape_base.py", + "nloc": 7, + "complexity": 1, + "token_count": 85, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 115, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_integer_split", + "long_name": "check_integer_split( self )", + "filename": "test_shape_base.py", + "nloc": 43, + "complexity": 1, + "token_count": 637, + "parameters": [ + "self" + ], + "start_line": 22, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 53, + "top_nesting_level": 1 + } + ], + "nloc": 340, + "complexity": 53, + "token_count": 3879, + "diff_parsed": { + "added": [ + "# only for short term testing", + "import sys", + "sys.path.insert(0,'../..')", + "", + "import unittest", + "from scipy_base.testing import assert_array_equal, assert_equal, rand", + "from scipy_base.testing import assert_almost_equal, assert_array_almost_equal", + "", + "from scipy_base import *", + "# This won't be needed when we get scipy_base finished.", + "from scipy_base.shape_base import *", + "", + "", + "class test_array_split(unittest.TestCase):", + " def check_integer_0_split(self):", + " a = arange(10)", + " try:", + " res = array_split(a,0)", + " assert(0) # it should have thrown a value error", + " except ValueError:", + " pass", + " def check_integer_split(self):", + " a = arange(10)", + " res = array_split(a,1)", + " desired = [arange(10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,2)", + " desired = [arange(5),arange(5,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,3)", + " desired = [arange(4),arange(4,7),arange(7,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,4)", + " desired = [arange(3),arange(3,6),arange(6,8),arange(8,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,5)", + " desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,6)", + " desired = [arange(2),arange(2,4),arange(4,6),arange(6,8),arange(8,9),", + " arange(9,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,7)", + " desired = [arange(2),arange(2,4),arange(4,6),arange(6,7),arange(7,8),", + " arange(8,9), arange(9,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,8)", + " desired = [arange(2),arange(2,4),arange(4,5),arange(5,6),arange(6,7),", + " arange(7,8), arange(8,9), arange(9,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,9)", + " desired = [arange(2),arange(2,3),arange(3,4),arange(4,5),arange(5,6),", + " arange(6,7), arange(7,8), arange(8,9), arange(9,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,10)", + " desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),", + " arange(4,5),arange(5,6), arange(6,7), arange(7,8),", + " arange(8,9), arange(9,10)]", + " compare_results(res,desired)", + "", + " res = array_split(a,11)", + " desired = [arange(1),arange(1,2),arange(2,3),arange(3,4),", + " arange(4,5),arange(5,6), arange(6,7), arange(7,8),", + " arange(8,9), arange(9,10),array([])]", + " compare_results(res,desired)", + " def check_integer_split_2D_rows(self):", + " a = array([arange(10),arange(10)])", + " res = array_split(a,3,axis=0)", + " desired = [array([arange(10)]),array([arange(10)]),array([])]", + " compare_results(res,desired)", + " def check_integer_split_2D_cols(self):", + " a = array([arange(10),arange(10)])", + " res = array_split(a,3,axis=-1)", + " desired = [array([arange(4),arange(4)]),", + " array([arange(4,7),arange(4,7)]),", + " array([arange(7,10),arange(7,10)])]", + " compare_results(res,desired)", + " def check_integer_split_2D_default(self):", + " \"\"\" This will fail if we change default axis", + " \"\"\"", + " a = array([arange(10),arange(10)])", + " res = array_split(a,3)", + " desired = [array([arange(10)]),array([arange(10)]),array([])]", + " compare_results(res,desired)", + " #perhaps should check higher dimensions", + "", + " def check_index_split_simple(self):", + " a = arange(10)", + " indices = [1,5,7]", + " res = array_split(a,indices,axis=-1)", + " desired = [arange(0,1),arange(1,5),arange(5,7),arange(7,10)]", + " compare_results(res,desired)", + "", + " def check_index_split_low_bound(self):", + " a = arange(10)", + " indices = [0,5,7]", + " res = array_split(a,indices,axis=-1)", + " desired = [array([]),arange(0,5),arange(5,7),arange(7,10)]", + " compare_results(res,desired)", + " def check_index_split_high_bound(self):", + " a = arange(10)", + " indices = [0,5,7,10,12]", + " res = array_split(a,indices,axis=-1)", + " desired = [array([]),arange(0,5),arange(5,7),arange(7,10),", + " array([]),array([])]", + " compare_results(res,desired)", + "", + "class test_split(unittest.TestCase):", + " \"\"\"* This function is essentially the same as array_split,", + " except that it test if splitting will result in an", + " equal split. Only test for this case.", + " *\"\"\"", + " def check_equal_split(self):", + " a = arange(10)", + " res = split(a,2)", + " desired = [arange(5),arange(5,10)]", + " compare_results(res,desired)", + "", + " def check_unequal_split(self):", + " a = arange(10)", + " try:", + " res = split(a,3)", + " assert(0) # should raise an error", + " except ValueError:", + " pass", + "", + "class test_atleast_1d(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=map(atleast_1d,[a,b])", + " desired = [array([1]),array([2])]", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1,2]); b = array([2,3]);", + " res=map(atleast_1d,[a,b])", + " desired = [array([1,2]),array([2,3])]", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " res=map(atleast_1d,[a,b])", + " desired = [a,b]", + " assert_array_equal(res,desired)", + " def check_3D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " a = array([a,a]);b = array([b,b]);", + " res=map(atleast_1d,[a,b])", + " desired = [a,b]", + " assert_array_equal(res,desired)", + " def check_r1array(self):", + " \"\"\" Test to make sure equivalent Travis O's r1array function", + " \"\"\"", + " assert(atleast_1d(3).shape == (1,))", + " assert(atleast_1d(3j).shape == (1,))", + " assert(atleast_1d(3L).shape == (1,))", + " assert(atleast_1d(3.0).shape == (1,))", + " assert(atleast_1d([[2,3],[4,5]]).shape == (2,2))", + "", + "class test_atleast_2d(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=map(atleast_2d,[a,b])", + " desired = [array([[1]]),array([[2]])]", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1,2]); b = array([2,3]);", + " res=map(atleast_2d,[a,b])", + " desired = [array([[1,2]]),array([[2,3]])]", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " res=map(atleast_2d,[a,b])", + " desired = [a,b]", + " assert_array_equal(res,desired)", + " def check_3D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " a = array([a,a]);b = array([b,b]);", + " res=map(atleast_2d,[a,b])", + " desired = [a,b]", + " assert_array_equal(res,desired)", + " def check_r2array(self):", + " \"\"\" Test to make sure equivalent Travis O's r2array function", + " \"\"\"", + " assert(atleast_2d(3).shape == (1,1))", + " assert(atleast_2d([3j,1]).shape == (1,2))", + " assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2))", + "", + "class test_atleast_3d(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=map(atleast_3d,[a,b])", + " desired = [array([[[1]]]),array([[[2]]])]", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1,2]); b = array([2,3]);", + " res=map(atleast_3d,[a,b])", + " desired = [array([[[1],[2]]]),array([[[2],[3]]])]", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " res=map(atleast_3d,[a,b])", + " desired = [a[:,:,NewAxis],b[:,:,NewAxis]]", + " assert_array_equal(res,desired)", + " def check_3D_array(self):", + " a = array([[1,2],[1,2]]); b = array([[2,3],[2,3]]);", + " a = array([a,a]);b = array([b,b]);", + " res=map(atleast_3d,[a,b])", + " desired = [a,b]", + " assert_array_equal(res,desired)", + "", + "class test_hstack(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=hstack([a,b])", + " desired = array([1,2])", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1]); b = array([2]);", + " res=hstack([a,b])", + " desired = array([1,2])", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1],[2]]); b = array([[1],[2]]);", + " res=hstack([a,b])", + " desired = array([[1,1],[2,2]])", + " assert_array_equal(res,desired)", + "", + "class test_vstack(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=vstack([a,b])", + " desired = array([[1],[2]])", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1]); b = array([2]);", + " res=vstack([a,b])", + " desired = array([[1],[2]])", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1],[2]]); b = array([[1],[2]]);", + " res=vstack([a,b])", + " desired = array([[1],[2],[1],[2]])", + " assert_array_equal(res,desired)", + " def check_2D_array2(self):", + " a = array([1,2]); b = array([1,2]);", + " res=vstack([a,b])", + " desired = array([[1,2],[1,2]])", + " assert_array_equal(res,desired)", + "", + "class test_dstack(unittest.TestCase):", + " def check_0D_array(self):", + " a = array(1); b = array(2);", + " res=dstack([a,b])", + " desired = array([[[1,2]]])", + " assert_array_equal(res,desired)", + " def check_1D_array(self):", + " a = array([1]); b = array([2]);", + " res=dstack([a,b])", + " desired = array([[[1,2]]])", + " assert_array_equal(res,desired)", + " def check_2D_array(self):", + " a = array([[1],[2]]); b = array([[1],[2]]);", + " res=dstack([a,b])", + " desired = array([[[1,1]],[[2,2,]]])", + " assert_array_equal(res,desired)", + " def check_2D_array2(self):", + " a = array([1,2]); b = array([1,2]);", + " res=dstack([a,b])", + " desired = array([[[1,1],[2,2]]])", + " assert_array_equal(res,desired)", + "", + "\"\"\" array_split has more comprehensive test of splitting.", + " only do simple test on hsplit, vsplit, and dsplit", + "\"\"\"", + "class test_hsplit(unittest.TestCase):", + " \"\"\" only testing for integer splits.", + " \"\"\"", + " def check_0D_array(self):", + " a= array(1)", + " try:", + " hsplit(a,2)", + " assert(0)", + " except ValueError:", + " pass", + " def check_1D_array(self):", + " a= array([1,2,3,4])", + " res = hsplit(a,2)", + " desired = [array([1,2]),array([3,4])]", + " compare_results(res,desired)", + " def check_2D_array(self):", + " a= array([[1,2,3,4],", + " [1,2,3,4]])", + " res = hsplit(a,2)", + " desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])]", + " compare_results(res,desired)", + "", + "class test_vsplit(unittest.TestCase):", + " \"\"\" only testing for integer splits.", + " \"\"\"", + " def check_1D_array(self):", + " a= array([1,2,3,4])", + " try:", + " vsplit(a,2)", + " assert(0)", + " except ValueError:", + " pass", + " def check_2D_array(self):", + " a= array([[1,2,3,4],", + " [1,2,3,4]])", + " res = vsplit(a,2)", + " desired = [array([[1,2,3,4]]),array([[1,2,3,4]])]", + " compare_results(res,desired)", + "", + "class test_dsplit(unittest.TestCase):", + " \"\"\" only testing for integer splits.", + " \"\"\"", + " def check_2D_array(self):", + " a= array([[1,2,3,4],", + " [1,2,3,4]])", + " try:", + " dsplit(a,2)", + " assert(0)", + " except ValueError:", + " pass", + " def check_3D_array(self):", + " a= array([[[1,2,3,4],", + " [1,2,3,4]],", + " [[1,2,3,4],", + " [1,2,3,4]]])", + " res = dsplit(a,2)", + " desired = [array([[[1,2],[1,2]],[[1,2],[1,2]]]),", + " array([[[3,4],[3,4]],[[3,4],[3,4]]])]", + " compare_results(res,desired)", + "", + "class test_squeeze(unittest.TestCase):", + " def check_basic(self):", + " a = rand(20,10,10,1,1)", + " b = rand(20,1,10,1,20)", + " c = rand(1,1,20,10)", + " assert_array_equal(squeeze(a),reshape(a,(20,10,10)))", + " assert_array_equal(squeeze(b),reshape(b,(20,10,20)))", + " assert_array_equal(squeeze(c),reshape(c,(20,10)))", + "", + "# Utility", + "", + "def compare_results(res,desired):", + " for i in range(len(desired)):", + " assert_array_equal(res[i],desired[i])", + "", + "", + "#-----------------------------------------------------------------------------", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_array_split,'check_') )", + " suites.append( unittest.makeSuite(test_split,'check_') )", + " suites.append( unittest.makeSuite(test_atleast_1d,'check_') )", + " suites.append( unittest.makeSuite(test_atleast_2d,'check_') )", + " suites.append( unittest.makeSuite(test_atleast_3d,'check_') )", + " suites.append( unittest.makeSuite(test_hstack,'check_') )", + " suites.append( unittest.makeSuite(test_vstack,'check_') )", + " suites.append( unittest.makeSuite(test_dstack,'check_') )", + " suites.append( unittest.makeSuite(test_hsplit,'check_') )", + " suites.append( unittest.makeSuite(test_vsplit,'check_') )", + " suites.append( unittest.makeSuite(test_dsplit,'check_') )", + " suites.append( unittest.makeSuite(test_squeeze,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/tests/test_type_check.py", + "filename": "test_type_check.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,220 @@\n+# only for short term testing\n+import sys\n+sys.path.insert(0,'../..')\n+\n+import unittest\n+from scipy_base.testing import assert_array_equal, assert_equal, rand\n+from scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n+\n+from scipy_base import *\n+# This won't be needed when we get scipy_base finished.\n+from scipy_base.type_check import *\n+ \n+class test_isscalar(unittest.TestCase):\n+ def check_basic(self):\n+ assert(isscalar(3))\n+ assert(not isscalar([3]))\n+ assert(not isscalar((3,)))\n+ assert(isscalar(3j))\n+ assert(isscalar(10L))\n+ assert(isscalar(4.0))\n+\n+class test_real(unittest.TestCase):\n+ def check_real(self):\n+ y = rand(10,)\n+ assert_array_equal(y,real(y))\n+\n+ def check_cmplx(self):\n+ y = rand(10,)+1j*rand(10,)\n+ assert_array_equal(y.real,real(y))\n+\n+class test_imag(unittest.TestCase):\n+ def check_real(self):\n+ y = rand(10,)\n+ assert_array_equal(0,imag(y))\n+\n+ def check_cmplx(self):\n+ y = rand(10,)+1j*rand(10,)\n+ assert_array_equal(y.imag,imag(y))\n+\n+class test_iscomplex(unittest.TestCase):\n+ def check_fail(self):\n+ z = array([-1,0,1])\n+ res = iscomplex(z)\n+ assert(not sometrue(res))\n+ def check_pass(self):\n+ z = array([-1j,1,0])\n+ res = iscomplex(z)\n+ assert_array_equal(res,[1,0,0])\n+\n+class test_isreal(unittest.TestCase):\n+ def check_pass(self):\n+ z = array([-1,0,1j])\n+ res = isreal(z)\n+ assert_array_equal(res,[1,1,0])\n+ def check_fail(self):\n+ z = array([-1j,1,0])\n+ res = isreal(z)\n+ assert_array_equal(res,[0,1,1])\n+\n+class test_array_iscomplex(unittest.TestCase):\n+ def check_basic(self):\n+ z = array([-1,0,1])\n+ assert(not array_iscomplex(z))\n+ z = array([-1j,0,-1])\n+ assert(array_iscomplex(z))\n+\n+class test_array_isreal(unittest.TestCase):\n+ def check_basic(self):\n+ z = array([-1,0,1])\n+ assert(array_isreal(z))\n+ z = array([-1j,0,-1])\n+ assert(not array_isreal(z))\n+\n+class test_isnan(unittest.TestCase):\n+ def check_goodvalues(self):\n+ z = array((-1.,0.,1.))\n+ res = isnan(z) == 0\n+ assert(alltrue(res)) \n+ def check_posinf(self): \n+ assert(isnan(array((1.,))/0.) == 0)\n+ def check_neginf(self): \n+ assert(isnan(array((-1.,))/0.) == 0)\n+ def check_ind(self): \n+ assert(isnan(array((0.,))/0.) == 1)\n+ #def check_qnan(self): log(-1) return pi*j now\n+ # assert(isnan(log(-1.)) == 1)\n+ def check_integer(self):\n+ assert(isnan(1) == 0)\n+ def check_complex(self):\n+ assert(isnan(1+1j) == 0)\n+ def check_complex1(self):\n+ assert(isnan(array(0+0j)/0.) == 1)\n+ \n+class test_isfinite(unittest.TestCase):\n+ def check_goodvalues(self):\n+ z = array((-1.,0.,1.))\n+ res = isfinite(z) == 1\n+ assert(alltrue(res)) \n+ def check_posinf(self): \n+ assert(isfinite(array((1.,))/0.) == 0)\n+ def check_neginf(self): \n+ assert(isfinite(array((-1.,))/0.) == 0)\n+ def check_ind(self): \n+ assert(isfinite(array((0.,))/0.) == 0)\n+ #def check_qnan(self): \n+ # assert(isfinite(log(-1.)) == 0)\n+ def check_integer(self):\n+ assert(isfinite(1) == 1)\n+ def check_complex(self):\n+ assert(isfinite(1+1j) == 1)\n+ def check_complex1(self):\n+ assert(isfinite(array(1+1j)/0.) == 0)\n+ \n+class test_isinf(unittest.TestCase):\n+ def check_goodvalues(self):\n+ z = array((-1.,0.,1.))\n+ res = isinf(z) == 0\n+ assert(alltrue(res)) \n+ def check_posinf(self): \n+ assert(isinf(array((1.,))/0.) == 1)\n+ def check_posinf_scalar(self): \n+ assert(isinf(array(1.,)/0.) == 1)\n+ def check_neginf(self): \n+ assert(isinf(array((-1.,))/0.) == 1)\n+ def check_neginf_scalar(self): \n+ assert(isinf(array(-1.)/0.) == 1)\n+ def check_ind(self): \n+ assert(isinf(array((0.,))/0.) == 0)\n+ #def check_qnan(self): \n+ # assert(isinf(log(-1.)) == 0)\n+ # assert(isnan(log(-1.)) == 1)\n+\n+class test_isposinf(unittest.TestCase):\n+ def check_generic(self):\n+ vals = isposinf(array((-1.,0,1))/0.)\n+ assert(vals[0] == 0)\n+ assert(vals[1] == 0)\n+ assert(vals[2] == 1)\n+\n+class test_isneginf(unittest.TestCase):\n+ def check_generic(self):\n+ vals = isneginf(array((-1.,0,1))/0.)\n+ assert(vals[0] == 1)\n+ assert(vals[1] == 0)\n+ assert(vals[2] == 0)\n+\n+class test_nan_to_num(unittest.TestCase):\n+ def check_generic(self):\n+ vals = nan_to_num(array((-1.,0,1))/0.)\n+ assert(vals[0] < -1e10 and isfinite(vals[0]))\n+ assert(vals[1] == 0)\n+ assert(vals[2] > 1e10 and isfinite(vals[2]))\n+ def check_integer(self):\n+ vals = nan_to_num(1)\n+ assert(vals == 1)\n+ def check_complex_good(self):\n+ vals = nan_to_num(1+1j)\n+ assert(vals == 1+1j)\n+ def check_complex_bad(self):\n+ v = 1+1j\n+ v += array(0+1.j)/0.\n+ vals = nan_to_num(v)\n+ # !! This is actually (unexpectedly) zero\n+ assert(vals.imag > 1e10 and isfinite(vals))\n+ def check_complex_bad2(self):\n+ v = 1+1j\n+ v += array(-1+1.j)/0.\n+ vals = nan_to_num(v)\n+ assert(isfinite(vals)) \n+ #assert(vals.imag > 1e10 and isfinite(vals)) \n+ # !! This is actually (unexpectedly) positive\n+ # !! inf. Comment out for now, and see if it\n+ # !! changes\n+ #assert(vals.real < -1e10 and isfinite(vals)) \n+\n+\n+class test_real_if_close(unittest.TestCase):\n+ def check_basic(self):\n+ a = rand(10)\n+ b = real_if_close(a+1e-15j)\n+ assert(array_isreal(b))\n+ assert_array_equal(a,b)\n+ b = real_if_close(a+1e-7j)\n+ assert(array_iscomplex(b))\n+ b = real_if_close(a+1e-7j,tol=1e-6)\n+ assert(array_isreal(b))\n+\n+\n+#-----------------------------------------------------------------------------\n+\n+def test_suite(level=1):\n+ suites = []\n+ if level > 0:\n+ suites.append( unittest.makeSuite(test_isscalar,'check_') )\n+ suites.append( unittest.makeSuite(test_real_if_close,'check_') )\n+ suites.append( unittest.makeSuite(test_real,'check_') )\n+ suites.append( unittest.makeSuite(test_imag,'check_') )\n+ suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )\n+ suites.append( unittest.makeSuite(test_array_isreal,'check_') ) \n+ suites.append( unittest.makeSuite(test_iscomplex,'check_') )\n+ suites.append( unittest.makeSuite(test_isreal,'check_') ) \n+ suites.append( unittest.makeSuite(test_isnan,'check_') )\n+ suites.append( unittest.makeSuite(test_isfinite,'check_') )\n+ suites.append( unittest.makeSuite(test_isinf,'check_') )\n+ suites.append( unittest.makeSuite(test_isposinf,'check_') ) \n+ suites.append( unittest.makeSuite(test_isneginf,'check_') )\n+ suites.append( unittest.makeSuite(test_nan_to_num,'check_') )\n+\n+ total_suite = unittest.TestSuite(suites)\n+ return total_suite\n+\n+def test(level=10):\n+ all_tests = test_suite(level)\n+ runner = unittest.TextTestRunner()\n+ runner.run(all_tests)\n+ return runner\n+\n+\n+if __name__ == \"__main__\":\n+ test()\n", + "added_lines": 220, + "deleted_lines": 0, + "source_code": "# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.type_check import *\n \nclass test_isscalar(unittest.TestCase):\n def check_basic(self):\n assert(isscalar(3))\n assert(not isscalar([3]))\n assert(not isscalar((3,)))\n assert(isscalar(3j))\n assert(isscalar(10L))\n assert(isscalar(4.0))\n\nclass test_real(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(y,real(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.real,real(y))\n\nclass test_imag(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(0,imag(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.imag,imag(y))\n\nclass test_iscomplex(unittest.TestCase):\n def check_fail(self):\n z = array([-1,0,1])\n res = iscomplex(z)\n assert(not sometrue(res))\n def check_pass(self):\n z = array([-1j,1,0])\n res = iscomplex(z)\n assert_array_equal(res,[1,0,0])\n\nclass test_isreal(unittest.TestCase):\n def check_pass(self):\n z = array([-1,0,1j])\n res = isreal(z)\n assert_array_equal(res,[1,1,0])\n def check_fail(self):\n z = array([-1j,1,0])\n res = isreal(z)\n assert_array_equal(res,[0,1,1])\n\nclass test_array_iscomplex(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(not array_iscomplex(z))\n z = array([-1j,0,-1])\n assert(array_iscomplex(z))\n\nclass test_array_isreal(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(array_isreal(z))\n z = array([-1j,0,-1])\n assert(not array_isreal(z))\n\nclass test_isnan(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isnan(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isnan(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isnan(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isnan(array((0.,))/0.) == 1)\n #def check_qnan(self): log(-1) return pi*j now\n # assert(isnan(log(-1.)) == 1)\n def check_integer(self):\n assert(isnan(1) == 0)\n def check_complex(self):\n assert(isnan(1+1j) == 0)\n def check_complex1(self):\n assert(isnan(array(0+0j)/0.) == 1)\n \nclass test_isfinite(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isfinite(z) == 1\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isfinite(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isfinite(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isfinite(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isfinite(log(-1.)) == 0)\n def check_integer(self):\n assert(isfinite(1) == 1)\n def check_complex(self):\n assert(isfinite(1+1j) == 1)\n def check_complex1(self):\n assert(isfinite(array(1+1j)/0.) == 0)\n \nclass test_isinf(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isinf(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isinf(array((1.,))/0.) == 1)\n def check_posinf_scalar(self): \n assert(isinf(array(1.,)/0.) == 1)\n def check_neginf(self): \n assert(isinf(array((-1.,))/0.) == 1)\n def check_neginf_scalar(self): \n assert(isinf(array(-1.)/0.) == 1)\n def check_ind(self): \n assert(isinf(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isinf(log(-1.)) == 0)\n # assert(isnan(log(-1.)) == 1)\n\nclass test_isposinf(unittest.TestCase):\n def check_generic(self):\n vals = isposinf(array((-1.,0,1))/0.)\n assert(vals[0] == 0)\n assert(vals[1] == 0)\n assert(vals[2] == 1)\n\nclass test_isneginf(unittest.TestCase):\n def check_generic(self):\n vals = isneginf(array((-1.,0,1))/0.)\n assert(vals[0] == 1)\n assert(vals[1] == 0)\n assert(vals[2] == 0)\n\nclass test_nan_to_num(unittest.TestCase):\n def check_generic(self):\n vals = nan_to_num(array((-1.,0,1))/0.)\n assert(vals[0] < -1e10 and isfinite(vals[0]))\n assert(vals[1] == 0)\n assert(vals[2] > 1e10 and isfinite(vals[2]))\n def check_integer(self):\n vals = nan_to_num(1)\n assert(vals == 1)\n def check_complex_good(self):\n vals = nan_to_num(1+1j)\n assert(vals == 1+1j)\n def check_complex_bad(self):\n v = 1+1j\n v += array(0+1.j)/0.\n vals = nan_to_num(v)\n # !! This is actually (unexpectedly) zero\n assert(vals.imag > 1e10 and isfinite(vals))\n def check_complex_bad2(self):\n v = 1+1j\n v += array(-1+1.j)/0.\n vals = nan_to_num(v)\n assert(isfinite(vals)) \n #assert(vals.imag > 1e10 and isfinite(vals)) \n # !! This is actually (unexpectedly) positive\n # !! inf. Comment out for now, and see if it\n # !! changes\n #assert(vals.real < -1e10 and isfinite(vals)) \n\n\nclass test_real_if_close(unittest.TestCase):\n def check_basic(self):\n a = rand(10)\n b = real_if_close(a+1e-15j)\n assert(array_isreal(b))\n assert_array_equal(a,b)\n b = real_if_close(a+1e-7j)\n assert(array_iscomplex(b))\n b = real_if_close(a+1e-7j,tol=1e-6)\n assert(array_isreal(b))\n\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_isscalar,'check_') )\n suites.append( unittest.makeSuite(test_real_if_close,'check_') )\n suites.append( unittest.makeSuite(test_real,'check_') )\n suites.append( unittest.makeSuite(test_imag,'check_') )\n suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_array_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_isnan,'check_') )\n suites.append( unittest.makeSuite(test_isfinite,'check_') )\n suites.append( unittest.makeSuite(test_isinf,'check_') )\n suites.append( unittest.makeSuite(test_isposinf,'check_') ) \n suites.append( unittest.makeSuite(test_isneginf,'check_') )\n suites.append( unittest.makeSuite(test_nan_to_num,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": null, + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 7, + "complexity": 1, + "token_count": 56, + "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_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 23, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 51, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 95, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 99, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 107, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 111, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 115, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 119, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_posinf_scalar", + "long_name": "check_posinf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 123, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf_scalar", + "long_name": "check_neginf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 141, + "end_line": 145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 153, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_good", + "long_name": "check_complex_good( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 156, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad", + "long_name": "check_complex_bad( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 2, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad2", + "long_name": "check_complex_bad2( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 9, + "complexity": 1, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_type_check.py", + "nloc": 19, + "complexity": 2, + "token_count": 208, + "parameters": [ + "level" + ], + "start_line": 191, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 212, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_type_check.py", + "nloc": 19, + "complexity": 2, + "token_count": 208, + "parameters": [ + "level" + ], + "start_line": 191, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 212, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "check_complex_bad2", + "long_name": "check_complex_bad2( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_posinf_scalar", + "long_name": "check_posinf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 23, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 7, + "complexity": 1, + "token_count": 56, + "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_neginf_scalar", + "long_name": "check_neginf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad", + "long_name": "check_complex_bad( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 2, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_complex_good", + "long_name": "check_complex_good( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 156, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + } + ], + "nloc": 178, + "complexity": 45, + "token_count": 1672, + "diff_parsed": { + "added": [ + "# only for short term testing", + "import sys", + "sys.path.insert(0,'../..')", + "", + "import unittest", + "from scipy_base.testing import assert_array_equal, assert_equal, rand", + "from scipy_base.testing import assert_almost_equal, assert_array_almost_equal", + "", + "from scipy_base import *", + "# This won't be needed when we get scipy_base finished.", + "from scipy_base.type_check import *", + "", + "class test_isscalar(unittest.TestCase):", + " def check_basic(self):", + " assert(isscalar(3))", + " assert(not isscalar([3]))", + " assert(not isscalar((3,)))", + " assert(isscalar(3j))", + " assert(isscalar(10L))", + " assert(isscalar(4.0))", + "", + "class test_real(unittest.TestCase):", + " def check_real(self):", + " y = rand(10,)", + " assert_array_equal(y,real(y))", + "", + " def check_cmplx(self):", + " y = rand(10,)+1j*rand(10,)", + " assert_array_equal(y.real,real(y))", + "", + "class test_imag(unittest.TestCase):", + " def check_real(self):", + " y = rand(10,)", + " assert_array_equal(0,imag(y))", + "", + " def check_cmplx(self):", + " y = rand(10,)+1j*rand(10,)", + " assert_array_equal(y.imag,imag(y))", + "", + "class test_iscomplex(unittest.TestCase):", + " def check_fail(self):", + " z = array([-1,0,1])", + " res = iscomplex(z)", + " assert(not sometrue(res))", + " def check_pass(self):", + " z = array([-1j,1,0])", + " res = iscomplex(z)", + " assert_array_equal(res,[1,0,0])", + "", + "class test_isreal(unittest.TestCase):", + " def check_pass(self):", + " z = array([-1,0,1j])", + " res = isreal(z)", + " assert_array_equal(res,[1,1,0])", + " def check_fail(self):", + " z = array([-1j,1,0])", + " res = isreal(z)", + " assert_array_equal(res,[0,1,1])", + "", + "class test_array_iscomplex(unittest.TestCase):", + " def check_basic(self):", + " z = array([-1,0,1])", + " assert(not array_iscomplex(z))", + " z = array([-1j,0,-1])", + " assert(array_iscomplex(z))", + "", + "class test_array_isreal(unittest.TestCase):", + " def check_basic(self):", + " z = array([-1,0,1])", + " assert(array_isreal(z))", + " z = array([-1j,0,-1])", + " assert(not array_isreal(z))", + "", + "class test_isnan(unittest.TestCase):", + " def check_goodvalues(self):", + " z = array((-1.,0.,1.))", + " res = isnan(z) == 0", + " assert(alltrue(res))", + " def check_posinf(self):", + " assert(isnan(array((1.,))/0.) == 0)", + " def check_neginf(self):", + " assert(isnan(array((-1.,))/0.) == 0)", + " def check_ind(self):", + " assert(isnan(array((0.,))/0.) == 1)", + " #def check_qnan(self): log(-1) return pi*j now", + " # assert(isnan(log(-1.)) == 1)", + " def check_integer(self):", + " assert(isnan(1) == 0)", + " def check_complex(self):", + " assert(isnan(1+1j) == 0)", + " def check_complex1(self):", + " assert(isnan(array(0+0j)/0.) == 1)", + "", + "class test_isfinite(unittest.TestCase):", + " def check_goodvalues(self):", + " z = array((-1.,0.,1.))", + " res = isfinite(z) == 1", + " assert(alltrue(res))", + " def check_posinf(self):", + " assert(isfinite(array((1.,))/0.) == 0)", + " def check_neginf(self):", + " assert(isfinite(array((-1.,))/0.) == 0)", + " def check_ind(self):", + " assert(isfinite(array((0.,))/0.) == 0)", + " #def check_qnan(self):", + " # assert(isfinite(log(-1.)) == 0)", + " def check_integer(self):", + " assert(isfinite(1) == 1)", + " def check_complex(self):", + " assert(isfinite(1+1j) == 1)", + " def check_complex1(self):", + " assert(isfinite(array(1+1j)/0.) == 0)", + "", + "class test_isinf(unittest.TestCase):", + " def check_goodvalues(self):", + " z = array((-1.,0.,1.))", + " res = isinf(z) == 0", + " assert(alltrue(res))", + " def check_posinf(self):", + " assert(isinf(array((1.,))/0.) == 1)", + " def check_posinf_scalar(self):", + " assert(isinf(array(1.,)/0.) == 1)", + " def check_neginf(self):", + " assert(isinf(array((-1.,))/0.) == 1)", + " def check_neginf_scalar(self):", + " assert(isinf(array(-1.)/0.) == 1)", + " def check_ind(self):", + " assert(isinf(array((0.,))/0.) == 0)", + " #def check_qnan(self):", + " # assert(isinf(log(-1.)) == 0)", + " # assert(isnan(log(-1.)) == 1)", + "", + "class test_isposinf(unittest.TestCase):", + " def check_generic(self):", + " vals = isposinf(array((-1.,0,1))/0.)", + " assert(vals[0] == 0)", + " assert(vals[1] == 0)", + " assert(vals[2] == 1)", + "", + "class test_isneginf(unittest.TestCase):", + " def check_generic(self):", + " vals = isneginf(array((-1.,0,1))/0.)", + " assert(vals[0] == 1)", + " assert(vals[1] == 0)", + " assert(vals[2] == 0)", + "", + "class test_nan_to_num(unittest.TestCase):", + " def check_generic(self):", + " vals = nan_to_num(array((-1.,0,1))/0.)", + " assert(vals[0] < -1e10 and isfinite(vals[0]))", + " assert(vals[1] == 0)", + " assert(vals[2] > 1e10 and isfinite(vals[2]))", + " def check_integer(self):", + " vals = nan_to_num(1)", + " assert(vals == 1)", + " def check_complex_good(self):", + " vals = nan_to_num(1+1j)", + " assert(vals == 1+1j)", + " def check_complex_bad(self):", + " v = 1+1j", + " v += array(0+1.j)/0.", + " vals = nan_to_num(v)", + " # !! This is actually (unexpectedly) zero", + " assert(vals.imag > 1e10 and isfinite(vals))", + " def check_complex_bad2(self):", + " v = 1+1j", + " v += array(-1+1.j)/0.", + " vals = nan_to_num(v)", + " assert(isfinite(vals))", + " #assert(vals.imag > 1e10 and isfinite(vals))", + " # !! This is actually (unexpectedly) positive", + " # !! inf. Comment out for now, and see if it", + " # !! changes", + " #assert(vals.real < -1e10 and isfinite(vals))", + "", + "", + "class test_real_if_close(unittest.TestCase):", + " def check_basic(self):", + " a = rand(10)", + " b = real_if_close(a+1e-15j)", + " assert(array_isreal(b))", + " assert_array_equal(a,b)", + " b = real_if_close(a+1e-7j)", + " assert(array_iscomplex(b))", + " b = real_if_close(a+1e-7j,tol=1e-6)", + " assert(array_isreal(b))", + "", + "", + "#-----------------------------------------------------------------------------", + "", + "def test_suite(level=1):", + " suites = []", + " if level > 0:", + " suites.append( unittest.makeSuite(test_isscalar,'check_') )", + " suites.append( unittest.makeSuite(test_real_if_close,'check_') )", + " suites.append( unittest.makeSuite(test_real,'check_') )", + " suites.append( unittest.makeSuite(test_imag,'check_') )", + " suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )", + " suites.append( unittest.makeSuite(test_array_isreal,'check_') )", + " suites.append( unittest.makeSuite(test_iscomplex,'check_') )", + " suites.append( unittest.makeSuite(test_isreal,'check_') )", + " suites.append( unittest.makeSuite(test_isnan,'check_') )", + " suites.append( unittest.makeSuite(test_isfinite,'check_') )", + " suites.append( unittest.makeSuite(test_isinf,'check_') )", + " suites.append( unittest.makeSuite(test_isposinf,'check_') )", + " suites.append( unittest.makeSuite(test_isneginf,'check_') )", + " suites.append( unittest.makeSuite(test_nan_to_num,'check_') )", + "", + " total_suite = unittest.TestSuite(suites)", + " return total_suite", + "", + "def test(level=10):", + " all_tests = test_suite(level)", + " runner = unittest.TextTestRunner()", + " runner.run(all_tests)", + " return runner", + "", + "", + "if __name__ == \"__main__\":", + " test()" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "53b06c38badce57edc8d23d4ba8049cc5efc55df", + "msg": "added import of rand", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T14:20:51+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T14:20:51+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "44869d64fc324e72f50bf1f99b58eec9f56db0cb" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/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_base/tests/test_index_tricks.py", + "new_path": "scipy_base/tests/test_index_tricks.py", + "filename": "test_index_tricks.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,5 +1,5 @@\n import unittest\n-from scipy_base.testing import assert_array_equal, assert_equal\n+from scipy_base.testing import assert_array_equal, assert_equal, rand\n from scipy_base.testing import assert_almost_equal, assert_array_almost_equal\n from scipy_base import *\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal\nfrom scipy_base import *\n\nclass test_grid(unittest.TestCase):\n def check_basic(self):\n a = mgrid[-1:1:10j]\n b = mgrid[-1:1:0.1]\n assert(a.shape == (10,))\n assert(b.shape == (20,))\n assert(a[0] == -1)\n assert_almost_equal(a[-1],1)\n assert(b[0] == -1)\n assert_almost_equal(b[1]-b[0],0.1,11)\n assert_almost_equal(b[-1],b[0]+19*0.1,11)\n assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n\n def check_nd(self):\n c = mgrid[-1:1:10j,-2:2:10j]\n d = mgrid[-1:1:0.1,-2:2:0.2]\n assert(c.shape == (2,10,10))\n assert(d.shape == (2,20,20))\n assert_array_equal(c[0][0,:],-ones(10,'d'))\n assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n\nclass test_concatenator(unittest.TestCase):\n def check_1d(self):\n assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n b = ones(5)\n c = r_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n c = c_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n\n def check_2d(self):\n b = rand(5,5)\n c = rand(5,5)\n d = c_[b,c] # append columns\n assert(d.shape == (5,10))\n assert_array_equal(d[:,:5],b)\n assert_array_equal(d[:,5:],c)\n d = r_[b,c]\n assert(d.shape == (10,5))\n assert_array_equal(d[:5,:],b)\n assert_array_equal(d[5:,:],c)\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_grid,'check_') )\n suites.append( unittest.makeSuite(test_concatenator,'check_') )\n \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()", + "source_code_before": "import unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal\nfrom scipy_base import *\n\nclass test_grid(unittest.TestCase):\n def check_basic(self):\n a = mgrid[-1:1:10j]\n b = mgrid[-1:1:0.1]\n assert(a.shape == (10,))\n assert(b.shape == (20,))\n assert(a[0] == -1)\n assert_almost_equal(a[-1],1)\n assert(b[0] == -1)\n assert_almost_equal(b[1]-b[0],0.1,11)\n assert_almost_equal(b[-1],b[0]+19*0.1,11)\n assert_almost_equal(a[1]-a[0],2.0/9.0,11)\n\n def check_nd(self):\n c = mgrid[-1:1:10j,-2:2:10j]\n d = mgrid[-1:1:0.1,-2:2:0.2]\n assert(c.shape == (2,10,10))\n assert(d.shape == (2,20,20))\n assert_array_equal(c[0][0,:],-ones(10,'d'))\n assert_array_equal(c[1][:,0],-2*ones(10,'d'))\n assert_array_almost_equal(c[0][-1,:],ones(10,'d'),11)\n assert_array_almost_equal(c[1][:,-1],2*ones(10,'d'),11)\n assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)\n assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)\n\nclass test_concatenator(unittest.TestCase):\n def check_1d(self):\n assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))\n b = ones(5)\n c = r_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n c = c_[b,0,0,b]\n assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1])\n\n def check_2d(self):\n b = rand(5,5)\n c = rand(5,5)\n d = c_[b,c] # append columns\n assert(d.shape == (5,10))\n assert_array_equal(d[:,:5],b)\n assert_array_equal(d[:,5:],c)\n d = r_[b,c]\n assert(d.shape == (10,5))\n assert_array_equal(d[:5,:],b)\n assert_array_equal(d[5:,:],c)\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_grid,'check_') )\n suites.append( unittest.makeSuite(test_concatenator,'check_') )\n \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()", + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 1, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 54, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 63, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 142, + "parameters": [ + "self" + ], + "start_line": 7, + "end_line": 17, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_nd", + "long_name": "check_nd( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 227, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_1d", + "long_name": "check_1d( self )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 1, + "token_count": 129, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_2d", + "long_name": "check_2d( self )", + "filename": "test_index_tricks.py", + "nloc": 11, + "complexity": 1, + "token_count": 109, + "parameters": [ + "self" + ], + "start_line": 40, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_index_tricks.py", + "nloc": 7, + "complexity": 2, + "token_count": 52, + "parameters": [ + "level" + ], + "start_line": 54, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_index_tricks.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 63, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 60, + "complexity": 7, + "token_count": 741, + "diff_parsed": { + "added": [ + "from scipy_base.testing import assert_array_equal, assert_equal, rand" + ], + "deleted": [ + "from scipy_base.testing import assert_array_equal, assert_equal" + ] + } + } + ] + }, + { + "hash": "a01f9c196e7fb50ceb537939dc4984449e635348", + "msg": "test() was ignoring level argument", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T16:20:27+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T16:20:27+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "53b06c38badce57edc8d23d4ba8049cc5efc55df" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/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": "weave/__init__.py", + "new_path": "weave/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -24,7 +24,7 @@\n def test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n- runner.run(test_suite())\n+ runner.run(test_suite(level))\n return runner\n \n def test_suite(level=1):\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\" compiler provides several tools:\n\n 1. inline() -- a function for including C/C++ code within Python\n 2. blitz() -- a function for compiling Numeric expressions to C++\n 3. ext_tools-- a module that helps construct C/C++ extension modules.\n 4. accelerate -- a module that inline accelerates Python functions\n\"\"\"\n\ntry:\n from blitz_tools import blitz\nexcept ImportError:\n pass # Numeric wasn't available \n \nfrom inline_tools import inline\nimport ext_tools\nfrom ext_tools import ext_module, ext_function\ntry:\n from accelerate_tools import accelerate\nexcept:\n pass\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite(level))\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy.weave\n this_mod = scipy.weave\n return scipy_base.testing.harvest_test_suites(this_mod,level=level)\n", + "source_code_before": "\"\"\" compiler provides several tools:\n\n 1. inline() -- a function for including C/C++ code within Python\n 2. blitz() -- a function for compiling Numeric expressions to C++\n 3. ext_tools-- a module that helps construct C/C++ extension modules.\n 4. accelerate -- a module that inline accelerates Python functions\n\"\"\"\n\ntry:\n from blitz_tools import blitz\nexcept ImportError:\n pass # Numeric wasn't available \n \nfrom inline_tools import inline\nimport ext_tools\nfrom ext_tools import ext_module, ext_function\ntry:\n from accelerate_tools import accelerate\nexcept:\n pass\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy.weave\n this_mod = scipy.weave\n return scipy_base.testing.harvest_test_suites(this_mod,level=level)\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "level" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 33, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 33, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "level" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "nloc": 28, + "complexity": 2, + "token_count": 94, + "diff_parsed": { + "added": [ + " runner.run(test_suite(level))" + ], + "deleted": [ + " runner.run(test_suite())" + ] + } + } + ] + }, + { + "hash": "694e465f0c311bf87ec5ca565fe67622a0d4496b", + "msg": "isnan was returning arrays from scalars. Now it returns scalars for scalar inputs", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T18:32:23+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T18:32:23+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "a01f9c196e7fb50ceb537939dc4984449e635348" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 0, + "insertions": 2, + "lines": 2, + "files": 1, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": "scipy_base/type_check.py", + "new_path": "scipy_base/type_check.py", + "filename": "type_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -86,6 +86,8 @@ def isnan(val):\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n+ if isscalar(val):\n+ results = results[0]\n return results\n \n def isposinf(val):\n", + "added_lines": 2, + "deleted_lines": 0, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n# stuff. Perhaps move to cephes in the future??\nfrom ieee_754 import PINF,MINF,NAN\n\n__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntoChar = lambda x: Numeric.array(x, Numeric.Character)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef array_iscomplex(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef array_isreal(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\ndef isnan(val):\n # fast, but apparently not portable (according to notes by Tim Peters)\n #return val != val\n # very slow -- should really use cephes methods or *something* different\n import ieee_754\n vals = ravel(val)\n if array_iscomplex(vals):\n r = array(map(ieee_754.isnan,real(vals))) \n i = array(map(ieee_754.isnan,imag(vals)))\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n if isscalar(val):\n results = results[0]\n return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == MINF\n \ndef isinf(val):\n return Numeric.logical_or(isposinf(val),isneginf(val))\n\ndef isfinite(val):\n vals = asarray(val)\n if array_iscomplex(vals):\n r = isfinite(real(vals))\n i = isfinite(imag(vals))\n results = Numeric.logical_and(r,i)\n else: \n fin = Numeric.logical_not(isinf(val))\n an = Numeric.logical_not(isnan(val))\n results = Numeric.logical_and(fin,an)\n return results \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n# stuff. Perhaps move to cephes in the future??\nfrom ieee_754 import PINF,MINF,NAN\n\n__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntoChar = lambda x: Numeric.array(x, Numeric.Character)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef array_iscomplex(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef array_isreal(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\ndef isnan(val):\n # fast, but apparently not portable (according to notes by Tim Peters)\n #return val != val\n # very slow -- should really use cephes methods or *something* different\n import ieee_754\n vals = ravel(val)\n if array_iscomplex(vals):\n r = array(map(ieee_754.isnan,real(vals))) \n i = array(map(ieee_754.isnan,imag(vals)))\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == MINF\n \ndef isinf(val):\n return Numeric.logical_or(isposinf(val),isneginf(val))\n\ndef isfinite(val):\n vals = asarray(val)\n if array_iscomplex(vals):\n r = isfinite(real(vals))\n i = isfinite(imag(vals))\n results = Numeric.logical_and(r,i)\n else: \n fin = Numeric.logical_not(isinf(val))\n an = Numeric.logical_not(isnan(val))\n results = Numeric.logical_and(fin,an)\n return results \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 12, + "complexity": 3, + "token_count": 90, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 98, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 106, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 117, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 142, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 164, + "end_line": 167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 175, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 188, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 192, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 10, + "complexity": 2, + "token_count": 78, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 91, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 99, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 101, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 104, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 115, + "end_line": 136, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 140, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 162, + "end_line": 165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 173, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 186, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 190, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 12, + "complexity": 3, + "token_count": 90, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + } + ], + "nloc": 142, + "complexity": 30, + "token_count": 1130, + "diff_parsed": { + "added": [ + " if isscalar(val):", + " results = results[0]" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "db8bb3424741a0486653e63d8cee49212c1cc65c", + "msg": "Moved isnan and friends from cephes to special. Made comparison functions return UBYTES. Added Complex comparison functions which work on real parts.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-03T20:25:53+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T20:25:53+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "694e465f0c311bf87ec5ca565fe67622a0d4496b" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 177, + "insertions": 1548, + "lines": 1725, + "files": 15, + "dmm_unit_size": 0.7010463378176383, + "dmm_unit_complexity": 0.8236173393124065, + "dmm_unit_interfacing": 0.5620328849028401, + "modified_files": [ + { + "old_path": "scipy_base/__init__.py", + "new_path": "scipy_base/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -12,13 +12,17 @@\n from function_base import *\n from shape_base import *\n from matrix_base import *\n+from transform_base import *\n \n from polynomial import *\n from scimath import *\n \n # needs fastumath\n-Inf = inf = Numeric.array(1e308)**10\n-NaN = nan = Numeric.array(0.0) / Numeric.array(0.0)\n+Inf = inf = fastumath.PINF\n+try:\n+ NaN = nan = fastumath.NAN\n+except AttributeError:\n+ NAN = nan = array(0.0)/array(0.0)\n \n \n #---- testing ----#\n@@ -33,9 +37,8 @@ def test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n- # ieee_754 gets tested in the type_check module.\n # testing is the module that actually does all the testing...\n- ignore = ['ieee_754','testing']\n+ ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n \n", + "added_lines": 7, + "deleted_lines": 4, + "source_code": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\n#from utility import *\n#from convenience import *\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\nfrom transform_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NaN = nan = fastumath.NAN\nexcept AttributeError:\n NAN = nan = array(0.0)/array(0.0)\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "source_code_before": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\n#from utility import *\n#from convenience import *\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = Numeric.array(1e308)**10\nNaN = nan = Numeric.array(0.0) / Numeric.array(0.0)\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # ieee_754 gets tested in the type_check module.\n # testing is the module that actually does all the testing...\n ignore = ['ieee_754','testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 36, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 40, + "parameters": [ + "level" + ], + "start_line": 32, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 36, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "nloc": 29, + "complexity": 2, + "token_count": 144, + "diff_parsed": { + "added": [ + "from transform_base import *", + "Inf = inf = fastumath.PINF", + "try:", + " NaN = nan = fastumath.NAN", + "except AttributeError:", + " NAN = nan = array(0.0)/array(0.0)", + " ignore = ['testing']" + ], + "deleted": [ + "Inf = inf = Numeric.array(1e308)**10", + "NaN = nan = Numeric.array(0.0) / Numeric.array(0.0)", + " # ieee_754 gets tested in the type_check module.", + " ignore = ['ieee_754','testing']" + ] + } + }, + { + "old_path": null, + "new_path": "scipy_base/convenience.py", + "filename": "convenience.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,520 @@\n+\"\"\"Contains basic routines of common interest. Always imported first.\n+ Basically MLab minus the LinearAlgebra-dependent functions.\n+\n+ But max is changed to amax (array max)\n+ and min is changed to amin (array min)\n+ so that the builtin max and min are still available.\n+\"\"\"\n+\n+\n+__all__ = ['logspace','linspace','round','any','all','fix','mod','fftshift',\n+ 'ifftshift','fftfreq','cont_ft','toeplitz','hankel','real','imag',\n+ 'iscomplex','isreal','iscomplexobj','isrealobj','isposinf',\n+ 'isneginf','nan_to_num','eye','tri','diag','fliplr','flipud',\n+ 'rot90','tril','triu','amax','amin','ptp','cumsum','prod','cumprod',\n+ 'diff','squeeze','angle','unwrap','real_if_close',\n+ 'sort_complex']\n+\n+import Numeric\n+\n+def logspace(start,stop,num=50,endpoint=1):\n+ \"\"\"Evenly spaced samples on a logarithmic scale.\n+\n+ Return num evenly spaced samples from 10**start to 10**stop. If\n+ endpoint=1 then last sample is 10**stop.\n+ \"\"\"\n+ if endpoint:\n+ step = (stop-start)/float((num-1))\n+ y = Numeric.arange(0,num) * step + start\n+ else:\n+ step = (stop-start)/float(num)\n+ y = Numeric.arange(0,num) * step + start\n+ return Numeric.power(10.0,y)\n+\n+def linspace(start,stop,num=50,endpoint=1,retstep=0):\n+ \"\"\"Evenly spaced samples.\n+ \n+ Return num evenly spaced samples from start to stop. If endpoint=1 then\n+ last sample is stop. If retstep is 1 then return the step value used.\n+ \"\"\"\n+ if endpoint:\n+ step = (stop-start)/float((num-1))\n+ y = Numeric.arange(0,num) * step + start \n+ else:\n+ step = (stop-start)/float(num)\n+ y = Numeric.arange(0,num) * step + start\n+ if retstep:\n+ return y, step\n+ else:\n+ return y\n+\n+#def round(arr):\n+# return Numeric.floor(arr+0.5)\n+round = Numeric.around\n+any = Numeric.sometrue\n+all = Numeric.alltrue\n+\n+def fix(x):\n+ \"\"\"Round x to nearest integer towards zero.\n+ \"\"\"\n+ x = Numeric.asarray(x)\n+ y = Numeric.floor(x)\n+ return Numeric.where(x<0,y+1,y)\n+\n+def mod(x,y):\n+ \"\"\"x - y*floor(x/y)\n+ \n+ For numeric arrays, x % y has the same sign as x while\n+ mod(x,y) has the same sign as y.\n+ \"\"\"\n+ return x - y*Numeric.floor(x*1.0/y)\n+\n+def fftshift(x,axes=None):\n+ \"\"\"Shift the result of an FFT operation.\n+\n+ Return a shifted version of x (useful for obtaining centered spectra).\n+ This function swaps \"half-spaces\" for all axes listed (defaults to all)\n+ \"\"\"\n+ ndim = len(x.shape)\n+ if axes == None:\n+ axes = range(ndim)\n+ y = x\n+ for k in axes:\n+ N = x.shape[k]\n+ p2 = int(Numeric.ceil(N/2.0))\n+ mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n+ y = Numeric.take(y,mylist,k)\n+ return y\n+\n+def ifftshift(x,axes=None):\n+ \"\"\"Reverse the effect of fftshift.\n+ \"\"\"\n+ ndim = len(x.shape)\n+ if axes == None:\n+ axes = range(ndim)\n+ y = x\n+ for k in axes:\n+ N = x.shape[k]\n+ p2 = int(Numeric.floor(N/2.0))\n+ mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n+ y = Numeric.take(y,mylist,k)\n+ return y\n+\n+def fftfreq(N,sample=1.0):\n+ \"\"\"FFT sample frequencies\n+ \n+ Return the frequency bins in cycles/unit (with zero at the start) given a\n+ window length N and a sample spacing.\n+ \"\"\"\n+ N = int(N)\n+ sample = float(sample)\n+ return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n+\n+def cont_ft(gn,fr,delta=1.0,n=None):\n+ \"\"\"Compute the (scaled) DFT of gn at frequencies fr.\n+\n+ If the gn are alias-free samples of a continuous time function then the\n+ correct value for the spacing, delta, will give the properly scaled,\n+ continuous Fourier spectrum.\n+\n+ The DFT is obtained when delta=1.0\n+ \"\"\"\n+ if n is None:\n+ n = Numeric.arange(len(gn))\n+ dT = delta\n+ trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n+ return dT*Numeric.dot(trans_kernel,gn)\n+\n+def toeplitz(c,r=None):\n+ \"\"\"Construct a toeplitz matrix (i.e. a matrix with constant diagonals).\n+\n+ Description:\n+\n+ toeplitz(c,r) is a non-symmetric Toeplitz matrix with c as its first\n+ column and r as its first row.\n+\n+ toeplitz(c) is a symmetric (Hermitian) Toeplitz matrix (r=c). \n+\n+ See also: hankel\n+ \"\"\"\n+ if isscalar(c) or isscalar(r):\n+ return c \n+ if r is None:\n+ r = c\n+ r[0] = Numeric.conjugate(r[0])\n+ c = Numeric.conjugate(c)\n+ r,c = map(Numeric.asarray,(r,c))\n+ r,c = map(Numeric.ravel,(r,c))\n+ rN,cN = map(len,(r,c))\n+ if r[0] != c[0]:\n+ print \"Warning: column and row values don't agree; column value used.\"\n+ vals = r_[r[rN-1:0:-1], c]\n+ cols = grid[0:cN]\n+ rows = grid[rN:0:-1]\n+ indx = cols[:,Numeric.NewAxis]*Numeric.ones((1,rN)) + \\\n+ rows[Numeric.NewAxis,:]*Numeric.ones((cN,1)) - 1\n+ return Numeric.take(vals, indx)\n+\n+\n+def hankel(c,r=None):\n+ \"\"\"Construct a hankel matrix (i.e. matrix with constant anti-diagonals).\n+\n+ Description:\n+\n+ hankel(c,r) is a Hankel matrix whose first column is c and whose\n+ last row is r.\n+\n+ hankel(c) is a square Hankel matrix whose first column is C.\n+ Elements below the first anti-diagonal are zero.\n+\n+ See also: toeplitz\n+ \"\"\"\n+ if isscalar(c) or isscalar(r):\n+ return c \n+ if r is None:\n+ r = Numeric.zeros(len(c))\n+ elif r[0] != c[-1]:\n+ print \"Warning: column and row values don't agree; column value used.\"\n+ r,c = map(Numeric.asarray,(r,c))\n+ r,c = map(Numeric.ravel,(r,c))\n+ rN,cN = map(len,(r,c))\n+ vals = r_[c, r[1:rN]]\n+ cols = grid[1:cN+1]\n+ rows = grid[0:rN]\n+ indx = cols[:,Numeric.NewAxis]*Numeric.ones((1,rN)) + \\\n+ rows[Numeric.NewAxis,:]*Numeric.ones((cN,1)) - 1\n+ return Numeric.take(vals, indx)\n+\n+\n+def real(val):\n+ aval = asarray(val)\n+ if aval.typecode() in ['F', 'D']:\n+ return aval.real\n+ else:\n+ return aval\n+\n+def imag(val):\n+ aval = asarray(val)\n+ if aval.typecode() in ['F', 'D']:\n+ return aval.imag\n+ else:\n+ return array(0,aval.typecode())*aval\n+\n+def iscomplex(x):\n+ return imag(x) != Numeric.zeros(asarray(x).shape)\n+\n+def isreal(x):\n+ return imag(x) == Numeric.zeros(asarray(x).shape)\n+\n+def iscomplexobj(x):\n+ return asarray(x).typecode() in ['F', 'D']\n+\n+def isrealobj(x):\n+ return not asarray(x).typecode() in ['F', 'D']\n+\n+def isposinf(val):\n+ # complex not handled currently (and potentially ambiguous)\n+ return Numeric.logical_and(isinf(val),val > 0)\n+\n+def isneginf(val):\n+ # complex not handled currently (and potentially ambiguous)\n+ return Numeric.logical_and(isinf(val),val < 0)\n+ \n+def nan_to_num(x):\n+ # mapping:\n+ # NaN -> 0\n+ # Inf -> scipy.limits.double_max\n+ # -Inf -> scipy.limits.double_min\n+ # complex not handled currently\n+ import limits\n+ try:\n+ t = x.typecode()\n+ except AttributeError:\n+ t = type(x)\n+ if t in [ComplexType,'F','D']: \n+ y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n+ else: \n+ x = Numeric.asarray(x)\n+ are_inf = isposinf(x)\n+ are_neg_inf = isneginf(x)\n+ are_nan = isnan(x)\n+ choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n+ y = Numeric.choose(choose_array,\n+ (x,scipy.limits.double_min, 0., scipy.limits.double_max))\n+ return y\n+\n+# These are from Numeric\n+from Numeric import *\n+import Numeric\n+import Matrix\n+from utility import isscalar\n+from fastumath import *\n+\n+\n+# Elementary matrices\n+\n+# zeros is from matrixmodule in C\n+# ones is from Numeric.py\n+\n+\n+def eye(N, M=None, k=0, typecode=None):\n+ \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the \n+ k-th diagonal is all ones, and everything else is zeros.\n+ \"\"\"\n+ if M is None: M = N\n+ if type(M) == type('d'): \n+ typecode = M\n+ M = N\n+ m = equal(subtract.outer(arange(N), arange(M)),-k)\n+ if typecode is None:\n+ return m\n+ else:\n+ return m.astype(typecode)\n+\n+def tri(N, M=None, k=0, typecode=None):\n+ \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all\n+ the diagonals starting from lower left corner up to the k-th are all ones.\n+ \"\"\"\n+ if M is None: M = N\n+ if type(M) == type('d'): \n+ typecode = M\n+ M = N\n+ m = greater_equal(subtract.outer(arange(N), arange(M)),-k)\n+ if typecode is None:\n+ return m\n+ else:\n+ return m.astype(typecode)\n+ \n+# matrix manipulation\n+\n+def diag(v, k=0):\n+ \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or\n+ returns a matrix with v as the k-th diagonal if v is a vector.\n+ \"\"\"\n+ v = asarray(v)\n+ s = v.shape\n+ if len(s)==1:\n+ n = s[0]+abs(k)\n+ if k > 0:\n+ v = concatenate((zeros(k, v.typecode()),v))\n+ elif k < 0:\n+ v = concatenate((v,zeros(-k, v.typecode())))\n+ return eye(n, k=k)*v\n+ elif len(s)==2:\n+ v = add.reduce(eye(s[0], s[1], k=k)*v)\n+ if k > 0: return v[k:]\n+ elif k < 0: return v[:k]\n+ else: return v\n+ else:\n+ raise ValueError, \"Input must be 1- or 2-D.\"\n+ \n+def fliplr(m):\n+ \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and\n+ columns flipped in the left/right direction. Only works with 2-D\n+ arrays.\n+ \"\"\"\n+ m = asarray(m)\n+ if len(m.shape) != 2:\n+ raise ValueError, \"Input must be 2-D.\"\n+ return m[:, ::-1]\n+\n+def flipud(m):\n+ \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and\n+ rows flipped in the up/down direction. Only works with 2-D arrays.\n+ \"\"\"\n+ m = asarray(m)\n+ if len(m.shape) != 2:\n+ raise ValueError, \"Input must be 2-D.\"\n+ return m[::-1]\n+ \n+# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n+\n+def rot90(m, k=1):\n+ \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees\n+ in the counterclockwise direction.\n+ \"\"\"\n+ m = asarray(m)\n+ if len(m.shape) != 2:\n+ raise ValueError, \"Input must be 2-D.\"\n+ k = k % 4\n+ if k == 0: return m\n+ elif k == 1: return transpose(fliplr(m))\n+ elif k == 2: return fliplr(flipud(m))\n+ else: return fliplr(transpose(m)) # k==3\n+\n+def tril(m, k=0):\n+ \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of\n+ m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n+ diagonal.\n+ \"\"\"\n+ svsp = m.spacesaver()\n+ m = asarray(m,savespace=1)\n+ out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m\n+ out.savespace(svsp)\n+ return out\n+\n+def triu(m, k=0):\n+ \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of\n+ m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n+ diagonal.\n+ \"\"\"\n+ svsp = m.spacesaver()\n+ m = asarray(m,savespace=1)\n+ out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m\n+ out.savespace(svsp)\n+ return out\n+\n+# Data analysis\n+\n+# Basic operations\n+def amax(m,axis=-1):\n+ \"\"\"Returns the maximum of m along dimension axis. \n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else:\n+ m = asarray(m)\n+ return maximum.reduce(m,axis)\n+\n+def amin(m,axis=-1):\n+ \"\"\"Returns the minimum of m along dimension axis.\n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else: \n+ m = asarray(m)\n+ return minimum.reduce(m,axis)\n+\n+# Actually from Basis, but it fits in so naturally here...\n+\n+def ptp(m,axis=-1):\n+ \"\"\"Returns the maximum - minimum along the the given dimension\n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else:\n+ m = asarray(m)\n+ return amax(m,axis)-amin(m,axis)\n+\n+def cumsum(m,axis=-1):\n+ \"\"\"Returns the cumulative sum of the elements along the given axis\n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else:\n+ m = asarray(m)\n+ return add.accumulate(m,axis)\n+\n+def prod(m,axis=-1):\n+ \"\"\"Returns the product of the elements along the given axis\n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else:\n+ m = asarray(m)\n+ return multiply.reduce(m,axis)\n+\n+def cumprod(m,axis=-1):\n+ \"\"\"Returns the cumulative product of the elments along the given axis\n+ \"\"\"\n+ if axis is None:\n+ m = ravel(m)\n+ axis = 0\n+ else:\n+ m = asarray(m)\n+ return multiply.accumulate(m,axis)\n+\n+def diff(x, n=1,axis=-1):\n+ \"\"\"Calculates the nth order, discrete difference along given axis.\n+ \"\"\"\n+ x = asarray(x)\n+ nd = len(x.shape)\n+ slice1 = [slice(None)]*nd\n+ slice2 = [slice(None)]*nd\n+ slice1[axis] = slice(1,None)\n+ slice2[axis] = slice(None,-1)\n+ if n > 1:\n+ return diff(x[slice1]-x[slice2], n-1, axis=axis)\n+ else:\n+ return x[slice1]-x[slice2]\n+\n+def squeeze(a):\n+ \"Returns a with any ones from the shape of a removed\"\n+ a = asarray(a)\n+ b = asarray(a.shape)\n+ return reshape (a, tuple (compress (not_equal (b, 1), b)))\n+\n+def angle(z,deg=0):\n+ \"\"\"Return the angle of complex argument z.\"\"\"\n+ if deg:\n+ fact = 180/pi\n+ else:\n+ fact = 1.0\n+ z = asarray(z)\n+ if z.typecode() in ['D','F']:\n+ zimag = z.imag\n+ zreal = z.real\n+ else:\n+ zimag = 0\n+ zreal = z\n+ return arctan2(zimag,zreal) * fact\n+\n+import copy\n+def unwrap(p,discont=pi,axis=-1):\n+ \"\"\"unwrap(p,discont=pi,axis=-1)\n+\n+ unwraps radian phase p by changing absolute jumps greater than discont to\n+ their 2*pi complement along the given axis.\n+ \"\"\"\n+ p = asarray(p)\n+ nd = len(p.shape)\n+ dd = diff(p,axis=axis)\n+ slice1 = [slice(None,None)]*nd # full slices\n+ slice1[axis] = slice(1,None)\n+ ddmod = mod(dd+pi,2*pi)-pi\n+ putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n+ ph_correct = ddmod - dd;\n+ putmask(ph_correct,abs(dd) 0)\n\ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n return Numeric.logical_and(isinf(val),val < 0)\n \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> scipy.limits.double_max\n # -Inf -> scipy.limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,scipy.limits.double_min, 0., scipy.limits.double_max))\n return y\n\n# These are from Numeric\nfrom Numeric import *\nimport Numeric\nimport Matrix\nfrom utility import isscalar\nfrom fastumath import *\n\n\n# Elementary matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n\ndef eye(N, M=None, k=0, typecode=None):\n \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the \n k-th diagonal is all ones, and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef tri(N, M=None, k=0, typecode=None):\n \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all\n the diagonals starting from lower left corner up to the k-th are all ones.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = greater_equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n \n# matrix manipulation\n\ndef diag(v, k=0):\n \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or\n returns a matrix with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n \ndef fliplr(m):\n \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and\n columns flipped in the left/right direction. Only works with 2-D\n arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and\n rows flipped in the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees\n in the counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n\ndef tril(m, k=0):\n \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of\n m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n diagonal.\n \"\"\"\n svsp = m.spacesaver()\n m = asarray(m,savespace=1)\n out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m\n out.savespace(svsp)\n return out\n\ndef triu(m, k=0):\n \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of\n m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n diagonal.\n \"\"\"\n svsp = m.spacesaver()\n m = asarray(m,savespace=1)\n out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m\n out.savespace(svsp)\n return out\n\n# Data analysis\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef squeeze(a):\n \"Returns a with any ones from the shape of a removed\"\n a = asarray(a)\n b = asarray(a.shape)\n return reshape (a, tuple (compress (not_equal (b, 1), b)))\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\nimport copy\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd) 0)", + "", + "def isneginf(val):", + " # complex not handled currently (and potentially ambiguous)", + " return Numeric.logical_and(isinf(val),val < 0)", + "", + "def nan_to_num(x):", + " # mapping:", + " # NaN -> 0", + " # Inf -> scipy.limits.double_max", + " # -Inf -> scipy.limits.double_min", + " # complex not handled currently", + " import limits", + " try:", + " t = x.typecode()", + " except AttributeError:", + " t = type(x)", + " if t in [ComplexType,'F','D']:", + " y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)", + " else:", + " x = Numeric.asarray(x)", + " are_inf = isposinf(x)", + " are_neg_inf = isneginf(x)", + " are_nan = isnan(x)", + " choose_array = are_neg_inf + are_nan * 2 + are_inf * 3", + " y = Numeric.choose(choose_array,", + " (x,scipy.limits.double_min, 0., scipy.limits.double_max))", + " return y", + "", + "# These are from Numeric", + "from Numeric import *", + "import Numeric", + "import Matrix", + "from utility import isscalar", + "from fastumath import *", + "", + "", + "# Elementary matrices", + "", + "# zeros is from matrixmodule in C", + "# ones is from Numeric.py", + "", + "", + "def eye(N, M=None, k=0, typecode=None):", + " \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the", + " k-th diagonal is all ones, and everything else is zeros.", + " \"\"\"", + " if M is None: M = N", + " if type(M) == type('d'):", + " typecode = M", + " M = N", + " m = equal(subtract.outer(arange(N), arange(M)),-k)", + " if typecode is None:", + " return m", + " else:", + " return m.astype(typecode)", + "", + "def tri(N, M=None, k=0, typecode=None):", + " \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all", + " the diagonals starting from lower left corner up to the k-th are all ones.", + " \"\"\"", + " if M is None: M = N", + " if type(M) == type('d'):", + " typecode = M", + " M = N", + " m = greater_equal(subtract.outer(arange(N), arange(M)),-k)", + " if typecode is None:", + " return m", + " else:", + " return m.astype(typecode)", + "", + "# matrix manipulation", + "", + "def diag(v, k=0):", + " \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or", + " returns a matrix with v as the k-th diagonal if v is a vector.", + " \"\"\"", + " v = asarray(v)", + " s = v.shape", + " if len(s)==1:", + " n = s[0]+abs(k)", + " if k > 0:", + " v = concatenate((zeros(k, v.typecode()),v))", + " elif k < 0:", + " v = concatenate((v,zeros(-k, v.typecode())))", + " return eye(n, k=k)*v", + " elif len(s)==2:", + " v = add.reduce(eye(s[0], s[1], k=k)*v)", + " if k > 0: return v[k:]", + " elif k < 0: return v[:k]", + " else: return v", + " else:", + " raise ValueError, \"Input must be 1- or 2-D.\"", + "", + "def fliplr(m):", + " \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and", + " columns flipped in the left/right direction. Only works with 2-D", + " arrays.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " return m[:, ::-1]", + "", + "def flipud(m):", + " \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and", + " rows flipped in the up/down direction. Only works with 2-D arrays.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " return m[::-1]", + "", + "# reshape(x, m, n) is not used, instead use reshape(x, (m, n))", + "", + "def rot90(m, k=1):", + " \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees", + " in the counterclockwise direction.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " k = k % 4", + " if k == 0: return m", + " elif k == 1: return transpose(fliplr(m))", + " elif k == 2: return fliplr(flipud(m))", + " else: return fliplr(transpose(m)) # k==3", + "", + "def tril(m, k=0):", + " \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of", + " m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main", + " diagonal.", + " \"\"\"", + " svsp = m.spacesaver()", + " m = asarray(m,savespace=1)", + " out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m", + " out.savespace(svsp)", + " return out", + "", + "def triu(m, k=0):", + " \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of", + " m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main", + " diagonal.", + " \"\"\"", + " svsp = m.spacesaver()", + " m = asarray(m,savespace=1)", + " out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m", + " out.savespace(svsp)", + " return out", + "", + "# Data analysis", + "", + "# Basic operations", + "def amax(m,axis=-1):", + " \"\"\"Returns the maximum of m along dimension axis.", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return maximum.reduce(m,axis)", + "", + "def amin(m,axis=-1):", + " \"\"\"Returns the minimum of m along dimension axis.", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return minimum.reduce(m,axis)", + "", + "# Actually from Basis, but it fits in so naturally here...", + "", + "def ptp(m,axis=-1):", + " \"\"\"Returns the maximum - minimum along the the given dimension", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return amax(m,axis)-amin(m,axis)", + "", + "def cumsum(m,axis=-1):", + " \"\"\"Returns the cumulative sum of the elements along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return add.accumulate(m,axis)", + "", + "def prod(m,axis=-1):", + " \"\"\"Returns the product of the elements along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return multiply.reduce(m,axis)", + "", + "def cumprod(m,axis=-1):", + " \"\"\"Returns the cumulative product of the elments along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return multiply.accumulate(m,axis)", + "", + "def diff(x, n=1,axis=-1):", + " \"\"\"Calculates the nth order, discrete difference along given axis.", + " \"\"\"", + " x = asarray(x)", + " nd = len(x.shape)", + " slice1 = [slice(None)]*nd", + " slice2 = [slice(None)]*nd", + " slice1[axis] = slice(1,None)", + " slice2[axis] = slice(None,-1)", + " if n > 1:", + " return diff(x[slice1]-x[slice2], n-1, axis=axis)", + " else:", + " return x[slice1]-x[slice2]", + "", + "def squeeze(a):", + " \"Returns a with any ones from the shape of a removed\"", + " a = asarray(a)", + " b = asarray(a.shape)", + " return reshape (a, tuple (compress (not_equal (b, 1), b)))", + "", + "def angle(z,deg=0):", + " \"\"\"Return the angle of complex argument z.\"\"\"", + " if deg:", + " fact = 180/pi", + " else:", + " fact = 1.0", + " z = asarray(z)", + " if z.typecode() in ['D','F']:", + " zimag = z.imag", + " zreal = z.real", + " else:", + " zimag = 0", + " zreal = z", + " return arctan2(zimag,zreal) * fact", + "", + "import copy", + "def unwrap(p,discont=pi,axis=-1):", + " \"\"\"unwrap(p,discont=pi,axis=-1)", + "", + " unwraps radian phase p by changing absolute jumps greater than discont to", + " their 2*pi complement along the given axis.", + " \"\"\"", + " p = asarray(p)", + " nd = len(p.shape)", + " dd = diff(p,axis=axis)", + " slice1 = [slice(None,None)]*nd # full slices", + " slice1[axis] = slice(1,None)", + " ddmod = mod(dd+pi,2*pi)-pi", + " putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)", + " ph_correct = ddmod - dd;", + " putmask(ph_correct,abs(dd)\n+#include \"mconf_lite.h\"\n \n /* Fast umath module whose functions do not check for range and domain errors.\n \n- Replacement for umath\n+ Replacement for umath + additions for isnan, isfinite, and isinf\n */\n \n-\n #ifndef CHAR_BIT\n #define CHAR_BIT 8\n #endif\n@@ -37,9 +37,122 @@ extern double modf (double, double *);\n #endif\n \n #ifndef M_PI\n-#define M_PI 3.14159265359\n+#define M_PI 3.1415926535897931\n #endif\n \n+\n+#define ABS(x) ((x) < 0 ? -(x) : (x))\n+\n+/* isnan and isinf and isfinite functions */\n+static void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n+ }\n+}\n+\n+static void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n+ }\n+}\n+\n+static void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n+ }\n+}\n+\n+static void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n+ }\n+}\n+\n+\n+static void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n+ }\n+}\n+\n+static void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n+ }\n+}\n+\n+static void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n+ }\n+}\n+\n+static void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n+ }\n+}\n+\n+\n+static void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n+ }\n+}\n+\n+static void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n+ }\n+}\n+\n+static void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n+ }\n+}\n+\n+static void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0], os=steps[1], n=dimensions[0];\n+ char *i1=args[0], *op=args[1];\n+ for (i=0; i < n; i++, i1+=is1, op+=os) {\n+\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n+ }\n+}\n+\n+static PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\n+static PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\n+static PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n+\n+static char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n+\n+static void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n+static void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n+static void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n+\n+\n #if !defined(HAVE_INVERSE_HYPERBOLIC)\n static double acosh(double x)\n {\n@@ -348,6 +461,7 @@ static long powll(long x, long n, int nbits)\n return r;\n }\n \n+\n static void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n@@ -1058,343 +1172,404 @@ static void SBYTE_greater(char **args, int *dimensions, int *steps, void *func)\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n+\t*((unsigned char *)op)=*((signed char *)i1) > *((signed char *)i2);\n }\n }\n static void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n+\t*((unsigned char *)op)=*((short *)i1) > *((short *)i2);\n }\n }\n static void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n+\t*((unsigned char *)op)=*((int *)i1) > *((int *)i2);\n }\n }\n static void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n+\t*((unsigned char *)op)=*((long *)i1) > *((long *)i2);\n }\n }\n static void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n+\t*((unsigned char *)op)=*((float *)i1) > *((float *)i2);\n }\n }\n static void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n+\t*((unsigned char *)op)=*((double *)i1) > *((double *)i2);\n+ }\n+}\n+\n+/* complex numbers are compared by there real parts. */\n+static void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i ((float *)i2)[0];\n+ }\n+}\n+static void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i ((double *)i2)[0];\n }\n }\n+\n static void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n+\t*((unsigned char *)op)=*((unsigned char *)i1) >= *((unsigned char *)i2);\n }\n }\n static void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n+\t*((unsigned char *)op)=*((signed char *)i1) >= *((signed char *)i2);\n }\n }\n static void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n+\t*((unsigned char *)op)=*((short *)i1) >= *((short *)i2);\n }\n }\n static void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n+\t*((unsigned char *)op)=*((int *)i1) >= *((int *)i2);\n }\n }\n static void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n+\t*((unsigned char *)op)=*((long *)i1) >= *((long *)i2);\n }\n }\n static void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n+\t*((unsigned char *)op)=*((float *)i1) >= *((float *)i2);\n }\n }\n static void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n+\t*((unsigned char *)op)=*((double *)i1) >= *((double *)i2);\n }\n }\n+static void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i= *((float *)i2);\n+ }\n+}\n+static void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i= *((double *)i2);\n+ }\n+}\n+\n static void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n }\n+static void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n+\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n+ }\n+}\n+static void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n+\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n+ }\n+}\n static void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n@@ -1656,6 +1893,22 @@ static void DOUBLE_minimum(char **args, int *dimensions, int *steps, void *func)\n \t*((double *)op)=*((double *)i1) < *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n }\n+static void CFLOAT_minimum(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n+ char *i1=args[0], *i2=args[1], *op=args[2];\n+ for(i=0; i y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_None, \"greater_equal\", \n+\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n \t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_None, \"less\", \n+\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n \t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_None, \"less_equal\", \n+\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n \t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n@@ -2079,33 +2352,33 @@ static void InitOperators(PyObject *dictionary) {\n \t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n- f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, divide_safe_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_One, \"logical_and\", \n+ f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n+\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n \t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n- f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, divide_safe_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_Zero, \"logical_or\", \n+ f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n+\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n \t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n- f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, divide_safe_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_None, \"logical_xor\", \n+ f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n+\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n \t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n-\t\t\t\t7, 1, 1, PyUFunc_None, \"logical_not\", \n+\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n \t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n- f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, divide_safe_signatures, \n-\t\t\t\t7, 2, 1, PyUFunc_None, \"maximum\", \n+ f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n+\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n \t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n- f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, divide_safe_signatures,\n-\t\t\t\t7, 2, 1, PyUFunc_None, \"minimum\", \n+ f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n+\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n \t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n@@ -2272,7 +2545,7 @@ DL_EXPORT(void) initfastumath() {\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n \n- s = PyString_FromString(\"1.0\");\n+ s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n \n@@ -2283,7 +2556,18 @@ DL_EXPORT(void) initfastumath() {\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n-\n+ PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n+ Py_DECREF(s);\n+ PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n+ Py_DECREF(s);\n+ PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n+ Py_DECREF(s);\n+ PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n+ Py_DECREF(s);\n+#if defined(NAN) \n+ PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n+ Py_DECREF(s);\n+#endif\n \n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n", + "added_lines": 390, + "deleted_lines": 106, + "source_code": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "source_code_before": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath\n */\n\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.14159265359\n#endif\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, };\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_LONG, PyArray_UBYTE, PyArray_UBYTE, PyArray_LONG, PyArray_SBYTE, PyArray_SBYTE, PyArray_LONG, PyArray_SHORT, PyArray_SHORT, PyArray_LONG, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_LONG, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_LONG, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_LONG};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_LONG, PyArray_SBYTE, PyArray_SBYTE, PyArray_LONG, PyArray_SHORT, PyArray_SHORT, PyArray_LONG, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_LONG, };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t7, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, divide_safe_signatures,\n\t\t\t\t7, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"1.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "methods": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 47, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 55, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 63, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 71, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 88, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 104, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 113, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 129, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 137, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 157, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 162, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 177, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 188, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 231, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 277, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 302, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 311, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 319, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 337, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 342, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 347, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 352, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 360, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 368, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 377, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 386, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 394, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 402, + "end_line": 420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 422, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 442, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 465, + "end_line": 471, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 472, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 486, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 493, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 500, + "end_line": 506, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 507, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 514, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 521, + "end_line": 527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 528, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 535, + "end_line": 541, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 542, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 549, + "end_line": 555, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 556, + "end_line": 562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 563, + "end_line": 569, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 570, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 577, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 584, + "end_line": 590, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 591, + "end_line": 603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 604, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 617, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 722, + "end_line": 826, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 827, + "end_line": 931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 932, + "end_line": 938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 939, + "end_line": 945, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 946, + "end_line": 952, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 953, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 960, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 967, + "end_line": 973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 974, + "end_line": 980, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 981, + "end_line": 987, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 988, + "end_line": 994, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 995, + "end_line": 1001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1002, + "end_line": 1008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1009, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1016, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1023, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1030, + "end_line": 1036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1037, + "end_line": 1043, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1044, + "end_line": 1045, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1046, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1069, + "end_line": 1075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1076, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1083, + "end_line": 1089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1090, + "end_line": 1096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1097, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1104, + "end_line": 1110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1111, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1118, + "end_line": 1124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1125, + "end_line": 1131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1132, + "end_line": 1133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1134, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1206, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1222, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1230, + "end_line": 1236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1237, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1244, + "end_line": 1250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1251, + "end_line": 1257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1258, + "end_line": 1264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1265, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1272, + "end_line": 1278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1279, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1286, + "end_line": 1292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1294, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1301, + "end_line": 1307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1308, + "end_line": 1314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1315, + "end_line": 1321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1322, + "end_line": 1328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1329, + "end_line": 1335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1336, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1343, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1350, + "end_line": 1356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1553, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1554, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1575, + "end_line": 1581, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1638, + "end_line": 1644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1701, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1764, + "end_line": 1765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1789, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1796, + "end_line": 1802, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1803, + "end_line": 1809, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1810, + "end_line": 1816, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1817, + "end_line": 1823, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1824, + "end_line": 1830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1847, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1854, + "end_line": 1860, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1861, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1868, + "end_line": 1874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1875, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1882, + "end_line": 1888, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1889, + "end_line": 1895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1896, + "end_line": 1903, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1904, + "end_line": 1911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1912, + "end_line": 1918, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1919, + "end_line": 1925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1926, + "end_line": 1932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1933, + "end_line": 1939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1940, + "end_line": 1946, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1947, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1954, + "end_line": 1960, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1961, + "end_line": 1967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1968, + "end_line": 1974, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1975, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1982, + "end_line": 1988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1989, + "end_line": 1995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1996, + "end_line": 2002, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2003, + "end_line": 2009, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2010, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2017, + "end_line": 2018, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2019, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2034, + "end_line": 2040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2041, + "end_line": 2047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2055, + "end_line": 2061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2062, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2069, + "end_line": 2075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2076, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2083, + "end_line": 2089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2090, + "end_line": 2096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2183, + "end_line": 2526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2535, + "end_line": 2591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 49, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 64, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 75, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 118, + "end_line": 162, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 164, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 189, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 198, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 206, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 212, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 218, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 224, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 229, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 234, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 239, + "end_line": 245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 247, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 255, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 264, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 273, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 281, + "end_line": 287, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 289, + "end_line": 307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 309, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 329, + "end_line": 349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 351, + "end_line": 357, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 358, + "end_line": 364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 365, + "end_line": 371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 372, + "end_line": 378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 379, + "end_line": 385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 386, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 393, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 400, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 407, + "end_line": 413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 414, + "end_line": 420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 421, + "end_line": 427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 428, + "end_line": 434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 435, + "end_line": 441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 442, + "end_line": 448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 449, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 456, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 463, + "end_line": 469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 470, + "end_line": 476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 477, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 490, + "end_line": 502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 503, + "end_line": 607, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 608, + "end_line": 712, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 713, + "end_line": 817, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 818, + "end_line": 824, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 825, + "end_line": 831, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 832, + "end_line": 838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 839, + "end_line": 845, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 846, + "end_line": 852, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 853, + "end_line": 859, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 860, + "end_line": 866, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 867, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 874, + "end_line": 880, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 881, + "end_line": 887, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 888, + "end_line": 894, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 895, + "end_line": 901, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 902, + "end_line": 908, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 909, + "end_line": 915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 916, + "end_line": 922, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 923, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 930, + "end_line": 931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 932, + "end_line": 933, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 934, + "end_line": 935, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 936, + "end_line": 937, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 938, + "end_line": 939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 940, + "end_line": 941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 942, + "end_line": 943, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 944, + "end_line": 945, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 946, + "end_line": 947, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 948, + "end_line": 954, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 955, + "end_line": 961, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 962, + "end_line": 968, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 969, + "end_line": 975, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 976, + "end_line": 982, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 983, + "end_line": 989, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 990, + "end_line": 996, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 997, + "end_line": 1003, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1004, + "end_line": 1010, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1011, + "end_line": 1017, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1018, + "end_line": 1019, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1020, + "end_line": 1021, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1022, + "end_line": 1023, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1024, + "end_line": 1025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1026, + "end_line": 1027, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1028, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1030, + "end_line": 1031, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1032, + "end_line": 1033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1034, + "end_line": 1035, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1036, + "end_line": 1037, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1038, + "end_line": 1039, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1040, + "end_line": 1041, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1042, + "end_line": 1043, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1044, + "end_line": 1045, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1046, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1056, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1057, + "end_line": 1063, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1064, + "end_line": 1070, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1071, + "end_line": 1077, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1078, + "end_line": 1084, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1085, + "end_line": 1091, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1092, + "end_line": 1098, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1099, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1106, + "end_line": 1112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1113, + "end_line": 1119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1120, + "end_line": 1126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1127, + "end_line": 1133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1134, + "end_line": 1140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1141, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1154, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1155, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1169, + "end_line": 1175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1176, + "end_line": 1182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1183, + "end_line": 1189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1190, + "end_line": 1196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1197, + "end_line": 1203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1204, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1211, + "end_line": 1217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1218, + "end_line": 1224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1225, + "end_line": 1231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1232, + "end_line": 1238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1239, + "end_line": 1245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1246, + "end_line": 1252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1253, + "end_line": 1259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1260, + "end_line": 1266, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1267, + "end_line": 1273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1274, + "end_line": 1280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1281, + "end_line": 1287, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1288, + "end_line": 1294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1295, + "end_line": 1301, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 160, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1302, + "end_line": 1308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 160, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1309, + "end_line": 1315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1316, + "end_line": 1322, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1323, + "end_line": 1329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1330, + "end_line": 1336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1337, + "end_line": 1343, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1344, + "end_line": 1350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1351, + "end_line": 1357, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 160, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 160, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1549, + "end_line": 1550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1551, + "end_line": 1552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1553, + "end_line": 1554, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1555, + "end_line": 1556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 94, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1557, + "end_line": 1558, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1559, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1575, + "end_line": 1581, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1638, + "end_line": 1644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1701, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1764, + "end_line": 1765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1780, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1781, + "end_line": 1787, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1788, + "end_line": 1794, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1795, + "end_line": 1801, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1802, + "end_line": 1808, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1809, + "end_line": 1815, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1816, + "end_line": 1822, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1823, + "end_line": 1829, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1830, + "end_line": 1836, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1837, + "end_line": 1843, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 320, + "complexity": 1, + "token_count": 2543, + "parameters": [ + "dictionary" + ], + "start_line": 1929, + "end_line": 2253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 325, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 2, + "token_count": 150, + "parameters": [], + "start_line": 2262, + "end_line": 2307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 46, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1553, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 137, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 55, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1904, + "end_line": 1911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1251, + "end_line": 1257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1279, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1230, + "end_line": 1236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2535, + "end_line": 2591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1206, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1265, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 113, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 47, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1237, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1294, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1350, + "end_line": 1356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1286, + "end_line": 1292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1329, + "end_line": 1335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1222, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1301, + "end_line": 1307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 71, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1308, + "end_line": 1314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1258, + "end_line": 1264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 63, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 88, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1554, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 104, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1315, + "end_line": 1321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 129, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1272, + "end_line": 1278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1336, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2183, + "end_line": 2526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1896, + "end_line": 1903, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1322, + "end_line": 1328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1244, + "end_line": 1250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1343, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "nloc": 2374, + "complexity": 665, + "token_count": 40037, + "diff_parsed": { + "added": [ + "#include \"mconf_lite.h\"", + " Replacement for umath + additions for isnan, isfinite, and isinf", + "#define M_PI 3.1415926535897931", + "", + "#define ABS(x) ((x) < 0 ? -(x) : (x))", + "", + "/* isnan and isinf and isfinite functions */", + "static void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));", + " }", + "}", + "", + "static void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));", + " }", + "}", + "", + "static void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);", + " }", + "}", + "", + "static void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);", + " }", + "}", + "", + "", + "static void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));", + " }", + "}", + "", + "static void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));", + " }", + "}", + "", + "static void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));", + " }", + "}", + "", + "static void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));", + " }", + "}", + "", + "", + "static void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));", + " }", + "}", + "", + "static void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));", + " }", + "}", + "", + "static void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);", + " }", + "}", + "", + "static void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0], os=steps[1], n=dimensions[0];", + " char *i1=args[0], *op=args[1];", + " for (i=0; i < n; i++, i1+=is1, op+=os) {", + "\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);", + " }", + "}", + "", + "static PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};", + "static PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};", + "static PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};", + "", + "static char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };", + "", + "static void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};", + "static void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};", + "static void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};", + "", + "", + "", + "\t*((unsigned char *)op)=*((signed char *)i1) > *((signed char *)i2);", + "\t*((unsigned char *)op)=*((short *)i1) > *((short *)i2);", + "\t*((unsigned char *)op)=*((int *)i1) > *((int *)i2);", + "\t*((unsigned char *)op)=*((long *)i1) > *((long *)i2);", + "\t*((unsigned char *)op)=*((float *)i1) > *((float *)i2);", + "\t*((unsigned char *)op)=*((double *)i1) > *((double *)i2);", + " }", + "}", + "", + "/* complex numbers are compared by there real parts. */", + "static void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i ((float *)i2)[0];", + " }", + "}", + "static void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i ((double *)i2)[0];", + "", + "\t*((unsigned char *)op)=*((unsigned char *)i1) >= *((unsigned char *)i2);", + "\t*((unsigned char *)op)=*((signed char *)i1) >= *((signed char *)i2);", + "\t*((unsigned char *)op)=*((short *)i1) >= *((short *)i2);", + "\t*((unsigned char *)op)=*((int *)i1) >= *((int *)i2);", + "\t*((unsigned char *)op)=*((long *)i1) >= *((long *)i2);", + "\t*((unsigned char *)op)=*((float *)i1) >= *((float *)i2);", + "\t*((unsigned char *)op)=*((double *)i1) >= *((double *)i2);", + "static void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i= *((float *)i2);", + " }", + "}", + "static void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i= *((double *)i2);", + " }", + "}", + "", + "\t*((unsigned char *)op)=*((unsigned char *)i1) < *((unsigned char *)i2);", + "\t*((unsigned char *)op)=*((signed char *)i1) < *((signed char *)i2);", + "\t*((unsigned char *)op)=*((short *)i1) < *((short *)i2);", + "\t*((unsigned char *)op)=*((int *)i1) < *((int *)i2);", + "\t*((unsigned char *)op)=*((long *)i1) < *((long *)i2);", + "\t*((unsigned char *)op)=*((float *)i1) < *((float *)i2);", + "\t*((unsigned char *)op)=*((double *)i1) < *((double *)i2);", + " }", + "}", + "static void CFLOAT_less(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);", + "\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];", + " }", + "}", + "static void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);", + "\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];", + " }", + "}", + "static void CFLOAT_minimum(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];", + " char *i1=args[0], *i2=args[1], *op=args[2];", + " for(i=0; i *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) > *((short *)i2);", + "\t*((long *)op)=*((int *)i1) > *((int *)i2);", + "\t*((long *)op)=*((long *)i1) > *((long *)i2);", + "\t*((long *)op)=*((float *)i1) > *((float *)i2);", + "\t*((long *)op)=*((double *)i1) > *((double *)i2);", + "\t*((long *)op)=*((unsigned char *)i1) >= *((unsigned char *)i2);", + "\t*((long *)op)=*((signed char *)i1) >= *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) >= *((short *)i2);", + "\t*((long *)op)=*((int *)i1) >= *((int *)i2);", + "\t*((long *)op)=*((long *)i1) >= *((long *)i2);", + "\t*((long *)op)=*((float *)i1) >= *((float *)i2);", + "\t*((long *)op)=*((double *)i1) >= *((double *)i2);", + "\t*((long *)op)=*((unsigned char *)i1) < *((unsigned char *)i2);", + "\t*((long *)op)=*((signed char *)i1) < *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) < *((short *)i2);", + "\t*((long *)op)=*((int *)i1) < *((int *)i2);", + "\t*((long *)op)=*((long *)i1) < *((long *)i2);", + "\t*((long *)op)=*((float *)i1) < *((float *)i2);", + "\t*((long *)op)=*((double *)i1) < *((double *)i2);", + "\t*((long *)op)=*((unsigned char *)i1) <= *((unsigned char *)i2);", + "\t*((long *)op)=*((signed char *)i1) <= *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) <= *((short *)i2);", + "\t*((long *)op)=*((int *)i1) <= *((int *)i2);", + "\t*((long *)op)=*((long *)i1) <= *((long *)i2);", + "\t*((long *)op)=*((float *)i1) <= *((float *)i2);", + "\t*((long *)op)=*((double *)i1) <= *((double *)i2);", + "\t*((long *)op)=*((char *)i1) == *((char *)i2);", + "\t*((long *)op)=*((unsigned char *)i1) == *((unsigned char *)i2);", + "\t*((long *)op)=*((signed char *)i1) == *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) == *((short *)i2);", + "\t*((long *)op)=*((int *)i1) == *((int *)i2);", + "\t*((long *)op)=*((long *)i1) == *((long *)i2);", + "\t*((long *)op)=*((float *)i1) == *((float *)i2);", + "\t*((long *)op)=*((double *)i1) == *((double *)i2);", + " *((long *)op)=(((float *)i1)[0] == ((float *)i2)[0]) && (((float *)i1)[1] == ((float *)i2)[1]);", + " *((long *)op)=(((double *)i1)[0] == ((double *)i2)[0]) && (((double *)i1)[1] == ((double *)i2)[1]);", + " *((long *)op)=(PyObject_Compare(*((PyObject **)i1),*((PyObject **)i2)) == 0);", + "\t*((long *)op)=*((char *)i1) != *((char *)i2);", + "\t*((long *)op)=*((unsigned char *)i1) != *((unsigned char *)i2);", + "\t*((long *)op)=*((signed char *)i1) != *((signed char *)i2);", + "\t*((long *)op)=*((short *)i1) != *((short *)i2);", + "\t*((long *)op)=*((int *)i1) != *((int *)i2);", + "\t*((long *)op)=*((long *)i1) != *((long *)i2);", + "\t*((long *)op)=*((float *)i1) != *((float *)i2);", + "\t*((long *)op)=*((double *)i1) != *((double *)i2);", + " *((long *)op)=(((float *)i1)[0] != ((float *)i2)[0]) || (((float *)i1)[1] != ((float *)i2)[1]);", + " *((long *)op)=(((double *)i1)[0] != ((double *)i2)[0]) || (((double *)i1)[1] != ((double *)i2)[1]);", + " *((long *)op)=(PyObject_Compare(*((PyObject **)i1),*((PyObject **)i2)) != 0);", + "\t*((signed char *)op)=*((signed char *)i1) && *((signed char *)i2);", + "\t*((short *)op)=*((short *)i1) && *((short *)i2);", + "\t*((int *)op)=*((int *)i1) && *((int *)i2);", + "\t*((long *)op)=*((long *)i1) && *((long *)i2);", + "\t*((float *)op)=(float)(*((float *)i1) && *((float *)i2));", + "\t*((double *)op)=(double)(*((double *)i1) && *((double *)i2));", + "\t*((signed char *)op)=*((signed char *)i1) || *((signed char *)i2);", + "\t*((short *)op)=*((short *)i1) || *((short *)i2);", + "\t*((int *)op)=*((int *)i1) || *((int *)i2);", + "\t*((long *)op)=*((long *)i1) || *((long *)i2);", + "\t*((float *)op)=(float)(*((float *)i1) || *((float *)i2));", + "\t*((double *)op)=*((double *)i1) || *((double *)i2);", + "\t*((signed char *)op)=(*((signed char *)i1) || *((signed char *)i2)) && !(*((signed char *)i1) && *((signed char *)i2));", + "\t*((short *)op)=(*((short *)i1) || *((short *)i2)) && !(*((short *)i1) && *((short *)i2));", + "\t*((int *)op)=(*((int *)i1) || *((int *)i2)) && !(*((int *)i1) && *((int *)i2));", + "\t*((long *)op)=(*((long *)i1) || *((long *)i2)) && !(*((long *)i1) && *((long *)i2));", + "\t*((float *)op)=(float)((*((float *)i1) || *((float *)i2)) && !(*((float *)i1) && *((float *)i2)));", + "\t*((double *)op)=(*((double *)i1) || *((double *)i2)) && !(*((double *)i1) && *((double *)i2));", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((signed char *)op)=!*((signed char *)i1);}}", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((short *)op)=!*((short *)i1);}}", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((int *)op)=!*((int *)i1);}}", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((long *)op)=!*((long *)i1);}}", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((float *)op)=(float)(!*((float *)i1));}}", + "{int i; char *i1=args[0], *op=args[1]; for(i=0; i<*dimensions; i++, i1+=steps[0], op+=steps[1]) {*((double *)op)=!*((double *)i1);}}", + "static PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, };", + "static PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, };", + "static PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, };", + "static PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, };", + "static PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, };", + "static PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, };", + "static PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, };", + "static PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, };", + "static PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, };", + "static PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, };", + "static char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_LONG, PyArray_UBYTE, PyArray_UBYTE, PyArray_LONG, PyArray_SBYTE, PyArray_SBYTE, PyArray_LONG, PyArray_SHORT, PyArray_SHORT, PyArray_LONG, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_LONG, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_LONG, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_LONG};", + "static char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_LONG, PyArray_SBYTE, PyArray_SBYTE, PyArray_LONG, PyArray_SHORT, PyArray_SHORT, PyArray_LONG, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_LONG, };", + "static char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, };", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"greater\",", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"greater_equal\",", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"less\",", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"less_equal\",", + " f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, divide_safe_signatures,", + "\t\t\t\t7, 2, 1, PyUFunc_One, \"logical_and\",", + " f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, divide_safe_signatures,", + "\t\t\t\t7, 2, 1, PyUFunc_Zero, \"logical_or\",", + " f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, divide_safe_signatures,", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"logical_xor\",", + "\t\t\t\t7, 1, 1, PyUFunc_None, \"logical_not\",", + " f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, divide_safe_signatures,", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"maximum\",", + " f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, divide_safe_signatures,", + "\t\t\t\t7, 2, 1, PyUFunc_None, \"minimum\",", + " s = PyString_FromString(\"1.0\");", + "" + ] + } + }, + { + "old_path": "scipy_base/function_base.py", + "new_path": "scipy_base/function_base.py", + "filename": "function_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,6 +1,7 @@\n import types\n import Numeric\n from Numeric import *\n+from fastumath import *\n \n __all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n@@ -262,4 +263,4 @@ def test_suite(level=1):\n return module_test_suite(__name__,__file__,level=level)\n \n if __name__ == '__main__':\n- test()\n\\ No newline at end of file\n+ test()\n", + "added_lines": 2, + "deleted_lines": 1, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\n__all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n 'prod','cumprod','diff','angle','unwrap','sort_complex']\n\nround = Numeric.around\nany = Numeric.sometrue\nall = Numeric.alltrue\n\ndef logspace(start,stop,num=50,endpoint=1):\n \"\"\" Evenly spaced samples on a logarithmic scale.\n\n Return num evenly spaced samples from 10**start to 10**stop. If\n endpoint=1 then last sample is 10**stop.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start\n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n return Numeric.power(10.0,y)\n\ndef linspace(start,stop,num=50,endpoint=1,retstep=0):\n \"\"\" Evenly spaced samples.\n \n Return num evenly spaced samples from start to stop. If endpoint=1 then\n last sample is stop. If retstep is 1 then return the step value used.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start \n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef fix(x):\n \"\"\" Round x to nearest integer towards zero.\n \"\"\"\n x = Numeric.asarray(x)\n y = Numeric.floor(x)\n return Numeric.where(x<0,y+1,y)\n\ndef mod(x,y):\n \"\"\" x - y*floor(x/y)\n \n For numeric arrays, x % y has the same sign as x while\n mod(x,y) has the same sign as y.\n \"\"\"\n return x - y*Numeric.floor(x*1.0/y)\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Returns an array comprised from different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n \n choicelist is a list of choice matrices (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0,...,cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0,...,vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n \n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n \n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n \n Note, that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"List of cases, must be same length as the list of conditions.\"\n choicelist.insert(0,default) \n S = 0\n pfac = 1\n for k in range(1,n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k]) \n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd)>> import scipy\n >>> a = array((0,0,0,1,2,3,2,1,0))\n >>> scipy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n if 'f' in trim or 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'b' in trim or 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\n\n__all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n 'prod','cumprod','diff','angle','unwrap','sort_complex']\n\nround = Numeric.around\nany = Numeric.sometrue\nall = Numeric.alltrue\n\ndef logspace(start,stop,num=50,endpoint=1):\n \"\"\" Evenly spaced samples on a logarithmic scale.\n\n Return num evenly spaced samples from 10**start to 10**stop. If\n endpoint=1 then last sample is 10**stop.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start\n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n return Numeric.power(10.0,y)\n\ndef linspace(start,stop,num=50,endpoint=1,retstep=0):\n \"\"\" Evenly spaced samples.\n \n Return num evenly spaced samples from start to stop. If endpoint=1 then\n last sample is stop. If retstep is 1 then return the step value used.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start \n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef fix(x):\n \"\"\" Round x to nearest integer towards zero.\n \"\"\"\n x = Numeric.asarray(x)\n y = Numeric.floor(x)\n return Numeric.where(x<0,y+1,y)\n\ndef mod(x,y):\n \"\"\" x - y*floor(x/y)\n \n For numeric arrays, x % y has the same sign as x while\n mod(x,y) has the same sign as y.\n \"\"\"\n return x - y*Numeric.floor(x*1.0/y)\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Returns an array comprised from different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n \n choicelist is a list of choice matrices (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0,...,cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0,...,vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n \n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n \n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n \n Note, that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"List of cases, must be same length as the list of conditions.\"\n choicelist.insert(0,default) \n S = 0\n pfac = 1\n for k in range(1,n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k]) \n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd)>> import scipy\n >>> a = array((0,0,0,1,2,3,2,1,0))\n >>> scipy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n if 'f' in trim or 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'b' in trim or 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()", + "methods": [ + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = 1 )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 88, + "parameters": [ + "start", + "stop", + "num", + "endpoint" + ], + "start_line": 14, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = 1 , retstep = 0 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "fix", + "long_name": "fix( x )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "x" + ], + "start_line": 45, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "mod", + "long_name": "mod( x , y )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x", + "y" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 60, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "amax", + "long_name": "amax( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 109, + "end_line": 117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "amin", + "long_name": "amin( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 119, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "ptp", + "long_name": "ptp( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "m", + "axis" + ], + "start_line": 131, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumsum", + "long_name": "cumsum( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 141, + "end_line": 149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "prod", + "long_name": "prod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 151, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumprod", + "long_name": "cumprod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 161, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( x , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 2, + "token_count": 110, + "parameters": [ + "x", + "n", + "axis" + ], + "start_line": 171, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 71, + "parameters": [ + "z", + "deg" + ], + "start_line": 185, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 146, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 200, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "sort_complex.complex_cmp", + "long_name": "sort_complex.complex_cmp( x , y )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 223, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "a" + ], + "start_line": 219, + "end_line": 230, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 9, + "token_count": 87, + "parameters": [ + "filt", + "trim" + ], + "start_line": 232, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 257, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 261, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = 1 )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 88, + "parameters": [ + "start", + "stop", + "num", + "endpoint" + ], + "start_line": 13, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = 1 , retstep = 0 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 27, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "fix", + "long_name": "fix( x )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "x" + ], + "start_line": 44, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "mod", + "long_name": "mod( x , y )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x", + "y" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 59, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "amax", + "long_name": "amax( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 108, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "amin", + "long_name": "amin( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 118, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "ptp", + "long_name": "ptp( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "m", + "axis" + ], + "start_line": 130, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumsum", + "long_name": "cumsum( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 140, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "prod", + "long_name": "prod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 150, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumprod", + "long_name": "cumprod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 160, + "end_line": 168, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( x , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 2, + "token_count": 110, + "parameters": [ + "x", + "n", + "axis" + ], + "start_line": 170, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 71, + "parameters": [ + "z", + "deg" + ], + "start_line": 184, + "end_line": 197, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 146, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 199, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "sort_complex.complex_cmp", + "long_name": "sort_complex.complex_cmp( x , y )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 222, + "end_line": 226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "a" + ], + "start_line": 218, + "end_line": 229, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 9, + "token_count": 87, + "parameters": [ + "filt", + "trim" + ], + "start_line": 231, + "end_line": 250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 256, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 260, + "end_line": 262, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 162, + "complexity": 46, + "token_count": 1300, + "diff_parsed": { + "added": [ + "from fastumath import *", + " test()" + ], + "deleted": [ + " test()" + ] + } + }, + { + "old_path": null, + "new_path": "scipy_base/isnan.c", + "filename": "isnan.c", + "extension": "c", + "change_type": "ADD", + "diff": "@@ -0,0 +1,241 @@\n+/*\t\t\t\t\t\t\tisnan()\n+ *\t\t\t\t\t\t\tsignbit()\n+ *\t\t\t\t\t\t\tisfinite()\n+ *\n+ *\tFloating point numeric utilities\n+ *\n+ *\n+ *\n+ * SYNOPSIS:\n+ *\n+ * double ceil(), floor(), frexp(), ldexp(); --- gone\n+ * int signbit(), isnan(), isfinite();\n+ * double x, y;\n+ * int expnt, n;\n+ *\n+ * y = floor(x); -gone \n+ * y = ceil(x); -gone\n+ * y = frexp( x, &expnt ); -gone\n+ * y = ldexp( x, n ); -gone\n+ * n = signbit(x);\n+ * n = isnan(x);\n+ * n = isfinite(x);\n+ *\n+ *\n+ *\n+ * DESCRIPTION:\n+ *\n+ * All four routines return a double precision floating point\n+ * result.\n+ *\n+ * floor() returns the largest integer less than or equal to x.\n+ * It truncates toward minus infinity.\n+ *\n+ * ceil() returns the smallest integer greater than or equal\n+ * to x. It truncates toward plus infinity.\n+ *\n+ * frexp() extracts the exponent from x. It returns an integer\n+ * power of two to expnt and the significand between 0.5 and 1\n+ * to y. Thus x = y * 2**expn.\n+ *\n+ * ldexp() multiplies x by 2**n.\n+ *\n+ * signbit(x) returns 1 if the sign bit of x is 1, else 0.\n+ *\n+ * These functions are part of the standard C run time library\n+ * for many but not all C compilers. The ones supplied are\n+ * written in C for either DEC or IEEE arithmetic. They should\n+ * be used only if your compiler library does not already have\n+ * them.\n+ *\n+ * The IEEE versions assume that denormal numbers are implemented\n+ * in the arithmetic. Some modifications will be required if\n+ * the arithmetic has abrupt rather than gradual underflow.\n+ */\n+\n+\n+/*\n+Cephes Math Library Release 2.3: March, 1995\n+Copyright 1984, 1995 by Stephen L. Moshier\n+*/\n+\n+\n+#include \"mconf_lite.h\"\n+\n+#ifdef UNK\n+#undef UNK\n+#if BIGENDIAN\n+#define MIEEE 1\n+#else\n+#define IBMPC 1\n+#endif\n+#endif\n+\n+\n+/* Return 1 if the sign bit of x is 1, else 0. */\n+\n+#if !defined(signbit)\n+int signbit(x)\n+double x;\n+{\n+union\n+\t{\n+\tdouble d;\n+\tshort s[4];\n+\tint i[2];\n+\t} u;\n+\n+u.d = x;\n+\n+if( sizeof(int) == 4 )\n+\t{\n+#ifdef IBMPC\n+\treturn( u.i[1] < 0 );\n+#endif\n+#ifdef DEC\n+\treturn( u.s[3] < 0 );\n+#endif\n+#ifdef MIEEE\n+\treturn( u.i[0] < 0 );\n+#endif\n+\t}\n+else\n+\t{\n+#ifdef IBMPC\n+\treturn( u.s[3] < 0 );\n+#endif\n+#ifdef DEC\n+\treturn( u.s[3] < 0 );\n+#endif\n+#ifdef MIEEE\n+\treturn( u.s[0] < 0 );\n+#endif\n+\t}\n+}\n+#endif\n+\n+/* Return 1 if x is a number that is Not a Number, else return 0. */\n+\n+#if !defined(isnan)\n+int isnan(x)\n+double x;\n+{\n+#ifdef NANS\n+union\n+\t{\n+\tdouble d;\n+\tunsigned short s[4];\n+\tunsigned int i[2];\n+\t} u;\n+\n+u.d = x;\n+\n+if( sizeof(int) == 4 )\n+\t{\n+#ifdef IBMPC\n+\tif( ((u.i[1] & 0x7ff00000) == 0x7ff00000)\n+\t && (((u.i[1] & 0x000fffff) != 0) || (u.i[0] != 0)))\n+\t\treturn 1;\n+#endif\n+#ifdef DEC\n+\tif( (u.s[1] & 0x7fff) == 0)\n+\t\t{\n+\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )\n+\t\t\treturn(1);\n+\t\t}\n+#endif\n+#ifdef MIEEE\n+\tif( ((u.i[0] & 0x7ff00000) == 0x7ff00000)\n+\t && (((u.i[0] & 0x000fffff) != 0) || (u.i[1] != 0)))\n+\t\treturn 1;\n+#endif\n+\treturn(0);\n+\t}\n+else\n+\t{ /* size int not 4 */\n+#ifdef IBMPC\n+\tif( (u.s[3] & 0x7ff0) == 0x7ff0)\n+\t\t{\n+\t\tif( ((u.s[3] & 0x000f) | u.s[2] | u.s[1] | u.s[0]) != 0 )\n+\t\t\treturn(1);\n+\t\t}\n+#endif\n+#ifdef DEC\n+\tif( (u.s[3] & 0x7fff) == 0)\n+\t\t{\n+\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )\n+\t\t\treturn(1);\n+\t\t}\n+#endif\n+#ifdef MIEEE\n+\tif( (u.s[0] & 0x7ff0) == 0x7ff0)\n+\t\t{\n+\t\tif( ((u.s[0] & 0x000f) | u.s[1] | u.s[2] | u.s[3]) != 0 )\n+\t\t\treturn(1);\n+\t\t}\n+#endif\n+\treturn(0);\n+\t} /* size int not 4 */\n+\n+#else\n+/* No NANS. */\n+return(0);\n+#endif\n+}\n+#endif\n+\n+\n+/* Return 1 if x is not infinite and is not a NaN. */\n+\n+#if !defined(isfinite)\n+int isfinite(x)\n+double x;\n+{\n+#ifdef INFINITIES\n+union\n+\t{\n+\tdouble d;\n+\tunsigned short s[4];\n+\tunsigned int i[2];\n+\t} u;\n+\n+u.d = x;\n+\n+if( sizeof(int) == 4 )\n+\t{\n+#ifdef IBMPC\n+\tif( (u.i[1] & 0x7ff00000) != 0x7ff00000)\n+\t\treturn 1;\n+#endif\n+#ifdef DEC\n+\tif( (u.s[3] & 0x7fff) != 0)\n+\t\treturn 1;\n+#endif\n+#ifdef MIEEE\n+\tif( (u.i[0] & 0x7ff00000) != 0x7ff00000)\n+\t\treturn 1;\n+#endif\n+\treturn(0);\n+\t}\n+else\n+\t{\n+#ifdef IBMPC\n+\tif( (u.s[3] & 0x7ff0) != 0x7ff0)\n+\t\treturn 1;\n+#endif\n+#ifdef DEC\n+\tif( (u.s[3] & 0x7fff) != 0)\n+\t\treturn 1;\n+#endif\n+#ifdef MIEEE\n+\tif( (u.s[0] & 0x7ff0) != 0x7ff0)\n+\t\treturn 1;\n+#endif\n+\treturn(0);\n+\t}\n+#else\n+/* No INFINITY. */\n+return(1);\n+#endif\n+}\n+#endif\n", + "added_lines": 241, + "deleted_lines": 0, + "source_code": "/*\t\t\t\t\t\t\tisnan()\n *\t\t\t\t\t\t\tsignbit()\n *\t\t\t\t\t\t\tisfinite()\n *\n *\tFloating point numeric utilities\n *\n *\n *\n * SYNOPSIS:\n *\n * double ceil(), floor(), frexp(), ldexp(); --- gone\n * int signbit(), isnan(), isfinite();\n * double x, y;\n * int expnt, n;\n *\n * y = floor(x); -gone \n * y = ceil(x); -gone\n * y = frexp( x, &expnt ); -gone\n * y = ldexp( x, n ); -gone\n * n = signbit(x);\n * n = isnan(x);\n * n = isfinite(x);\n *\n *\n *\n * DESCRIPTION:\n *\n * All four routines return a double precision floating point\n * result.\n *\n * floor() returns the largest integer less than or equal to x.\n * It truncates toward minus infinity.\n *\n * ceil() returns the smallest integer greater than or equal\n * to x. It truncates toward plus infinity.\n *\n * frexp() extracts the exponent from x. It returns an integer\n * power of two to expnt and the significand between 0.5 and 1\n * to y. Thus x = y * 2**expn.\n *\n * ldexp() multiplies x by 2**n.\n *\n * signbit(x) returns 1 if the sign bit of x is 1, else 0.\n *\n * These functions are part of the standard C run time library\n * for many but not all C compilers. The ones supplied are\n * written in C for either DEC or IEEE arithmetic. They should\n * be used only if your compiler library does not already have\n * them.\n *\n * The IEEE versions assume that denormal numbers are implemented\n * in the arithmetic. Some modifications will be required if\n * the arithmetic has abrupt rather than gradual underflow.\n */\n\n\n/*\nCephes Math Library Release 2.3: March, 1995\nCopyright 1984, 1995 by Stephen L. Moshier\n*/\n\n\n#include \"mconf_lite.h\"\n\n#ifdef UNK\n#undef UNK\n#if BIGENDIAN\n#define MIEEE 1\n#else\n#define IBMPC 1\n#endif\n#endif\n\n\n/* Return 1 if the sign bit of x is 1, else 0. */\n\n#if !defined(signbit)\nint signbit(x)\ndouble x;\n{\nunion\n\t{\n\tdouble d;\n\tshort s[4];\n\tint i[2];\n\t} u;\n\nu.d = x;\n\nif( sizeof(int) == 4 )\n\t{\n#ifdef IBMPC\n\treturn( u.i[1] < 0 );\n#endif\n#ifdef DEC\n\treturn( u.s[3] < 0 );\n#endif\n#ifdef MIEEE\n\treturn( u.i[0] < 0 );\n#endif\n\t}\nelse\n\t{\n#ifdef IBMPC\n\treturn( u.s[3] < 0 );\n#endif\n#ifdef DEC\n\treturn( u.s[3] < 0 );\n#endif\n#ifdef MIEEE\n\treturn( u.s[0] < 0 );\n#endif\n\t}\n}\n#endif\n\n/* Return 1 if x is a number that is Not a Number, else return 0. */\n\n#if !defined(isnan)\nint isnan(x)\ndouble x;\n{\n#ifdef NANS\nunion\n\t{\n\tdouble d;\n\tunsigned short s[4];\n\tunsigned int i[2];\n\t} u;\n\nu.d = x;\n\nif( sizeof(int) == 4 )\n\t{\n#ifdef IBMPC\n\tif( ((u.i[1] & 0x7ff00000) == 0x7ff00000)\n\t && (((u.i[1] & 0x000fffff) != 0) || (u.i[0] != 0)))\n\t\treturn 1;\n#endif\n#ifdef DEC\n\tif( (u.s[1] & 0x7fff) == 0)\n\t\t{\n\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )\n\t\t\treturn(1);\n\t\t}\n#endif\n#ifdef MIEEE\n\tif( ((u.i[0] & 0x7ff00000) == 0x7ff00000)\n\t && (((u.i[0] & 0x000fffff) != 0) || (u.i[1] != 0)))\n\t\treturn 1;\n#endif\n\treturn(0);\n\t}\nelse\n\t{ /* size int not 4 */\n#ifdef IBMPC\n\tif( (u.s[3] & 0x7ff0) == 0x7ff0)\n\t\t{\n\t\tif( ((u.s[3] & 0x000f) | u.s[2] | u.s[1] | u.s[0]) != 0 )\n\t\t\treturn(1);\n\t\t}\n#endif\n#ifdef DEC\n\tif( (u.s[3] & 0x7fff) == 0)\n\t\t{\n\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )\n\t\t\treturn(1);\n\t\t}\n#endif\n#ifdef MIEEE\n\tif( (u.s[0] & 0x7ff0) == 0x7ff0)\n\t\t{\n\t\tif( ((u.s[0] & 0x000f) | u.s[1] | u.s[2] | u.s[3]) != 0 )\n\t\t\treturn(1);\n\t\t}\n#endif\n\treturn(0);\n\t} /* size int not 4 */\n\n#else\n/* No NANS. */\nreturn(0);\n#endif\n}\n#endif\n\n\n/* Return 1 if x is not infinite and is not a NaN. */\n\n#if !defined(isfinite)\nint isfinite(x)\ndouble x;\n{\n#ifdef INFINITIES\nunion\n\t{\n\tdouble d;\n\tunsigned short s[4];\n\tunsigned int i[2];\n\t} u;\n\nu.d = x;\n\nif( sizeof(int) == 4 )\n\t{\n#ifdef IBMPC\n\tif( (u.i[1] & 0x7ff00000) != 0x7ff00000)\n\t\treturn 1;\n#endif\n#ifdef DEC\n\tif( (u.s[3] & 0x7fff) != 0)\n\t\treturn 1;\n#endif\n#ifdef MIEEE\n\tif( (u.i[0] & 0x7ff00000) != 0x7ff00000)\n\t\treturn 1;\n#endif\n\treturn(0);\n\t}\nelse\n\t{\n#ifdef IBMPC\n\tif( (u.s[3] & 0x7ff0) != 0x7ff0)\n\t\treturn 1;\n#endif\n#ifdef DEC\n\tif( (u.s[3] & 0x7fff) != 0)\n\t\treturn 1;\n#endif\n#ifdef MIEEE\n\tif( (u.s[0] & 0x7ff0) != 0x7ff0)\n\t\treturn 1;\n#endif\n\treturn(0);\n\t}\n#else\n/* No INFINITY. */\nreturn(1);\n#endif\n}\n#endif\n", + "source_code_before": null, + "methods": [ + { + "name": "signbit", + "long_name": "signbit( x)", + "filename": "isnan.c", + "nloc": 23, + "complexity": 8, + "token_count": 121, + "parameters": [ + "x" + ], + "start_line": 78, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x)", + "filename": "isnan.c", + "nloc": 46, + "complexity": 23, + "token_count": 380, + "parameters": [ + "x" + ], + "start_line": 120, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( x)", + "filename": "isnan.c", + "nloc": 32, + "complexity": 15, + "token_count": 174, + "parameters": [ + "x" + ], + "start_line": 191, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "isfinite", + "long_name": "isfinite( x)", + "filename": "isnan.c", + "nloc": 32, + "complexity": 15, + "token_count": 174, + "parameters": [ + "x" + ], + "start_line": 191, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 50, + "top_nesting_level": 0 + }, + { + "name": "signbit", + "long_name": "signbit( x)", + "filename": "isnan.c", + "nloc": 23, + "complexity": 8, + "token_count": 121, + "parameters": [ + "x" + ], + "start_line": 78, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x)", + "filename": "isnan.c", + "nloc": 46, + "complexity": 23, + "token_count": 380, + "parameters": [ + "x" + ], + "start_line": 120, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 65, + "top_nesting_level": 0 + } + ], + "nloc": 102, + "complexity": 46, + "token_count": 680, + "diff_parsed": { + "added": [ + "/*\t\t\t\t\t\t\tisnan()", + " *\t\t\t\t\t\t\tsignbit()", + " *\t\t\t\t\t\t\tisfinite()", + " *", + " *\tFloating point numeric utilities", + " *", + " *", + " *", + " * SYNOPSIS:", + " *", + " * double ceil(), floor(), frexp(), ldexp(); --- gone", + " * int signbit(), isnan(), isfinite();", + " * double x, y;", + " * int expnt, n;", + " *", + " * y = floor(x); -gone", + " * y = ceil(x); -gone", + " * y = frexp( x, &expnt ); -gone", + " * y = ldexp( x, n ); -gone", + " * n = signbit(x);", + " * n = isnan(x);", + " * n = isfinite(x);", + " *", + " *", + " *", + " * DESCRIPTION:", + " *", + " * All four routines return a double precision floating point", + " * result.", + " *", + " * floor() returns the largest integer less than or equal to x.", + " * It truncates toward minus infinity.", + " *", + " * ceil() returns the smallest integer greater than or equal", + " * to x. It truncates toward plus infinity.", + " *", + " * frexp() extracts the exponent from x. It returns an integer", + " * power of two to expnt and the significand between 0.5 and 1", + " * to y. Thus x = y * 2**expn.", + " *", + " * ldexp() multiplies x by 2**n.", + " *", + " * signbit(x) returns 1 if the sign bit of x is 1, else 0.", + " *", + " * These functions are part of the standard C run time library", + " * for many but not all C compilers. The ones supplied are", + " * written in C for either DEC or IEEE arithmetic. They should", + " * be used only if your compiler library does not already have", + " * them.", + " *", + " * The IEEE versions assume that denormal numbers are implemented", + " * in the arithmetic. Some modifications will be required if", + " * the arithmetic has abrupt rather than gradual underflow.", + " */", + "", + "", + "/*", + "Cephes Math Library Release 2.3: March, 1995", + "Copyright 1984, 1995 by Stephen L. Moshier", + "*/", + "", + "", + "#include \"mconf_lite.h\"", + "", + "#ifdef UNK", + "#undef UNK", + "#if BIGENDIAN", + "#define MIEEE 1", + "#else", + "#define IBMPC 1", + "#endif", + "#endif", + "", + "", + "/* Return 1 if the sign bit of x is 1, else 0. */", + "", + "#if !defined(signbit)", + "int signbit(x)", + "double x;", + "{", + "union", + "\t{", + "\tdouble d;", + "\tshort s[4];", + "\tint i[2];", + "\t} u;", + "", + "u.d = x;", + "", + "if( sizeof(int) == 4 )", + "\t{", + "#ifdef IBMPC", + "\treturn( u.i[1] < 0 );", + "#endif", + "#ifdef DEC", + "\treturn( u.s[3] < 0 );", + "#endif", + "#ifdef MIEEE", + "\treturn( u.i[0] < 0 );", + "#endif", + "\t}", + "else", + "\t{", + "#ifdef IBMPC", + "\treturn( u.s[3] < 0 );", + "#endif", + "#ifdef DEC", + "\treturn( u.s[3] < 0 );", + "#endif", + "#ifdef MIEEE", + "\treturn( u.s[0] < 0 );", + "#endif", + "\t}", + "}", + "#endif", + "", + "/* Return 1 if x is a number that is Not a Number, else return 0. */", + "", + "#if !defined(isnan)", + "int isnan(x)", + "double x;", + "{", + "#ifdef NANS", + "union", + "\t{", + "\tdouble d;", + "\tunsigned short s[4];", + "\tunsigned int i[2];", + "\t} u;", + "", + "u.d = x;", + "", + "if( sizeof(int) == 4 )", + "\t{", + "#ifdef IBMPC", + "\tif( ((u.i[1] & 0x7ff00000) == 0x7ff00000)", + "\t && (((u.i[1] & 0x000fffff) != 0) || (u.i[0] != 0)))", + "\t\treturn 1;", + "#endif", + "#ifdef DEC", + "\tif( (u.s[1] & 0x7fff) == 0)", + "\t\t{", + "\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )", + "\t\t\treturn(1);", + "\t\t}", + "#endif", + "#ifdef MIEEE", + "\tif( ((u.i[0] & 0x7ff00000) == 0x7ff00000)", + "\t && (((u.i[0] & 0x000fffff) != 0) || (u.i[1] != 0)))", + "\t\treturn 1;", + "#endif", + "\treturn(0);", + "\t}", + "else", + "\t{ /* size int not 4 */", + "#ifdef IBMPC", + "\tif( (u.s[3] & 0x7ff0) == 0x7ff0)", + "\t\t{", + "\t\tif( ((u.s[3] & 0x000f) | u.s[2] | u.s[1] | u.s[0]) != 0 )", + "\t\t\treturn(1);", + "\t\t}", + "#endif", + "#ifdef DEC", + "\tif( (u.s[3] & 0x7fff) == 0)", + "\t\t{", + "\t\tif( (u.s[2] | u.s[1] | u.s[0]) != 0 )", + "\t\t\treturn(1);", + "\t\t}", + "#endif", + "#ifdef MIEEE", + "\tif( (u.s[0] & 0x7ff0) == 0x7ff0)", + "\t\t{", + "\t\tif( ((u.s[0] & 0x000f) | u.s[1] | u.s[2] | u.s[3]) != 0 )", + "\t\t\treturn(1);", + "\t\t}", + "#endif", + "\treturn(0);", + "\t} /* size int not 4 */", + "", + "#else", + "/* No NANS. */", + "return(0);", + "#endif", + "}", + "#endif", + "", + "", + "/* Return 1 if x is not infinite and is not a NaN. */", + "", + "#if !defined(isfinite)", + "int isfinite(x)", + "double x;", + "{", + "#ifdef INFINITIES", + "union", + "\t{", + "\tdouble d;", + "\tunsigned short s[4];", + "\tunsigned int i[2];", + "\t} u;", + "", + "u.d = x;", + "", + "if( sizeof(int) == 4 )", + "\t{", + "#ifdef IBMPC", + "\tif( (u.i[1] & 0x7ff00000) != 0x7ff00000)", + "\t\treturn 1;", + "#endif", + "#ifdef DEC", + "\tif( (u.s[3] & 0x7fff) != 0)", + "\t\treturn 1;", + "#endif", + "#ifdef MIEEE", + "\tif( (u.i[0] & 0x7ff00000) != 0x7ff00000)", + "\t\treturn 1;", + "#endif", + "\treturn(0);", + "\t}", + "else", + "\t{", + "#ifdef IBMPC", + "\tif( (u.s[3] & 0x7ff0) != 0x7ff0)", + "\t\treturn 1;", + "#endif", + "#ifdef DEC", + "\tif( (u.s[3] & 0x7fff) != 0)", + "\t\treturn 1;", + "#endif", + "#ifdef MIEEE", + "\tif( (u.s[0] & 0x7ff0) != 0x7ff0)", + "\t\treturn 1;", + "#endif", + "\treturn(0);", + "\t}", + "#else", + "/* No INFINITY. */", + "return(1);", + "#endif", + "}", + "#endif" + ], + "deleted": [] + } + }, + { + "old_path": "scipy_base/matrix_base.py", + "new_path": "scipy_base/matrix_base.py", + "filename": "matrix_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -10,7 +10,7 @@\n from fastumath import *\n from type_check import isscalar\n from index_tricks import mgrid,r_,c_\n-# Elementary Matrices\n+# Elementary matrices\n \n # zeros is from matrixmodule in C\n # ones is from Numeric.py\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\" Basic functions for manipulating 2d arrays\n\n\"\"\"\n\n__all__ = ['diag','eye','fliplr','flipud','rot90']\n \n# These are from Numeric\nimport Matrix\nfrom Numeric import *\nfrom fastumath import *\nfrom type_check import isscalar\nfrom index_tricks import mgrid,r_,c_\n# Elementary matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n \ndef fliplr(m):\n \"\"\" returns a 2-D matrix m with the rows preserved and columns flipped \n in the left/right direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\" returns a 2-D matrix with the columns preserved and rows flipped in\n the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\" returns the matrix found by rotating m by k*90 degrees in the \n counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n \ndef eye(N, M=None, k=0, typecode=None):\n \"\"\" eye returns a N-by-M matrix where the k-th diagonal is all ones, \n and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef diag(v, k=0):\n \"\"\" returns the k-th diagonal if v is a matrix or returns a matrix \n with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "\"\"\" Basic functions for manipulating 2d arrays\n\n\"\"\"\n\n__all__ = ['diag','eye','fliplr','flipud','rot90']\n \n# These are from Numeric\nimport Matrix\nfrom Numeric import *\nfrom fastumath import *\nfrom type_check import isscalar\nfrom index_tricks import mgrid,r_,c_\n# Elementary Matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n \ndef fliplr(m):\n \"\"\" returns a 2-D matrix m with the rows preserved and columns flipped \n in the left/right direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\" returns a 2-D matrix with the columns preserved and rows flipped in\n the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\" returns the matrix found by rotating m by k*90 degrees in the \n counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n \ndef eye(N, M=None, k=0, typecode=None):\n \"\"\" eye returns a N-by-M matrix where the k-th diagonal is all ones, \n and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef diag(v, k=0):\n \"\"\" returns the k-th diagonal if v is a matrix or returns a matrix \n with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "fliplr", + "long_name": "fliplr( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "m" + ], + "start_line": 19, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "flipud", + "long_name": "flipud( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 28, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "rot90", + "long_name": "rot90( m , k = 1 )", + "filename": "matrix_base.py", + "nloc": 9, + "complexity": 5, + "token_count": 78, + "parameters": [ + "m", + "k" + ], + "start_line": 39, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "eye", + "long_name": "eye( N , M = None , k = 0 , typecode = None )", + "filename": "matrix_base.py", + "nloc": 10, + "complexity": 4, + "token_count": 81, + "parameters": [ + "N", + "M", + "k", + "typecode" + ], + "start_line": 52, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "diag", + "long_name": "diag( v , k = 0 )", + "filename": "matrix_base.py", + "nloc": 17, + "complexity": 7, + "token_count": 165, + "parameters": [ + "v", + "k" + ], + "start_line": 66, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 96, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "fliplr", + "long_name": "fliplr( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "m" + ], + "start_line": 19, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "flipud", + "long_name": "flipud( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 28, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "rot90", + "long_name": "rot90( m , k = 1 )", + "filename": "matrix_base.py", + "nloc": 9, + "complexity": 5, + "token_count": 78, + "parameters": [ + "m", + "k" + ], + "start_line": 39, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "eye", + "long_name": "eye( N , M = None , k = 0 , typecode = None )", + "filename": "matrix_base.py", + "nloc": 10, + "complexity": 4, + "token_count": 81, + "parameters": [ + "N", + "M", + "k", + "typecode" + ], + "start_line": 52, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "diag", + "long_name": "diag( v , k = 0 )", + "filename": "matrix_base.py", + "nloc": 17, + "complexity": 7, + "token_count": 165, + "parameters": [ + "v", + "k" + ], + "start_line": 66, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 96, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 66, + "complexity": 22, + "token_count": 503, + "diff_parsed": { + "added": [ + "# Elementary matrices" + ], + "deleted": [ + "# Elementary Matrices" + ] + } + }, + { + "old_path": null, + "new_path": "scipy_base/mconf_lite_BE.h", + "filename": "mconf_lite_BE.h", + "extension": "h", + "change_type": "ADD", + "diff": "@@ -0,0 +1,119 @@\n+/*\t\t\t\t\t\t\tmconf_lite.h\n+ *\n+ *\tCommon include file for math routines\n+ *\n+ *\n+ *\n+ * SYNOPSIS:\n+ *\n+ * #include \"mconf_lite.h\"\n+ *\n+ *\n+ *\n+ * DESCRIPTION:\n+ *\n+ * The file also includes a conditional assembly definition\n+ * for the type of computer arithmetic (IEEE, DEC, Motorola\n+ * IEEE, or UNKnown).\n+ * \n+ * For Digital Equipment PDP-11 and VAX computers, certain\n+ * IBM systems, and others that use numbers with a 56-bit\n+ * significand, the symbol DEC should be defined. In this\n+ * mode, most floating point constants are given as arrays\n+ * of octal integers to eliminate decimal to binary conversion\n+ * errors that might be introduced by the compiler.\n+ *\n+ * For little-endian computers, such as IBM PC, that follow the\n+ * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n+ * Std 754-1985), the symbol IBMPC should be defined. These\n+ * numbers have 53-bit significands. In this mode, constants\n+ * are provided as arrays of hexadecimal 16 bit integers.\n+ *\n+ * Big-endian IEEE format is denoted MIEEE. On some RISC\n+ * systems such as Sun SPARC, double precision constants\n+ * must be stored on 8-byte address boundaries. Since integer\n+ * arrays may be aligned differently, the MIEEE configuration\n+ * may fail on such machines.\n+ *\n+ * To accommodate other types of computer arithmetic, all\n+ * constants are also provided in a normal decimal radix\n+ * which one can hope are correctly converted to a suitable\n+ * format by the available C language compiler. To invoke\n+ * this mode, define the symbol UNK.\n+ *\n+ * An important difference among these modes is a predefined\n+ * set of machine arithmetic constants for each. The numbers\n+ * MACHEP (the machine roundoff error), MAXNUM (largest number\n+ * represented), and several other parameters are preset by\n+ * the configuration symbol. Check the file const.c to\n+ * ensure that these values are correct for your computer.\n+ *\n+ * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n+ * may fail on many systems. Verify that they are supposed\n+ * to work on your computer.\n+ */\n+\f\n+/*\n+Cephes Math Library Release 2.3: June, 1995\n+Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n+\n+Modified to handle just the parts necessary for isnan to work.\n+*/\n+\n+\n+/* Type of computer arithmetic */\n+\n+/* PDP-11, Pro350, VAX:\n+ */\n+/* #define DEC 1 */\n+\n+/* Not sure about these pdp defines */\n+#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n+ defined(__decvax__) || defined(pro350) || defined(pdp11)\n+#define DEC 1 \n+\n+#elif defined(ns32000) || defined(sun386) || \\\n+ defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n+ defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n+ defined(sequent) || defined(i386) || \\\n+ defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n+#define IBMPC 1 /* Intel IEEE, low order words come first */\n+#define BIGENDIAN 0\n+\n+#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n+ defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n+ defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n+ defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n+ defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n+ defined(__hp9000) || defined(__hp9000s300) || \\\n+ defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n+ defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n+ defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n+#define MIEEE 1 /* Motorola IEEE, high order words come first */\n+#define BIGENDIAN 1\n+\n+#else \n+#define UNK 1 /* Machine not known\n+#define BIGENDIAN 1 /* This is a BE file */\n+#endif\n+\n+\n+/* Define to ask for infinity support, else undefine. */\n+#define INFINITIES 1\n+\n+/* Define to ask for support of numbers that are Not-a-Number,\n+ else undefine. This may automatically define INFINITIES in some files. */\n+#define NANS 1\n+\n+/* Define to distinguish between -0.0 and +0.0. */\n+#define MINUSZERO 1\n+\n+#if !defined(signbit)\n+int signbit(double);\n+#endif\n+#if !defined(isnan)\n+int isnan(double);\n+#endif\n+#if !defined(isfinite)\n+int isfinite(double);\n+#endif\n", + "added_lines": 119, + "deleted_lines": 0, + "source_code": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known\n#define BIGENDIAN 1 /* This is a BE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "source_code_before": null, + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 3, + "complexity": 0, + "token_count": 18, + "diff_parsed": { + "added": [ + "/*\t\t\t\t\t\t\tmconf_lite.h", + " *", + " *\tCommon include file for math routines", + " *", + " *", + " *", + " * SYNOPSIS:", + " *", + " * #include \"mconf_lite.h\"", + " *", + " *", + " *", + " * DESCRIPTION:", + " *", + " * The file also includes a conditional assembly definition", + " * for the type of computer arithmetic (IEEE, DEC, Motorola", + " * IEEE, or UNKnown).", + " *", + " * For Digital Equipment PDP-11 and VAX computers, certain", + " * IBM systems, and others that use numbers with a 56-bit", + " * significand, the symbol DEC should be defined. In this", + " * mode, most floating point constants are given as arrays", + " * of octal integers to eliminate decimal to binary conversion", + " * errors that might be introduced by the compiler.", + " *", + " * For little-endian computers, such as IBM PC, that follow the", + " * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE", + " * Std 754-1985), the symbol IBMPC should be defined. These", + " * numbers have 53-bit significands. In this mode, constants", + " * are provided as arrays of hexadecimal 16 bit integers.", + " *", + " * Big-endian IEEE format is denoted MIEEE. On some RISC", + " * systems such as Sun SPARC, double precision constants", + " * must be stored on 8-byte address boundaries. Since integer", + " * arrays may be aligned differently, the MIEEE configuration", + " * may fail on such machines.", + " *", + " * To accommodate other types of computer arithmetic, all", + " * constants are also provided in a normal decimal radix", + " * which one can hope are correctly converted to a suitable", + " * format by the available C language compiler. To invoke", + " * this mode, define the symbol UNK.", + " *", + " * An important difference among these modes is a predefined", + " * set of machine arithmetic constants for each. The numbers", + " * MACHEP (the machine roundoff error), MAXNUM (largest number", + " * represented), and several other parameters are preset by", + " * the configuration symbol. Check the file const.c to", + " * ensure that these values are correct for your computer.", + " *", + " * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL", + " * may fail on many systems. Verify that they are supposed", + " * to work on your computer.", + " */", + "", + "/*", + "Cephes Math Library Release 2.3: June, 1995", + "Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier", + "", + "Modified to handle just the parts necessary for isnan to work.", + "*/", + "", + "", + "/* Type of computer arithmetic */", + "", + "/* PDP-11, Pro350, VAX:", + " */", + "/* #define DEC 1 */", + "", + "/* Not sure about these pdp defines */", + "#if defined(vax) || defined(__vax__) || defined(decvax) || \\", + " defined(__decvax__) || defined(pro350) || defined(pdp11)", + "#define DEC 1", + "", + "#elif defined(ns32000) || defined(sun386) || \\", + " defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\", + " defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\", + " defined(sequent) || defined(i386) || \\", + " defined(__ns32000__) || defined(__sun386__) || defined(__i386__)", + "#define IBMPC 1 /* Intel IEEE, low order words come first */", + "#define BIGENDIAN 0", + "", + "#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\", + " defined(is68k) || defined(tahoe) || defined(ibm032) || \\", + " defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\", + " defined(__convex__) || defined(DGUX) || defined(hppa) || \\", + " defined(apollo) || defined(_CRAY) || defined(__hppa) || \\", + " defined(__hp9000) || defined(__hp9000s300) || \\", + " defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\", + " defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\", + " defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT)", + "#define MIEEE 1 /* Motorola IEEE, high order words come first */", + "#define BIGENDIAN 1", + "", + "#else", + "#define UNK 1 /* Machine not known", + "#define BIGENDIAN 1 /* This is a BE file */", + "#endif", + "", + "", + "/* Define to ask for infinity support, else undefine. */", + "#define INFINITIES 1", + "", + "/* Define to ask for support of numbers that are Not-a-Number,", + " else undefine. This may automatically define INFINITIES in some files. */", + "#define NANS 1", + "", + "/* Define to distinguish between -0.0 and +0.0. */", + "#define MINUSZERO 1", + "", + "#if !defined(signbit)", + "int signbit(double);", + "#endif", + "#if !defined(isnan)", + "int isnan(double);", + "#endif", + "#if !defined(isfinite)", + "int isfinite(double);", + "#endif" + ], + "deleted": [] + } + }, + { + "old_path": null, + "new_path": "scipy_base/mconf_lite_LE.h", + "filename": "mconf_lite_LE.h", + "extension": "h", + "change_type": "ADD", + "diff": "@@ -0,0 +1,119 @@\n+/*\t\t\t\t\t\t\tmconf_lite.h\n+ *\n+ *\tCommon include file for math routines\n+ *\n+ *\n+ *\n+ * SYNOPSIS:\n+ *\n+ * #include \"mconf_lite.h\"\n+ *\n+ *\n+ *\n+ * DESCRIPTION:\n+ *\n+ * The file also includes a conditional assembly definition\n+ * for the type of computer arithmetic (IEEE, DEC, Motorola\n+ * IEEE, or UNKnown).\n+ * \n+ * For Digital Equipment PDP-11 and VAX computers, certain\n+ * IBM systems, and others that use numbers with a 56-bit\n+ * significand, the symbol DEC should be defined. In this\n+ * mode, most floating point constants are given as arrays\n+ * of octal integers to eliminate decimal to binary conversion\n+ * errors that might be introduced by the compiler.\n+ *\n+ * For little-endian computers, such as IBM PC, that follow the\n+ * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n+ * Std 754-1985), the symbol IBMPC should be defined. These\n+ * numbers have 53-bit significands. In this mode, constants\n+ * are provided as arrays of hexadecimal 16 bit integers.\n+ *\n+ * Big-endian IEEE format is denoted MIEEE. On some RISC\n+ * systems such as Sun SPARC, double precision constants\n+ * must be stored on 8-byte address boundaries. Since integer\n+ * arrays may be aligned differently, the MIEEE configuration\n+ * may fail on such machines.\n+ *\n+ * To accommodate other types of computer arithmetic, all\n+ * constants are also provided in a normal decimal radix\n+ * which one can hope are correctly converted to a suitable\n+ * format by the available C language compiler. To invoke\n+ * this mode, define the symbol UNK.\n+ *\n+ * An important difference among these modes is a predefined\n+ * set of machine arithmetic constants for each. The numbers\n+ * MACHEP (the machine roundoff error), MAXNUM (largest number\n+ * represented), and several other parameters are preset by\n+ * the configuration symbol. Check the file const.c to\n+ * ensure that these values are correct for your computer.\n+ *\n+ * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n+ * may fail on many systems. Verify that they are supposed\n+ * to work on your computer.\n+ */\n+\f\n+/*\n+Cephes Math Library Release 2.3: June, 1995\n+Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n+\n+Modified to handle just the parts necessary for isnan to work.\n+*/\n+\n+\n+/* Type of computer arithmetic */\n+\n+/* PDP-11, Pro350, VAX:\n+ */\n+/* #define DEC 1 */\n+\n+/* Not sure about these pdp defines */\n+#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n+ defined(__decvax__) || defined(pro350) || defined(pdp11)\n+#define DEC 1 \n+\n+#elif defined(ns32000) || defined(sun386) || \\\n+ defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n+ defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n+ defined(sequent) || defined(i386) || \\\n+ defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n+#define IBMPC 1 /* Intel IEEE, low order words come first */\n+#define BIGENDIAN 0\n+\n+#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n+ defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n+ defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n+ defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n+ defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n+ defined(__hp9000) || defined(__hp9000s300) || \\\n+ defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n+ defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n+ defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n+#define MIEEE 1 /* Motorola IEEE, high order words come first */\n+#define BIGENDIAN 1\n+\n+#else \n+#define UNK 1 /* Machine not known\n+#define BIGENDIAN 0 /* This is a LE file */\n+#endif\n+\n+\n+/* Define to ask for infinity support, else undefine. */\n+#define INFINITIES 1\n+\n+/* Define to ask for support of numbers that are Not-a-Number,\n+ else undefine. This may automatically define INFINITIES in some files. */\n+#define NANS 1\n+\n+/* Define to distinguish between -0.0 and +0.0. */\n+#define MINUSZERO 1\n+\n+#if !defined(signbit)\n+int signbit(double);\n+#endif\n+#if !defined(isnan)\n+int isnan(double);\n+#endif\n+#if !defined(isfinite)\n+int isfinite(double);\n+#endif\n", + "added_lines": 119, + "deleted_lines": 0, + "source_code": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known\n#define BIGENDIAN 0 /* This is a LE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "source_code_before": null, + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 3, + "complexity": 0, + "token_count": 18, + "diff_parsed": { + "added": [ + "/*\t\t\t\t\t\t\tmconf_lite.h", + " *", + " *\tCommon include file for math routines", + " *", + " *", + " *", + " * SYNOPSIS:", + " *", + " * #include \"mconf_lite.h\"", + " *", + " *", + " *", + " * DESCRIPTION:", + " *", + " * The file also includes a conditional assembly definition", + " * for the type of computer arithmetic (IEEE, DEC, Motorola", + " * IEEE, or UNKnown).", + " *", + " * For Digital Equipment PDP-11 and VAX computers, certain", + " * IBM systems, and others that use numbers with a 56-bit", + " * significand, the symbol DEC should be defined. In this", + " * mode, most floating point constants are given as arrays", + " * of octal integers to eliminate decimal to binary conversion", + " * errors that might be introduced by the compiler.", + " *", + " * For little-endian computers, such as IBM PC, that follow the", + " * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE", + " * Std 754-1985), the symbol IBMPC should be defined. These", + " * numbers have 53-bit significands. In this mode, constants", + " * are provided as arrays of hexadecimal 16 bit integers.", + " *", + " * Big-endian IEEE format is denoted MIEEE. On some RISC", + " * systems such as Sun SPARC, double precision constants", + " * must be stored on 8-byte address boundaries. Since integer", + " * arrays may be aligned differently, the MIEEE configuration", + " * may fail on such machines.", + " *", + " * To accommodate other types of computer arithmetic, all", + " * constants are also provided in a normal decimal radix", + " * which one can hope are correctly converted to a suitable", + " * format by the available C language compiler. To invoke", + " * this mode, define the symbol UNK.", + " *", + " * An important difference among these modes is a predefined", + " * set of machine arithmetic constants for each. The numbers", + " * MACHEP (the machine roundoff error), MAXNUM (largest number", + " * represented), and several other parameters are preset by", + " * the configuration symbol. Check the file const.c to", + " * ensure that these values are correct for your computer.", + " *", + " * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL", + " * may fail on many systems. Verify that they are supposed", + " * to work on your computer.", + " */", + "", + "/*", + "Cephes Math Library Release 2.3: June, 1995", + "Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier", + "", + "Modified to handle just the parts necessary for isnan to work.", + "*/", + "", + "", + "/* Type of computer arithmetic */", + "", + "/* PDP-11, Pro350, VAX:", + " */", + "/* #define DEC 1 */", + "", + "/* Not sure about these pdp defines */", + "#if defined(vax) || defined(__vax__) || defined(decvax) || \\", + " defined(__decvax__) || defined(pro350) || defined(pdp11)", + "#define DEC 1", + "", + "#elif defined(ns32000) || defined(sun386) || \\", + " defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\", + " defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\", + " defined(sequent) || defined(i386) || \\", + " defined(__ns32000__) || defined(__sun386__) || defined(__i386__)", + "#define IBMPC 1 /* Intel IEEE, low order words come first */", + "#define BIGENDIAN 0", + "", + "#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\", + " defined(is68k) || defined(tahoe) || defined(ibm032) || \\", + " defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\", + " defined(__convex__) || defined(DGUX) || defined(hppa) || \\", + " defined(apollo) || defined(_CRAY) || defined(__hppa) || \\", + " defined(__hp9000) || defined(__hp9000s300) || \\", + " defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\", + " defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\", + " defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT)", + "#define MIEEE 1 /* Motorola IEEE, high order words come first */", + "#define BIGENDIAN 1", + "", + "#else", + "#define UNK 1 /* Machine not known", + "#define BIGENDIAN 0 /* This is a LE file */", + "#endif", + "", + "", + "/* Define to ask for infinity support, else undefine. */", + "#define INFINITIES 1", + "", + "/* Define to ask for support of numbers that are Not-a-Number,", + " else undefine. This may automatically define INFINITIES in some files. */", + "#define NANS 1", + "", + "/* Define to distinguish between -0.0 and +0.0. */", + "#define MINUSZERO 1", + "", + "#if !defined(signbit)", + "int signbit(double);", + "#endif", + "#if !defined(isnan)", + "int isnan(double);", + "#endif", + "#if !defined(isfinite)", + "int isfinite(double);", + "#endif" + ], + "deleted": [] + } + }, + { + "old_path": "scipy_base/setup_scipy_base.py", + "new_path": "scipy_base/setup_scipy_base.py", + "filename": "setup_scipy_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,9 +1,10 @@\n #!/usr/bin/env python\n \n-import os\n+import os, sys\n from glob import glob\n from scipy_distutils.core import Extension\n from scipy_distutils.misc_util import get_path, default_config_dict,dot_join\n+import shutil\n \n def configuration(parent_package=''):\n parent_path = parent_package\n@@ -20,11 +21,19 @@ def configuration(parent_package=''):\n config['package_dir']['scipy_base.tests'] = test_path\n \n # fastumath module\n- sources = ['fastumathmodule.c']\n+ sources = ['fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n- \n+\n+ # Test to see if big or little-endian machine and get correct default\n+ # mconf.h module.\n+ if sys.byteorder == \"little\":\n+ print \"### Little Endian detected ####\"\n+ shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n+ else:\n+ print \"### Big Endian detected ####\"\n+ shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n \n return config\n \n", + "added_lines": 12, + "deleted_lines": 3, + "source_code": "#!/usr/bin/env python\n\nimport os, sys\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\nimport shutil\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # fastumath module\n sources = ['fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n\n # Test to see if big or little-endian machine and get correct default\n # mconf.h module.\n if sys.byteorder == \"little\":\n print \"### Little Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n else:\n print \"### Big Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "source_code_before": "#!/usr/bin/env python\n\nimport os\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # fastumath module\n sources = ['fastumathmodule.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n \n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 16, + "complexity": 3, + "token_count": 131, + "parameters": [ + "parent_package" + ], + "start_line": 8, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "nloc": 30, + "complexity": 4, + "token_count": 243, + "diff_parsed": { + "added": [ + "import os, sys", + "import shutil", + " sources = ['fastumathmodule.c','isnan.c']", + "", + " # Test to see if big or little-endian machine and get correct default", + " # mconf.h module.", + " if sys.byteorder == \"little\":", + " print \"### Little Endian detected ####\"", + " shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))", + " else:", + " print \"### Big Endian detected ####\"", + " shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))" + ], + "deleted": [ + "import os", + " sources = ['fastumathmodule.c']", + "" + ] + } + }, + { + "old_path": "scipy_base/tests/test_type_check.py", + "new_path": "scipy_base/tests/test_type_check.py", + "filename": "test_type_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -57,19 +57,19 @@ def check_fail(self):\n res = isreal(z)\n assert_array_equal(res,[0,1,1])\n \n-class test_array_iscomplex(unittest.TestCase):\n+class test_iscomplexobj(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n- assert(not array_iscomplex(z))\n+ assert(not iscomplexobj(z))\n z = array([-1j,0,-1])\n- assert(array_iscomplex(z))\n+ assert(iscomplexobj(z))\n \n-class test_array_isreal(unittest.TestCase):\n+class test_isrealobj(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n- assert(array_isreal(z))\n+ assert(isrealobj(z))\n z = array([-1j,0,-1])\n- assert(not array_isreal(z))\n+ assert(not isrealobj(z))\n \n class test_isnan(unittest.TestCase):\n def check_goodvalues(self):\n@@ -178,12 +178,12 @@ class test_real_if_close(unittest.TestCase):\n def check_basic(self):\n a = rand(10)\n b = real_if_close(a+1e-15j)\n- assert(array_isreal(b))\n+ assert(isrealobj(b))\n assert_array_equal(a,b)\n b = real_if_close(a+1e-7j)\n- assert(array_iscomplex(b))\n+ assert(iscomplexobj(b))\n b = real_if_close(a+1e-7j,tol=1e-6)\n- assert(array_isreal(b))\n+ assert(isrealobj(b))\n \n \n #-----------------------------------------------------------------------------\n@@ -195,8 +195,8 @@ def test_suite(level=1):\n suites.append( unittest.makeSuite(test_real_if_close,'check_') )\n suites.append( unittest.makeSuite(test_real,'check_') )\n suites.append( unittest.makeSuite(test_imag,'check_') )\n- suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )\n- suites.append( unittest.makeSuite(test_array_isreal,'check_') ) \n+ suites.append( unittest.makeSuite(test_iscomplexobj,'check_') )\n+ suites.append( unittest.makeSuite(test_isrealobj,'check_') ) \n suites.append( unittest.makeSuite(test_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_isnan,'check_') )\n", + "added_lines": 11, + "deleted_lines": 11, + "source_code": "# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.type_check import *\n \nclass test_isscalar(unittest.TestCase):\n def check_basic(self):\n assert(isscalar(3))\n assert(not isscalar([3]))\n assert(not isscalar((3,)))\n assert(isscalar(3j))\n assert(isscalar(10L))\n assert(isscalar(4.0))\n\nclass test_real(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(y,real(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.real,real(y))\n\nclass test_imag(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(0,imag(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.imag,imag(y))\n\nclass test_iscomplex(unittest.TestCase):\n def check_fail(self):\n z = array([-1,0,1])\n res = iscomplex(z)\n assert(not sometrue(res))\n def check_pass(self):\n z = array([-1j,1,0])\n res = iscomplex(z)\n assert_array_equal(res,[1,0,0])\n\nclass test_isreal(unittest.TestCase):\n def check_pass(self):\n z = array([-1,0,1j])\n res = isreal(z)\n assert_array_equal(res,[1,1,0])\n def check_fail(self):\n z = array([-1j,1,0])\n res = isreal(z)\n assert_array_equal(res,[0,1,1])\n\nclass test_iscomplexobj(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(not iscomplexobj(z))\n z = array([-1j,0,-1])\n assert(iscomplexobj(z))\n\nclass test_isrealobj(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(isrealobj(z))\n z = array([-1j,0,-1])\n assert(not isrealobj(z))\n\nclass test_isnan(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isnan(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isnan(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isnan(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isnan(array((0.,))/0.) == 1)\n #def check_qnan(self): log(-1) return pi*j now\n # assert(isnan(log(-1.)) == 1)\n def check_integer(self):\n assert(isnan(1) == 0)\n def check_complex(self):\n assert(isnan(1+1j) == 0)\n def check_complex1(self):\n assert(isnan(array(0+0j)/0.) == 1)\n \nclass test_isfinite(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isfinite(z) == 1\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isfinite(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isfinite(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isfinite(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isfinite(log(-1.)) == 0)\n def check_integer(self):\n assert(isfinite(1) == 1)\n def check_complex(self):\n assert(isfinite(1+1j) == 1)\n def check_complex1(self):\n assert(isfinite(array(1+1j)/0.) == 0)\n \nclass test_isinf(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isinf(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isinf(array((1.,))/0.) == 1)\n def check_posinf_scalar(self): \n assert(isinf(array(1.,)/0.) == 1)\n def check_neginf(self): \n assert(isinf(array((-1.,))/0.) == 1)\n def check_neginf_scalar(self): \n assert(isinf(array(-1.)/0.) == 1)\n def check_ind(self): \n assert(isinf(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isinf(log(-1.)) == 0)\n # assert(isnan(log(-1.)) == 1)\n\nclass test_isposinf(unittest.TestCase):\n def check_generic(self):\n vals = isposinf(array((-1.,0,1))/0.)\n assert(vals[0] == 0)\n assert(vals[1] == 0)\n assert(vals[2] == 1)\n\nclass test_isneginf(unittest.TestCase):\n def check_generic(self):\n vals = isneginf(array((-1.,0,1))/0.)\n assert(vals[0] == 1)\n assert(vals[1] == 0)\n assert(vals[2] == 0)\n\nclass test_nan_to_num(unittest.TestCase):\n def check_generic(self):\n vals = nan_to_num(array((-1.,0,1))/0.)\n assert(vals[0] < -1e10 and isfinite(vals[0]))\n assert(vals[1] == 0)\n assert(vals[2] > 1e10 and isfinite(vals[2]))\n def check_integer(self):\n vals = nan_to_num(1)\n assert(vals == 1)\n def check_complex_good(self):\n vals = nan_to_num(1+1j)\n assert(vals == 1+1j)\n def check_complex_bad(self):\n v = 1+1j\n v += array(0+1.j)/0.\n vals = nan_to_num(v)\n # !! This is actually (unexpectedly) zero\n assert(vals.imag > 1e10 and isfinite(vals))\n def check_complex_bad2(self):\n v = 1+1j\n v += array(-1+1.j)/0.\n vals = nan_to_num(v)\n assert(isfinite(vals)) \n #assert(vals.imag > 1e10 and isfinite(vals)) \n # !! This is actually (unexpectedly) positive\n # !! inf. Comment out for now, and see if it\n # !! changes\n #assert(vals.real < -1e10 and isfinite(vals)) \n\n\nclass test_real_if_close(unittest.TestCase):\n def check_basic(self):\n a = rand(10)\n b = real_if_close(a+1e-15j)\n assert(isrealobj(b))\n assert_array_equal(a,b)\n b = real_if_close(a+1e-7j)\n assert(iscomplexobj(b))\n b = real_if_close(a+1e-7j,tol=1e-6)\n assert(isrealobj(b))\n\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_isscalar,'check_') )\n suites.append( unittest.makeSuite(test_real_if_close,'check_') )\n suites.append( unittest.makeSuite(test_real,'check_') )\n suites.append( unittest.makeSuite(test_imag,'check_') )\n suites.append( unittest.makeSuite(test_iscomplexobj,'check_') )\n suites.append( unittest.makeSuite(test_isrealobj,'check_') ) \n suites.append( unittest.makeSuite(test_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_isnan,'check_') )\n suites.append( unittest.makeSuite(test_isfinite,'check_') )\n suites.append( unittest.makeSuite(test_isinf,'check_') )\n suites.append( unittest.makeSuite(test_isposinf,'check_') ) \n suites.append( unittest.makeSuite(test_isneginf,'check_') )\n suites.append( unittest.makeSuite(test_nan_to_num,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "# only for short term testing\nimport sys\nsys.path.insert(0,'../..')\n\nimport unittest\nfrom scipy_base.testing import assert_array_equal, assert_equal, rand\nfrom scipy_base.testing import assert_almost_equal, assert_array_almost_equal \n\nfrom scipy_base import *\n# This won't be needed when we get scipy_base finished.\nfrom scipy_base.type_check import *\n \nclass test_isscalar(unittest.TestCase):\n def check_basic(self):\n assert(isscalar(3))\n assert(not isscalar([3]))\n assert(not isscalar((3,)))\n assert(isscalar(3j))\n assert(isscalar(10L))\n assert(isscalar(4.0))\n\nclass test_real(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(y,real(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.real,real(y))\n\nclass test_imag(unittest.TestCase):\n def check_real(self):\n y = rand(10,)\n assert_array_equal(0,imag(y))\n\n def check_cmplx(self):\n y = rand(10,)+1j*rand(10,)\n assert_array_equal(y.imag,imag(y))\n\nclass test_iscomplex(unittest.TestCase):\n def check_fail(self):\n z = array([-1,0,1])\n res = iscomplex(z)\n assert(not sometrue(res))\n def check_pass(self):\n z = array([-1j,1,0])\n res = iscomplex(z)\n assert_array_equal(res,[1,0,0])\n\nclass test_isreal(unittest.TestCase):\n def check_pass(self):\n z = array([-1,0,1j])\n res = isreal(z)\n assert_array_equal(res,[1,1,0])\n def check_fail(self):\n z = array([-1j,1,0])\n res = isreal(z)\n assert_array_equal(res,[0,1,1])\n\nclass test_array_iscomplex(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(not array_iscomplex(z))\n z = array([-1j,0,-1])\n assert(array_iscomplex(z))\n\nclass test_array_isreal(unittest.TestCase):\n def check_basic(self):\n z = array([-1,0,1])\n assert(array_isreal(z))\n z = array([-1j,0,-1])\n assert(not array_isreal(z))\n\nclass test_isnan(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isnan(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isnan(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isnan(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isnan(array((0.,))/0.) == 1)\n #def check_qnan(self): log(-1) return pi*j now\n # assert(isnan(log(-1.)) == 1)\n def check_integer(self):\n assert(isnan(1) == 0)\n def check_complex(self):\n assert(isnan(1+1j) == 0)\n def check_complex1(self):\n assert(isnan(array(0+0j)/0.) == 1)\n \nclass test_isfinite(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isfinite(z) == 1\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isfinite(array((1.,))/0.) == 0)\n def check_neginf(self): \n assert(isfinite(array((-1.,))/0.) == 0)\n def check_ind(self): \n assert(isfinite(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isfinite(log(-1.)) == 0)\n def check_integer(self):\n assert(isfinite(1) == 1)\n def check_complex(self):\n assert(isfinite(1+1j) == 1)\n def check_complex1(self):\n assert(isfinite(array(1+1j)/0.) == 0)\n \nclass test_isinf(unittest.TestCase):\n def check_goodvalues(self):\n z = array((-1.,0.,1.))\n res = isinf(z) == 0\n assert(alltrue(res)) \n def check_posinf(self): \n assert(isinf(array((1.,))/0.) == 1)\n def check_posinf_scalar(self): \n assert(isinf(array(1.,)/0.) == 1)\n def check_neginf(self): \n assert(isinf(array((-1.,))/0.) == 1)\n def check_neginf_scalar(self): \n assert(isinf(array(-1.)/0.) == 1)\n def check_ind(self): \n assert(isinf(array((0.,))/0.) == 0)\n #def check_qnan(self): \n # assert(isinf(log(-1.)) == 0)\n # assert(isnan(log(-1.)) == 1)\n\nclass test_isposinf(unittest.TestCase):\n def check_generic(self):\n vals = isposinf(array((-1.,0,1))/0.)\n assert(vals[0] == 0)\n assert(vals[1] == 0)\n assert(vals[2] == 1)\n\nclass test_isneginf(unittest.TestCase):\n def check_generic(self):\n vals = isneginf(array((-1.,0,1))/0.)\n assert(vals[0] == 1)\n assert(vals[1] == 0)\n assert(vals[2] == 0)\n\nclass test_nan_to_num(unittest.TestCase):\n def check_generic(self):\n vals = nan_to_num(array((-1.,0,1))/0.)\n assert(vals[0] < -1e10 and isfinite(vals[0]))\n assert(vals[1] == 0)\n assert(vals[2] > 1e10 and isfinite(vals[2]))\n def check_integer(self):\n vals = nan_to_num(1)\n assert(vals == 1)\n def check_complex_good(self):\n vals = nan_to_num(1+1j)\n assert(vals == 1+1j)\n def check_complex_bad(self):\n v = 1+1j\n v += array(0+1.j)/0.\n vals = nan_to_num(v)\n # !! This is actually (unexpectedly) zero\n assert(vals.imag > 1e10 and isfinite(vals))\n def check_complex_bad2(self):\n v = 1+1j\n v += array(-1+1.j)/0.\n vals = nan_to_num(v)\n assert(isfinite(vals)) \n #assert(vals.imag > 1e10 and isfinite(vals)) \n # !! This is actually (unexpectedly) positive\n # !! inf. Comment out for now, and see if it\n # !! changes\n #assert(vals.real < -1e10 and isfinite(vals)) \n\n\nclass test_real_if_close(unittest.TestCase):\n def check_basic(self):\n a = rand(10)\n b = real_if_close(a+1e-15j)\n assert(array_isreal(b))\n assert_array_equal(a,b)\n b = real_if_close(a+1e-7j)\n assert(array_iscomplex(b))\n b = real_if_close(a+1e-7j,tol=1e-6)\n assert(array_isreal(b))\n\n\n#-----------------------------------------------------------------------------\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_isscalar,'check_') )\n suites.append( unittest.makeSuite(test_real_if_close,'check_') )\n suites.append( unittest.makeSuite(test_real,'check_') )\n suites.append( unittest.makeSuite(test_imag,'check_') )\n suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_array_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_iscomplex,'check_') )\n suites.append( unittest.makeSuite(test_isreal,'check_') ) \n suites.append( unittest.makeSuite(test_isnan,'check_') )\n suites.append( unittest.makeSuite(test_isfinite,'check_') )\n suites.append( unittest.makeSuite(test_isinf,'check_') )\n suites.append( unittest.makeSuite(test_isposinf,'check_') ) \n suites.append( unittest.makeSuite(test_isneginf,'check_') )\n suites.append( unittest.makeSuite(test_nan_to_num,'check_') )\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 7, + "complexity": 1, + "token_count": 56, + "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_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 23, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 51, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 95, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 99, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 107, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 111, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 115, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 119, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_posinf_scalar", + "long_name": "check_posinf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 123, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf_scalar", + "long_name": "check_neginf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 141, + "end_line": 145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 153, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_good", + "long_name": "check_complex_good( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 156, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad", + "long_name": "check_complex_bad( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 2, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad2", + "long_name": "check_complex_bad2( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 9, + "complexity": 1, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_type_check.py", + "nloc": 19, + "complexity": 2, + "token_count": 208, + "parameters": [ + "level" + ], + "start_line": 191, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 212, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 7, + "complexity": 1, + "token_count": 56, + "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_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 23, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 27, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_real", + "long_name": "check_real( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_cmplx", + "long_name": "check_cmplx( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_pass", + "long_name": "check_pass( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 51, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_fail", + "long_name": "check_fail( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 55, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 68, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 75, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 82, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 83, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 95, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 99, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self" + ], + "start_line": 107, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex", + "long_name": "check_complex( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_complex1", + "long_name": "check_complex1( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 111, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_goodvalues", + "long_name": "check_goodvalues( self )", + "filename": "test_type_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self" + ], + "start_line": 115, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_posinf", + "long_name": "check_posinf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 119, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_posinf_scalar", + "long_name": "check_posinf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 121, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf", + "long_name": "check_neginf( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 123, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_neginf_scalar", + "long_name": "check_neginf_scalar( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_ind", + "long_name": "check_ind( self )", + "filename": "test_type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self" + ], + "start_line": 141, + "end_line": 145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_generic", + "long_name": "check_generic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 69, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_integer", + "long_name": "check_integer( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 153, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_good", + "long_name": "check_complex_good( self )", + "filename": "test_type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self" + ], + "start_line": 156, + "end_line": 158, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad", + "long_name": "check_complex_bad( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 2, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 159, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_complex_bad2", + "long_name": "check_complex_bad2( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 9, + "complexity": 1, + "token_count": 74, + "parameters": [ + "self" + ], + "start_line": 178, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_type_check.py", + "nloc": 19, + "complexity": 2, + "token_count": 208, + "parameters": [ + "level" + ], + "start_line": 191, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 212, + "end_line": 216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_type_check.py", + "nloc": 19, + "complexity": 2, + "token_count": 208, + "parameters": [ + "level" + ], + "start_line": 191, + "end_line": 210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "check_basic", + "long_name": "check_basic( self )", + "filename": "test_type_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "nloc": 178, + "complexity": 45, + "token_count": 1672, + "diff_parsed": { + "added": [ + "class test_iscomplexobj(unittest.TestCase):", + " assert(not iscomplexobj(z))", + " assert(iscomplexobj(z))", + "class test_isrealobj(unittest.TestCase):", + " assert(isrealobj(z))", + " assert(not isrealobj(z))", + " assert(isrealobj(b))", + " assert(iscomplexobj(b))", + " assert(isrealobj(b))", + " suites.append( unittest.makeSuite(test_iscomplexobj,'check_') )", + " suites.append( unittest.makeSuite(test_isrealobj,'check_') )" + ], + "deleted": [ + "class test_array_iscomplex(unittest.TestCase):", + " assert(not array_iscomplex(z))", + " assert(array_iscomplex(z))", + "class test_array_isreal(unittest.TestCase):", + " assert(array_isreal(z))", + " assert(not array_isreal(z))", + " assert(array_isreal(b))", + " assert(array_iscomplex(b))", + " assert(array_isreal(b))", + " suites.append( unittest.makeSuite(test_array_iscomplex,'check_') )", + " suites.append( unittest.makeSuite(test_array_isreal,'check_') )" + ] + } + }, + { + "old_path": null, + "new_path": "scipy_base/transform_base.py", + "filename": "transform_base.py", + "extension": "py", + "change_type": "ADD", + "diff": "@@ -0,0 +1,73 @@\n+import Numeric\n+__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']\n+\n+def fftshift(x,axes=None):\n+ \"\"\" Shift the result of an FFT operation.\n+\n+ Return a shifted version of x (useful for obtaining centered spectra).\n+ This function swaps \"half-spaces\" for all axes listed (defaults to all)\n+ \"\"\"\n+ ndim = len(x.shape)\n+ if axes == None:\n+ axes = range(ndim)\n+ y = x\n+ for k in axes:\n+ N = x.shape[k]\n+ p2 = int(Numeric.ceil(N/2.0))\n+ mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n+ y = Numeric.take(y,mylist,k)\n+ return y\n+\n+def ifftshift(x,axes=None):\n+ \"\"\" Reverse the effect of fftshift.\n+ \"\"\"\n+ ndim = len(x.shape)\n+ if axes == None:\n+ axes = range(ndim)\n+ y = x\n+ for k in axes:\n+ N = x.shape[k]\n+ p2 = int(Numeric.floor(N/2.0))\n+ mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n+ y = Numeric.take(y,mylist,k)\n+ return y\n+\n+def fftfreq(N,sample=1.0):\n+ \"\"\" FFT sample frequencies\n+ \n+ Return the frequency bins in cycles/unit (with zero at the start) given a\n+ window length N and a sample spacing.\n+ \"\"\"\n+ N = int(N)\n+ sample = float(sample)\n+ return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n+\n+def cont_ft(gn,fr,delta=1.0,n=None):\n+ \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n+\n+ If the gn are alias-free samples of a continuous time function then the\n+ correct value for the spacing, delta, will give the properly scaled,\n+ continuous Fourier spectrum.\n+ \n+ The DFT is obtained when delta=1.0\n+ \"\"\"\n+ if n is None:\n+ n = Numeric.arange(len(gn))\n+ dT = delta\n+ trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n+ return dT*Numeric.dot(trans_kernel,gn)\n+\n+#-----------------------------------------------------------------------------\n+# Test Routines\n+#-----------------------------------------------------------------------------\n+\n+def test(level=10):\n+ from scipy_base.testing import module_test\n+ module_test(__name__,__file__,level=level)\n+\n+def test_suite(level=1):\n+ from scipy_base.testing import module_test_suite\n+ return module_test_suite(__name__,__file__,level=level)\n+\n+if __name__ == '__main__':\n+ test()\n", + "added_lines": 73, + "deleted_lines": 0, + "source_code": "import Numeric\n__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']\n\ndef fftshift(x,axes=None):\n \"\"\" Shift the result of an FFT operation.\n\n Return a shifted version of x (useful for obtaining centered spectra).\n This function swaps \"half-spaces\" for all axes listed (defaults to all)\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.ceil(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef ifftshift(x,axes=None):\n \"\"\" Reverse the effect of fftshift.\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.floor(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef fftfreq(N,sample=1.0):\n \"\"\" FFT sample frequencies\n \n Return the frequency bins in cycles/unit (with zero at the start) given a\n window length N and a sample spacing.\n \"\"\"\n N = int(N)\n sample = float(sample)\n return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n\ndef cont_ft(gn,fr,delta=1.0,n=None):\n \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n\n If the gn are alias-free samples of a continuous time function then the\n correct value for the spacing, delta, will give the properly scaled,\n continuous Fourier spectrum.\n \n The DFT is obtained when delta=1.0\n \"\"\"\n if n is None:\n n = Numeric.arange(len(gn))\n dT = delta\n trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n return dT*Numeric.dot(trans_kernel,gn)\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()\n", + "source_code_before": null, + "methods": [ + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "nloc": 42, + "complexity": 11, + "token_count": 420, + "diff_parsed": { + "added": [ + "import Numeric", + "__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']", + "", + "def fftshift(x,axes=None):", + " \"\"\" Shift the result of an FFT operation.", + "", + " Return a shifted version of x (useful for obtaining centered spectra).", + " This function swaps \"half-spaces\" for all axes listed (defaults to all)", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.ceil(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def ifftshift(x,axes=None):", + " \"\"\" Reverse the effect of fftshift.", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.floor(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def fftfreq(N,sample=1.0):", + " \"\"\" FFT sample frequencies", + "", + " Return the frequency bins in cycles/unit (with zero at the start) given a", + " window length N and a sample spacing.", + " \"\"\"", + " N = int(N)", + " sample = float(sample)", + " return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample", + "", + "def cont_ft(gn,fr,delta=1.0,n=None):", + " \"\"\" Compute the (scaled) DFT of gn at frequencies fr.", + "", + " If the gn are alias-free samples of a continuous time function then the", + " correct value for the spacing, delta, will give the properly scaled,", + " continuous Fourier spectrum.", + "", + " The DFT is obtained when delta=1.0", + " \"\"\"", + " if n is None:", + " n = Numeric.arange(len(gn))", + " dT = delta", + " trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)", + " return dT*Numeric.dot(trans_kernel,gn)", + "", + "#-----------------------------------------------------------------------------", + "# Test Routines", + "#-----------------------------------------------------------------------------", + "", + "def test(level=10):", + " from scipy_base.testing import module_test", + " module_test(__name__,__file__,level=level)", + "", + "def test_suite(level=1):", + " from scipy_base.testing import module_test_suite", + " return module_test_suite(__name__,__file__,level=level)", + "", + "if __name__ == '__main__':", + " test()" + ], + "deleted": [] + } + }, + { + "old_path": "scipy_base/type_check.py", + "new_path": "scipy_base/type_check.py", + "filename": "type_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -5,18 +5,19 @@\n \n import limits\n \n-# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n-# stuff. Perhaps move to cephes in the future??\n-from ieee_754 import PINF,MINF,NAN\n-\n-__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n+__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n- 'typename']\n+ 'typename','cast']\n \n ScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n \n-toChar = lambda x: Numeric.array(x, Numeric.Character)\n+try:\n+ Char = Numeric.Character\n+except AttributeError:\n+ Char = 'c'\n+\n+toChar = lambda x: Numeric.array(x, Char)\n toInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\n toInt16 = lambda x: Numeric.array(x, Numeric.Int16)\n toInt32 = lambda x: Numeric.array(x, Numeric.Int32)\n@@ -66,29 +67,29 @@ def iscomplex(x):\n def isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n \n-def array_iscomplex(x):\n+def iscomplexobj(x):\n return asarray(x).typecode() in ['F', 'D']\n \n-def array_isreal(x):\n+def isrealobj(x):\n return not asarray(x).typecode() in ['F', 'D']\n \n #-----------------------------------------------------------------------------\n \n-def isnan(val):\n- # fast, but apparently not portable (according to notes by Tim Peters)\n- #return val != val\n- # very slow -- should really use cephes methods or *something* different\n- import ieee_754\n- vals = ravel(val)\n- if array_iscomplex(vals):\n- r = array(map(ieee_754.isnan,real(vals))) \n- i = array(map(ieee_754.isnan,imag(vals)))\n- results = Numeric.logical_or(r,i)\n- else: \n- results = array(map(ieee_754.isnan,vals))\n- if isscalar(val):\n- results = results[0]\n- return results\n+##def isnan(val):\n+## # fast, but apparently not portable (according to notes by Tim Peters)\n+## #return val != val\n+## # very slow -- should really use cephes methods or *something* different\n+## import ieee_754\n+## vals = ravel(val)\n+## if array_iscomplex(vals):\n+## r = array(map(ieee_754.isnan,real(vals))) \n+## i = array(map(ieee_754.isnan,imag(vals)))\n+## results = Numeric.logical_or(r,i)\n+## else: \n+## results = array(map(ieee_754.isnan,vals))\n+## if isscalar(val):\n+## results = results[0]\n+## return results\n \n def isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n@@ -98,22 +99,23 @@ def isposinf(val):\n def isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n- return val == MINF\n+ return val == NINF\n \n-def isinf(val):\n- return Numeric.logical_or(isposinf(val),isneginf(val))\n-\n-def isfinite(val):\n- vals = asarray(val)\n- if array_iscomplex(vals):\n- r = isfinite(real(vals))\n- i = isfinite(imag(vals))\n- results = Numeric.logical_and(r,i)\n- else: \n- fin = Numeric.logical_not(isinf(val))\n- an = Numeric.logical_not(isnan(val))\n- results = Numeric.logical_and(fin,an)\n- return results \n+##def isinf(val):\n+## return Numeric.logical_or(isposinf(val),isneginf(val))\n+\n+##def isfinite(val):\n+## vals = asarray(val)\n+## if iscomplexobj(vals):\n+## r = isfinite(real(vals))\n+## i = isfinite(imag(vals))\n+## results = Numeric.logical_and(r,i)\n+## else: \n+## fin = Numeric.logical_not(isinf(val))\n+## an = Numeric.logical_not(isnan(val))\n+## results = Numeric.logical_and(fin,an)\n+## return results \n+\n def nan_to_num(x):\n # mapping:\n # NaN -> 0\n", + "added_lines": 41, + "deleted_lines": 39, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename','cast']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntry:\n Char = Numeric.Character\nexcept AttributeError:\n Char = 'c'\n\ntoChar = lambda x: Numeric.array(x, Char)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef iscomplexobj(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef isrealobj(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\n##def isnan(val):\n## # fast, but apparently not portable (according to notes by Tim Peters)\n## #return val != val\n## # very slow -- should really use cephes methods or *something* different\n## import ieee_754\n## vals = ravel(val)\n## if array_iscomplex(vals):\n## r = array(map(ieee_754.isnan,real(vals))) \n## i = array(map(ieee_754.isnan,imag(vals)))\n## results = Numeric.logical_or(r,i)\n## else: \n## results = array(map(ieee_754.isnan,vals))\n## if isscalar(val):\n## results = results[0]\n## return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == NINF\n \n##def isinf(val):\n## return Numeric.logical_or(isposinf(val),isneginf(val))\n\n##def isfinite(val):\n## vals = asarray(val)\n## if iscomplexobj(vals):\n## r = isfinite(real(vals))\n## i = isfinite(imag(vals))\n## results = Numeric.logical_and(r,i)\n## else: \n## fin = Numeric.logical_not(isinf(val))\n## an = Numeric.logical_not(isnan(val))\n## results = Numeric.logical_and(fin,an)\n## return results \n\ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison\n# stuff. Perhaps move to cephes in the future??\nfrom ieee_754 import PINF,MINF,NAN\n\n__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntoChar = lambda x: Numeric.array(x, Numeric.Character)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef array_iscomplex(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef array_isreal(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\ndef isnan(val):\n # fast, but apparently not portable (according to notes by Tim Peters)\n #return val != val\n # very slow -- should really use cephes methods or *something* different\n import ieee_754\n vals = ravel(val)\n if array_iscomplex(vals):\n r = array(map(ieee_754.isnan,real(vals))) \n i = array(map(ieee_754.isnan,imag(vals)))\n results = Numeric.logical_or(r,i)\n else: \n results = array(map(ieee_754.isnan,vals))\n if isscalar(val):\n results = results[0]\n return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == MINF\n \ndef isinf(val):\n return Numeric.logical_or(isposinf(val),isneginf(val))\n\ndef isfinite(val):\n vals = asarray(val)\n if array_iscomplex(vals):\n r = isfinite(real(vals))\n i = isfinite(imag(vals))\n results = Numeric.logical_and(r,i)\n else: \n fin = Numeric.logical_not(isinf(val))\n an = Numeric.logical_not(isnan(val))\n results = Numeric.logical_and(fin,an)\n return results \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 50, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 57, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 64, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 70, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 94, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 99, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 119, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 144, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 166, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 177, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 190, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 194, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 12, + "complexity": 3, + "token_count": 90, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 98, + "end_line": 101, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 106, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 117, + "end_line": 138, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 142, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 164, + "end_line": 167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 175, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 188, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 192, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 99, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_isreal", + "long_name": "array_isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "array_iscomplex", + "long_name": "array_iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 70, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( val )", + "filename": "type_check.py", + "nloc": 12, + "complexity": 3, + "token_count": 90, + "parameters": [ + "val" + ], + "start_line": 77, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "isinf", + "long_name": "isinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "val" + ], + "start_line": 103, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isfinite", + "long_name": "isfinite( val )", + "filename": "type_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 81, + "parameters": [ + "val" + ], + "start_line": 106, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + } + ], + "nloc": 120, + "complexity": 24, + "token_count": 941, + "diff_parsed": { + "added": [ + "__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',", + " 'typename','cast']", + "try:", + " Char = Numeric.Character", + "except AttributeError:", + " Char = 'c'", + "", + "toChar = lambda x: Numeric.array(x, Char)", + "def iscomplexobj(x):", + "def isrealobj(x):", + "##def isnan(val):", + "## # fast, but apparently not portable (according to notes by Tim Peters)", + "## #return val != val", + "## # very slow -- should really use cephes methods or *something* different", + "## import ieee_754", + "## vals = ravel(val)", + "## if array_iscomplex(vals):", + "## r = array(map(ieee_754.isnan,real(vals)))", + "## i = array(map(ieee_754.isnan,imag(vals)))", + "## results = Numeric.logical_or(r,i)", + "## else:", + "## results = array(map(ieee_754.isnan,vals))", + "## if isscalar(val):", + "## results = results[0]", + "## return results", + " return val == NINF", + "##def isinf(val):", + "## return Numeric.logical_or(isposinf(val),isneginf(val))", + "", + "##def isfinite(val):", + "## vals = asarray(val)", + "## if iscomplexobj(vals):", + "## r = isfinite(real(vals))", + "## i = isfinite(imag(vals))", + "## results = Numeric.logical_and(r,i)", + "## else:", + "## fin = Numeric.logical_not(isinf(val))", + "## an = Numeric.logical_not(isnan(val))", + "## results = Numeric.logical_and(fin,an)", + "## return results", + "" + ], + "deleted": [ + "# For now, we'll use Tim Peter's IEEE module for NaN, Inf, -Inf comparison", + "# stuff. Perhaps move to cephes in the future??", + "from ieee_754 import PINF,MINF,NAN", + "", + "__all__ = ['ScalarType','array_iscomplex','array_isreal','imag','iscomplex',", + " 'typename']", + "toChar = lambda x: Numeric.array(x, Numeric.Character)", + "def array_iscomplex(x):", + "def array_isreal(x):", + "def isnan(val):", + " # fast, but apparently not portable (according to notes by Tim Peters)", + " #return val != val", + " # very slow -- should really use cephes methods or *something* different", + " import ieee_754", + " vals = ravel(val)", + " if array_iscomplex(vals):", + " r = array(map(ieee_754.isnan,real(vals)))", + " i = array(map(ieee_754.isnan,imag(vals)))", + " results = Numeric.logical_or(r,i)", + " else:", + " results = array(map(ieee_754.isnan,vals))", + " if isscalar(val):", + " results = results[0]", + " return results", + " return val == MINF", + "def isinf(val):", + " return Numeric.logical_or(isposinf(val),isneginf(val))", + "", + "def isfinite(val):", + " vals = asarray(val)", + " if array_iscomplex(vals):", + " r = isfinite(real(vals))", + " i = isfinite(imag(vals))", + " results = Numeric.logical_and(r,i)", + " else:", + " fin = Numeric.logical_not(isinf(val))", + " an = Numeric.logical_not(isnan(val))", + " results = Numeric.logical_and(fin,an)", + " return results" + ] + } + }, + { + "old_path": "weave/accelerate_tools.py", + "new_path": "weave/accelerate_tools.py", + "filename": "accelerate_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -94,7 +94,7 @@ def getitem(self,A,v,t):\n def setitem(self,A,v,t):\n return self.getitem(A,v,t)\n \n-class Matrix(Vector):\n+class matrix(Vector):\n dims = 2\n \n class IntegerVector(Vector):\n@@ -102,7 +102,7 @@ class IntegerVector(Vector):\n cxxbase = 'int'\n pybase = Integer\n \n-class IntegerMatrix(Matrix):\n+class Integermatrix(matrix):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n@@ -112,7 +112,7 @@ class LongVector(Vector):\n cxxbase = 'long'\n pybase = Integer\n \n-class LongMatrix(Matrix):\n+class Longmatrix(matrix):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n@@ -122,7 +122,7 @@ class DoubleVector(Vector):\n cxxbase = 'double'\n pybase = Double\n \n-class DoubleMatrix(Matrix):\n+class Doublematrix(matrix):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n@@ -145,11 +145,11 @@ class XRange {\n # Singletonize the type names\n # -----------------------------------------------\n IntegerVector = IntegerVector()\n-IntegerMatrix = IntegerMatrix()\n+Integermatrix = Integermatrix()\n LongVector = LongVector()\n-LongMatrix = LongMatrix()\n+Longmatrix = Longmatrix()\n DoubleVector = DoubleVector()\n-DoubleMatrix = DoubleMatrix()\n+Doublematrix = Doublematrix()\n XRange = XRange()\n \n typedefs = {\n@@ -157,11 +157,11 @@ class XRange {\n FloatType: Double,\n StringType: String,\n (Numeric.ArrayType,1,'i'): IntegerVector,\n- (Numeric.ArrayType,2,'i'): IntegerMatrix,\n+ (Numeric.ArrayType,2,'i'): Integermatrix,\n (Numeric.ArrayType,1,'l'): LongVector,\n- (Numeric.ArrayType,2,'l'): LongMatrix,\n+ (Numeric.ArrayType,2,'l'): Longmatrix,\n (Numeric.ArrayType,1,'d'): DoubleVector,\n- (Numeric.ArrayType,2,'d'): DoubleMatrix,\n+ (Numeric.ArrayType,2,'d'): Doublematrix,\n XRangeType : XRange,\n }\n \n", + "added_lines": 10, + "deleted_lines": 10, + "source_code": "#**************************************************************************#\n#* FILE ************** accelerate_tools.py ************************#\n#**************************************************************************#\n#* Author: Patrick Miller February 9 2002 *#\n#**************************************************************************#\n\"\"\"\naccelerate_tools contains the interface for on-the-fly building of\nC++ equivalents to Python functions.\n\"\"\"\n#**************************************************************************#\n\nfrom types import FunctionType,IntType,FloatType,StringType,TypeType,XRangeType\nimport inspect\nimport md5\nimport weave\nfrom bytecodecompiler import CXXCoder,Type_Descriptor,Function_Descriptor\n\ndef CStr(s):\n \"Hacky way to get legal C string from Python string\"\n if s == None: return '\"\"'\n assert type(s) == StringType,\"Only None and string allowed\"\n r = repr('\"'+s) # Better for embedded quotes\n return '\"'+r[2:-1]+'\"'\n\nclass Basic(Type_Descriptor):\n def check(self,s):\n return \"%s(%s)\"%(self.checker,s)\n def inbound(self,s):\n return \"%s(%s)\"%(self.inbounder,s)\n def outbound(self,s):\n return \"%s(%s)\"%(self.outbounder,s)\n\nclass Basic_Number(Basic):\n def literalizer(self,s):\n return str(s)\n def binop(self,symbol,a,b):\n assert symbol in ['+','-','*','/'],symbol\n return '%s %s %s'%(a,symbol,b),self\n\nclass Integer(Basic_Number):\n cxxtype = \"long\"\n checker = \"PyInt_Check\"\n inbounder = \"PyInt_AsLong\"\n outbounder = \"PyInt_FromLong\"\n\nclass Double(Basic_Number):\n cxxtype = \"double\"\n checker = \"PyFloat_Check\"\n inbounder = \"PyFloat_AsDouble\"\n outbounder = \"PyFloat_FromDouble\"\n\nclass String(Basic):\n cxxtype = \"char*\"\n checker = \"PyString_Check\"\n inbounder = \"PyString_AsString\"\n outbounder = \"PyString_FromString\"\n\n def literalizer(self,s):\n return CStr(s)\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nInteger = Integer()\nDouble = Double()\nString = String()\n\nimport Numeric\n\nclass Vector(Type_Descriptor):\n cxxtype = 'PyArrayObject*'\n refcount = 1\n dims = 1\n module_init_code = 'import_array();'\n\n prerequisites = Type_Descriptor.prerequisites+\\\n ['#include \"Numeric/arrayobject.h\"']\n dims = 1\n def check(self,s):\n return \"PyArray_Check(%s) && ((PyArrayObject*)%s)->nd == %d && ((PyArrayObject*)%s)->descr->type_num == %s\"%(\n s,s,self.dims,s,self.typecode)\n def inbound(self,s):\n return \"(PyArrayObject*)(%s)\"%s\n def outbound(self,s):\n return \"(PyObject*)(%s)\"%s\n def getitem(self,A,v,t):\n assert self.dims == len(v),'Expect dimension %d'%self.dims\n code = '*((%s*)(%s->data'%(self.cxxbase,A)\n for i in range(self.dims):\n # assert that ''t[i]'' is an integer\n code += '+%s*%s->strides[%d]'%(v[i],A,i)\n code += '))'\n return code,self.pybase\n def setitem(self,A,v,t):\n return self.getitem(A,v,t)\n\nclass matrix(Vector):\n dims = 2\n\nclass IntegerVector(Vector):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass Integermatrix(matrix):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass LongVector(Vector):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass Longmatrix(matrix):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass DoubleVector(Vector):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass Doublematrix(matrix):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass XRange(Type_Descriptor):\n cxxtype = 'XRange'\n prerequisites = ['''\n class XRange {\n public:\n XRange(long aLow, long aHigh, long aStep=1)\n : low(aLow),high(aHigh),step(aStep)\n {\n }\n long low;\n long high;\n long step;\n };''']\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nIntegerVector = IntegerVector()\nIntegermatrix = Integermatrix()\nLongVector = LongVector()\nLongmatrix = Longmatrix()\nDoubleVector = DoubleVector()\nDoublematrix = Doublematrix()\nXRange = XRange()\n\ntypedefs = {\n IntType: Integer,\n FloatType: Double,\n StringType: String,\n (Numeric.ArrayType,1,'i'): IntegerVector,\n (Numeric.ArrayType,2,'i'): Integermatrix,\n (Numeric.ArrayType,1,'l'): LongVector,\n (Numeric.ArrayType,2,'l'): Longmatrix,\n (Numeric.ArrayType,1,'d'): DoubleVector,\n (Numeric.ArrayType,2,'d'): Doublematrix,\n XRangeType : XRange,\n }\n\nimport math\nfunctiondefs = {\n (range,(Integer,Integer)):\n Function_Descriptor(code='XRange(%s)',return_type=XRange),\n\n (math.sin,(Double,)):\n Function_Descriptor(code='sin(%s)',return_type=Double),\n\n (math.sqrt,(Double,)):\n Function_Descriptor(code='sqrt(%s)',return_type=Double),\n }\n \n\n\n##################################################################\n# FUNCTION LOOKUP_TYPE #\n##################################################################\ndef lookup_type(x):\n T = type(x)\n try:\n return typedefs[T]\n except:\n return typedefs[(T,len(x.shape),x.typecode())]\n\n##################################################################\n# class ACCELERATE #\n##################################################################\nclass accelerate:\n \n def __init__(self, function, *args, **kw):\n assert type(function) == FunctionType\n self.function = function\n self.module = inspect.getmodule(function)\n if self.module == None:\n import __main__\n self.module = __main__\n self.__call_map = {}\n\n def __cache(self,*args):\n raise TypeError\n\n def __call__(self,*args):\n try:\n return self.__cache(*args)\n except TypeError:\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n \n # If we know the function, call it\n try:\n fast = self.__call_map[signature]\n except:\n fast = self.singleton(signature)\n self.__cache = fast\n self.__call_map[signature] = fast\n return fast(*args)\n\n def signature(self,*args):\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n return self.singleton(signature)\n\n\n def singleton(self,signature):\n identifier = self.identifier(signature)\n \n # Generate a new function, then call it\n f = self.function\n\n # See if we have an accelerated version of module\n try:\n accelerated_module = __import__(self.module.__name__+'_weave')\n fast = getattr(accelerated_module,identifier)\n return fast\n except:\n accelerated_module = None\n\n P = self.accelerate(signature,identifier)\n\n E = weave.ext_tools.ext_module(self.module.__name__+'_weave')\n E.add_function(P)\n E.generate_file()\n weave.build_tools.build_extension(self.module.__name__+'_weave.cpp',verbose=2)\n\n if accelerated_module:\n accelerated_module = reload(accelerated_module)\n else:\n accelerated_module = __import__(self.module.__name__+'_weave')\n\n fast = getattr(accelerated_module,identifier)\n return fast\n\n def identifier(self,signature):\n # Build an MD5 checksum\n f = self.function\n co = f.func_code\n identifier = str(signature)+\\\n str(co.co_argcount)+\\\n str(co.co_consts)+\\\n str(co.co_varnames)+\\\n co.co_code\n return 'F'+md5.md5(identifier).hexdigest()\n \n def accelerate(self,signature,identifier):\n P = Python2CXX(self.function,signature,name=identifier)\n return P\n\n def code(self,*args):\n if len(args) != self.function.func_code.co_argcount:\n raise TypeError,'%s() takes exactly %d arguments (%d given)'%(\n self.function.__name__,\n self.function.func_code.co_argcount,\n len(args))\n signature = tuple( map(lookup_type,args) )\n ident = self.function.__name__\n return self.accelerate(signature,ident).function_code()\n \n\n##################################################################\n# CLASS PYTHON2CXX #\n##################################################################\nclass Python2CXX(CXXCoder):\n def typedef_by_value(self,v):\n T = lookup_type(v)\n if T not in self.used:\n self.used.append(T)\n return T\n\n def function_by_signature(self,signature):\n descriptor = functiondefs[signature]\n if descriptor.return_type not in self.used:\n self.used.append(descriptor.return_type)\n return descriptor\n\n def __init__(self,f,signature,name=None):\n # Make sure function is a function\n import types\n assert type(f) == FunctionType\n # and check the input type signature\n assert reduce(lambda x,y: x and y,\n map(lambda x: isinstance(x,Type_Descriptor),\n signature),\n 1),'%s not all type objects'%signature\n self.arg_specs = []\n self.customize = weave.base_info.custom_info()\n\n CXXCoder.__init__(self,f,signature,name)\n\n return\n\n def function_code(self):\n code = self.wrapped_code()\n for T in self.used:\n if T != None and T.module_init_code:\n self.customize.add_module_init_code(T.module_init_code)\n return code\n\n def python_function_definition_code(self):\n return '{ \"%s\", wrapper_%s, METH_VARARGS, %s },\\n'%(\n self.name,\n self.name,\n CStr(self.function.__doc__))\n", + "source_code_before": "#**************************************************************************#\n#* FILE ************** accelerate_tools.py ************************#\n#**************************************************************************#\n#* Author: Patrick Miller February 9 2002 *#\n#**************************************************************************#\n\"\"\"\naccelerate_tools contains the interface for on-the-fly building of\nC++ equivalents to Python functions.\n\"\"\"\n#**************************************************************************#\n\nfrom types import FunctionType,IntType,FloatType,StringType,TypeType,XRangeType\nimport inspect\nimport md5\nimport weave\nfrom bytecodecompiler import CXXCoder,Type_Descriptor,Function_Descriptor\n\ndef CStr(s):\n \"Hacky way to get legal C string from Python string\"\n if s == None: return '\"\"'\n assert type(s) == StringType,\"Only None and string allowed\"\n r = repr('\"'+s) # Better for embedded quotes\n return '\"'+r[2:-1]+'\"'\n\nclass Basic(Type_Descriptor):\n def check(self,s):\n return \"%s(%s)\"%(self.checker,s)\n def inbound(self,s):\n return \"%s(%s)\"%(self.inbounder,s)\n def outbound(self,s):\n return \"%s(%s)\"%(self.outbounder,s)\n\nclass Basic_Number(Basic):\n def literalizer(self,s):\n return str(s)\n def binop(self,symbol,a,b):\n assert symbol in ['+','-','*','/'],symbol\n return '%s %s %s'%(a,symbol,b),self\n\nclass Integer(Basic_Number):\n cxxtype = \"long\"\n checker = \"PyInt_Check\"\n inbounder = \"PyInt_AsLong\"\n outbounder = \"PyInt_FromLong\"\n\nclass Double(Basic_Number):\n cxxtype = \"double\"\n checker = \"PyFloat_Check\"\n inbounder = \"PyFloat_AsDouble\"\n outbounder = \"PyFloat_FromDouble\"\n\nclass String(Basic):\n cxxtype = \"char*\"\n checker = \"PyString_Check\"\n inbounder = \"PyString_AsString\"\n outbounder = \"PyString_FromString\"\n\n def literalizer(self,s):\n return CStr(s)\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nInteger = Integer()\nDouble = Double()\nString = String()\n\nimport Numeric\n\nclass Vector(Type_Descriptor):\n cxxtype = 'PyArrayObject*'\n refcount = 1\n dims = 1\n module_init_code = 'import_array();'\n\n prerequisites = Type_Descriptor.prerequisites+\\\n ['#include \"Numeric/arrayobject.h\"']\n dims = 1\n def check(self,s):\n return \"PyArray_Check(%s) && ((PyArrayObject*)%s)->nd == %d && ((PyArrayObject*)%s)->descr->type_num == %s\"%(\n s,s,self.dims,s,self.typecode)\n def inbound(self,s):\n return \"(PyArrayObject*)(%s)\"%s\n def outbound(self,s):\n return \"(PyObject*)(%s)\"%s\n def getitem(self,A,v,t):\n assert self.dims == len(v),'Expect dimension %d'%self.dims\n code = '*((%s*)(%s->data'%(self.cxxbase,A)\n for i in range(self.dims):\n # assert that ''t[i]'' is an integer\n code += '+%s*%s->strides[%d]'%(v[i],A,i)\n code += '))'\n return code,self.pybase\n def setitem(self,A,v,t):\n return self.getitem(A,v,t)\n\nclass Matrix(Vector):\n dims = 2\n\nclass IntegerVector(Vector):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass IntegerMatrix(Matrix):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass LongVector(Vector):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass LongMatrix(Matrix):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass DoubleVector(Vector):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass DoubleMatrix(Matrix):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass XRange(Type_Descriptor):\n cxxtype = 'XRange'\n prerequisites = ['''\n class XRange {\n public:\n XRange(long aLow, long aHigh, long aStep=1)\n : low(aLow),high(aHigh),step(aStep)\n {\n }\n long low;\n long high;\n long step;\n };''']\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nIntegerVector = IntegerVector()\nIntegerMatrix = IntegerMatrix()\nLongVector = LongVector()\nLongMatrix = LongMatrix()\nDoubleVector = DoubleVector()\nDoubleMatrix = DoubleMatrix()\nXRange = XRange()\n\ntypedefs = {\n IntType: Integer,\n FloatType: Double,\n StringType: String,\n (Numeric.ArrayType,1,'i'): IntegerVector,\n (Numeric.ArrayType,2,'i'): IntegerMatrix,\n (Numeric.ArrayType,1,'l'): LongVector,\n (Numeric.ArrayType,2,'l'): LongMatrix,\n (Numeric.ArrayType,1,'d'): DoubleVector,\n (Numeric.ArrayType,2,'d'): DoubleMatrix,\n XRangeType : XRange,\n }\n\nimport math\nfunctiondefs = {\n (range,(Integer,Integer)):\n Function_Descriptor(code='XRange(%s)',return_type=XRange),\n\n (math.sin,(Double,)):\n Function_Descriptor(code='sin(%s)',return_type=Double),\n\n (math.sqrt,(Double,)):\n Function_Descriptor(code='sqrt(%s)',return_type=Double),\n }\n \n\n\n##################################################################\n# FUNCTION LOOKUP_TYPE #\n##################################################################\ndef lookup_type(x):\n T = type(x)\n try:\n return typedefs[T]\n except:\n return typedefs[(T,len(x.shape),x.typecode())]\n\n##################################################################\n# class ACCELERATE #\n##################################################################\nclass accelerate:\n \n def __init__(self, function, *args, **kw):\n assert type(function) == FunctionType\n self.function = function\n self.module = inspect.getmodule(function)\n if self.module == None:\n import __main__\n self.module = __main__\n self.__call_map = {}\n\n def __cache(self,*args):\n raise TypeError\n\n def __call__(self,*args):\n try:\n return self.__cache(*args)\n except TypeError:\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n \n # If we know the function, call it\n try:\n fast = self.__call_map[signature]\n except:\n fast = self.singleton(signature)\n self.__cache = fast\n self.__call_map[signature] = fast\n return fast(*args)\n\n def signature(self,*args):\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n return self.singleton(signature)\n\n\n def singleton(self,signature):\n identifier = self.identifier(signature)\n \n # Generate a new function, then call it\n f = self.function\n\n # See if we have an accelerated version of module\n try:\n accelerated_module = __import__(self.module.__name__+'_weave')\n fast = getattr(accelerated_module,identifier)\n return fast\n except:\n accelerated_module = None\n\n P = self.accelerate(signature,identifier)\n\n E = weave.ext_tools.ext_module(self.module.__name__+'_weave')\n E.add_function(P)\n E.generate_file()\n weave.build_tools.build_extension(self.module.__name__+'_weave.cpp',verbose=2)\n\n if accelerated_module:\n accelerated_module = reload(accelerated_module)\n else:\n accelerated_module = __import__(self.module.__name__+'_weave')\n\n fast = getattr(accelerated_module,identifier)\n return fast\n\n def identifier(self,signature):\n # Build an MD5 checksum\n f = self.function\n co = f.func_code\n identifier = str(signature)+\\\n str(co.co_argcount)+\\\n str(co.co_consts)+\\\n str(co.co_varnames)+\\\n co.co_code\n return 'F'+md5.md5(identifier).hexdigest()\n \n def accelerate(self,signature,identifier):\n P = Python2CXX(self.function,signature,name=identifier)\n return P\n\n def code(self,*args):\n if len(args) != self.function.func_code.co_argcount:\n raise TypeError,'%s() takes exactly %d arguments (%d given)'%(\n self.function.__name__,\n self.function.func_code.co_argcount,\n len(args))\n signature = tuple( map(lookup_type,args) )\n ident = self.function.__name__\n return self.accelerate(signature,ident).function_code()\n \n\n##################################################################\n# CLASS PYTHON2CXX #\n##################################################################\nclass Python2CXX(CXXCoder):\n def typedef_by_value(self,v):\n T = lookup_type(v)\n if T not in self.used:\n self.used.append(T)\n return T\n\n def function_by_signature(self,signature):\n descriptor = functiondefs[signature]\n if descriptor.return_type not in self.used:\n self.used.append(descriptor.return_type)\n return descriptor\n\n def __init__(self,f,signature,name=None):\n # Make sure function is a function\n import types\n assert type(f) == FunctionType\n # and check the input type signature\n assert reduce(lambda x,y: x and y,\n map(lambda x: isinstance(x,Type_Descriptor),\n signature),\n 1),'%s not all type objects'%signature\n self.arg_specs = []\n self.customize = weave.base_info.custom_info()\n\n CXXCoder.__init__(self,f,signature,name)\n\n return\n\n def function_code(self):\n code = self.wrapped_code()\n for T in self.used:\n if T != None and T.module_init_code:\n self.customize.add_module_init_code(T.module_init_code)\n return code\n\n def python_function_definition_code(self):\n return '{ \"%s\", wrapper_%s, METH_VARARGS, %s },\\n'%(\n self.name,\n self.name,\n CStr(self.function.__doc__))\n", + "methods": [ + { + "name": "CStr", + "long_name": "CStr( s )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 42, + "parameters": [ + "s" + ], + "start_line": 18, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 28, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 30, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 34, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , symbol , a , b )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "symbol", + "a", + "b" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 58, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "s" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 82, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getitem", + "long_name": "getitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 7, + "complexity": 2, + "token_count": 70, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 86, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "setitem", + "long_name": "setitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "lookup_type", + "long_name": "lookup_type( x )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 40, + "parameters": [ + "x" + ], + "start_line": 185, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , * args , ** kw )", + "filename": "accelerate_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 55, + "parameters": [ + "self", + "function", + "args", + "kw" + ], + "start_line": 197, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__cache", + "long_name": "__cache( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "args" + ], + "start_line": 206, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 71, + "parameters": [ + "self", + "args" + ], + "start_line": 209, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "signature", + "long_name": "signature( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "args" + ], + "start_line": 225, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "singleton", + "long_name": "singleton( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 20, + "complexity": 3, + "token_count": 137, + "parameters": [ + "self", + "signature" + ], + "start_line": 231, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 1 + }, + { + "name": "identifier", + "long_name": "identifier( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self", + "signature" + ], + "start_line": 260, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "accelerate", + "long_name": "accelerate( self , signature , identifier )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "signature", + "identifier" + ], + "start_line": 271, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "code", + "long_name": "code( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "args" + ], + "start_line": 275, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self", + "v" + ], + "start_line": 290, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "function_by_signature", + "long_name": "function_by_signature( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "signature" + ], + "start_line": 296, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , f , signature , name = None )", + "filename": "accelerate_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 85, + "parameters": [ + "self", + "f", + "signature", + "name" + ], + "start_line": 302, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 4, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 318, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "CStr", + "long_name": "CStr( s )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 42, + "parameters": [ + "s" + ], + "start_line": 18, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 28, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 30, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 34, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , symbol , a , b )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "symbol", + "a", + "b" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 58, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "s" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 82, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getitem", + "long_name": "getitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 7, + "complexity": 2, + "token_count": 70, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 86, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "setitem", + "long_name": "setitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "lookup_type", + "long_name": "lookup_type( x )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 40, + "parameters": [ + "x" + ], + "start_line": 185, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , * args , ** kw )", + "filename": "accelerate_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 55, + "parameters": [ + "self", + "function", + "args", + "kw" + ], + "start_line": 197, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__cache", + "long_name": "__cache( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "args" + ], + "start_line": 206, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 71, + "parameters": [ + "self", + "args" + ], + "start_line": 209, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "signature", + "long_name": "signature( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "args" + ], + "start_line": 225, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "singleton", + "long_name": "singleton( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 20, + "complexity": 3, + "token_count": 137, + "parameters": [ + "self", + "signature" + ], + "start_line": 231, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 1 + }, + { + "name": "identifier", + "long_name": "identifier( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self", + "signature" + ], + "start_line": 260, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "accelerate", + "long_name": "accelerate( self , signature , identifier )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "signature", + "identifier" + ], + "start_line": 271, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "code", + "long_name": "code( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "args" + ], + "start_line": 275, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self", + "v" + ], + "start_line": 290, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "function_by_signature", + "long_name": "function_by_signature( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "signature" + ], + "start_line": 296, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , f , signature , name = None )", + "filename": "accelerate_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 85, + "parameters": [ + "self", + "f", + "signature", + "name" + ], + "start_line": 302, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 4, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 318, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "changed_methods": [], + "nloc": 246, + "complexity": 41, + "token_count": 1506, + "diff_parsed": { + "added": [ + "class matrix(Vector):", + "class Integermatrix(matrix):", + "class Longmatrix(matrix):", + "class Doublematrix(matrix):", + "Integermatrix = Integermatrix()", + "Longmatrix = Longmatrix()", + "Doublematrix = Doublematrix()", + " (Numeric.ArrayType,2,'i'): Integermatrix,", + " (Numeric.ArrayType,2,'l'): Longmatrix,", + " (Numeric.ArrayType,2,'d'): Doublematrix," + ], + "deleted": [ + "class Matrix(Vector):", + "class IntegerMatrix(Matrix):", + "class LongMatrix(Matrix):", + "class DoubleMatrix(Matrix):", + "IntegerMatrix = IntegerMatrix()", + "LongMatrix = LongMatrix()", + "DoubleMatrix = DoubleMatrix()", + " (Numeric.ArrayType,2,'i'): IntegerMatrix,", + " (Numeric.ArrayType,2,'l'): LongMatrix,", + " (Numeric.ArrayType,2,'d'): DoubleMatrix," + ] + } + }, + { + "old_path": "weave/ast_tools.py", + "new_path": "weave/ast_tools.py", + "filename": "ast_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -146,7 +146,7 @@ def harvest_variables(ast_list):\n return variables\n \n def match(pattern, data, vars=None):\n- \"\"\"Match `data' to `pattern', with variable extraction.\n+ \"\"\"match `data' to `pattern', with variable extraction.\n \n pattern\n Pattern to match against, possibly containing variables.\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "source_code_before": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"Match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "methods": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "ast_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "ast_tools.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "ast_tools.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 204, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "ast_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "ast_tools.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "ast_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "ast_tools.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "ast_tools.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "ast_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "ast_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 204, + "end_line": 206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "ast_tools.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + } + ], + "nloc": 123, + "complexity": 46, + "token_count": 703, + "diff_parsed": { + "added": [ + " \"\"\"match `data' to `pattern', with variable extraction." + ], + "deleted": [ + " \"\"\"Match `data' to `pattern', with variable extraction." + ] + } + }, + { + "old_path": "weave/misc.py", + "new_path": "weave/misc.py", + "filename": "misc.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -146,7 +146,7 @@ def harvest_variables(ast_list):\n return variables\n \n def match(pattern, data, vars=None):\n- \"\"\"Match `data' to `pattern', with variable extraction.\n+ \"\"\"match `data' to `pattern', with variable extraction.\n \n pattern\n Pattern to match against, possibly containing variables.\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "source_code_before": "import token\nimport symbol\nimport parser\n\nfrom types import ListType, TupleType, StringType, IntType\n\ndef int_to_symbol(i):\n \"\"\" Convert numeric symbol or token to a desriptive name.\n \"\"\"\n try: \n return symbol.sym_name[i]\n except KeyError:\n return token.tok_name[i]\n \ndef translate_symbols(ast_tuple):\n \"\"\" Translate numeric grammar symbols in an ast_tuple descriptive names.\n \n This simply traverses the tree converting any integer value to values\n found in symbol.sym_name or token.tok_name.\n \"\"\" \n new_list = []\n for item in ast_tuple:\n if type(item) == IntType:\n new_list.append(int_to_symbol(item))\n elif type(item) in [TupleType,ListType]:\n new_list.append(translate_symbols(item))\n else: \n new_list.append(item)\n if type(ast_tuple) == TupleType:\n return tuple(new_list)\n else:\n return new_list\n\ndef ast_to_string(ast_seq):\n \"\"\"* Traverse an ast tree sequence, printing out all leaf nodes.\n \n This effectively rebuilds the expression the tree was built\n from. I guess its probably missing whitespace. How bout\n indent stuff and new lines? Haven't checked this since we're\n currently only dealing with simple expressions.\n *\"\"\"\n output = ''\n for item in ast_seq:\n if type(item) is StringType:\n output = output + item\n elif type(item) in [ListType,TupleType]:\n output = output + ast_to_string(item)\n return output \n\ndef build_atom(expr_string):\n \"\"\" Build an ast for an atom from the given expr string.\n \n If expr_string is not a string, it is converted to a string\n before parsing to an ast_tuple.\n \"\"\"\n # the [1][1] indexing below starts atoms at the third level\n # deep in the resulting parse tree. parser.expr will return\n # a tree rooted with eval_input -> test_list -> test ...\n # I'm considering test to be the root of atom symbols.\n # It might be a better idea to move down a little in the\n # parse tree. Any benefits? Right now, this works fine. \n if type(expr_string) == StringType:\n ast = parser.expr(expr_string).totuple()[1][1]\n else:\n ast = parser.expr(`expr_string`).totuple()[1][1]\n return ast\n\ndef atom_tuple(expr_string):\n return build_atom(expr_string)\n\ndef atom_list(expr_string):\n return tuples_to_lists(build_atom(expr_string))\n \ndef find_first_pattern(ast_tuple,pattern_list):\n \"\"\"* Find the first occurence of a pattern one of a list of patterns \n in ast_tuple.\n \n Used for testing at the moment.\n \n ast_tuple -- tuple or list created by ast.totuple() or ast.tolist().\n pattern_list -- A single pattern or list of patterns to search\n for in the ast_tuple. If a single pattern is \n used, it MUST BE A IN A TUPLE format.\n Returns:\n found -- true/false indicating whether pattern was found\n data -- dictionary of data from first matching pattern in tree.\n (see match function by Jeremy Hylton). \n *\"\"\"\n found,data = 0,{}\n \n # convert to a list if input wasn't a list\n if type(pattern_list) != ListType:\n pattern_list = [pattern_list]\n\n # look for any of the patterns in a list of patterns \n for pattern in pattern_list:\n found,data = match(pattern,ast_tuple)\n if found: \n break \n \n # if we didn't find the pattern, search sub-trees of the parse tree\n if not found: \n for item in ast_tuple: \n if type(item) in [TupleType,ListType]:\n # only search sub items if they are a list or tuple.\n found, data = find_first_pattern(item,pattern_list)\n if found: \n break \n return found,data\n\nname_pattern = (token.NAME, ['var'])\n\ndef remove_duplicates(lst):\n output = []\n for item in lst:\n if item not in output:\n output.append(item)\n return output\n\nreserved_names = ['sin']\n\ndef remove_reserved_names(lst):\n \"\"\" These are functions names -- don't create variables for them\n There is a more reobust approach, but this ought to work pretty\n well.\n \"\"\"\n output = []\n for item in lst:\n if item not in reserved_names:\n output.append(item)\n return output\n\ndef harvest_variables(ast_list): \n \"\"\" Retreive all the variables that need to be defined.\n \"\"\" \n variables = []\n if type(ast_list) in (ListType,TupleType):\n found,data = match(name_pattern,ast_list)\n if found:\n variables.append(data['var'])\n for item in ast_list:\n if type(item) in (ListType,TupleType):\n variables.extend(harvest_variables(item))\n variables = remove_duplicates(variables) \n variables = remove_reserved_names(variables) \n return variables\n\ndef match(pattern, data, vars=None):\n \"\"\"Match `data' to `pattern', with variable extraction.\n\n pattern\n Pattern to match against, possibly containing variables.\n\n data\n Data to be checked and against which variables are extracted.\n\n vars\n Dictionary of variables which have already been found. If not\n provided, an empty dictionary is created.\n\n The `pattern' value may contain variables of the form ['varname'] which\n are allowed to match anything. The value that is matched is returned as\n part of a dictionary which maps 'varname' to the matched value. 'varname'\n is not required to be a string object, but using strings makes patterns\n and the code which uses them more readable.\n\n This function returns two values: a boolean indicating whether a match\n was found and a dictionary mapping variable names to their associated\n values.\n \n From the Demo/Parser/example.py file\n \"\"\"\n if vars is None:\n vars = {}\n if type(pattern) is ListType: # 'variables' are ['varname']\n vars[pattern[0]] = data\n return 1, vars\n if type(pattern) is not TupleType:\n return (pattern == data), vars\n if len(data) != len(pattern):\n return 0, vars\n for pattern, data in map(None, pattern, data):\n same, vars = match(pattern, data, vars)\n if not same:\n break\n return same, vars\n\n\ndef tuples_to_lists(ast_tuple):\n \"\"\" Convert an ast object tree in tuple form to list form.\n \"\"\"\n if type(ast_tuple) not in [ListType,TupleType]:\n return ast_tuple\n \n new_list = []\n for item in ast_tuple:\n new_list.append(tuples_to_lists(item))\n return new_list\n \n\"\"\"\nA little tree I built to help me understand the parse trees.\n -----------303------------------------------\n | | \n 304 -------------------------307-------------------------\n | | | | | |\n 1 'result' 9 '[' 308 12 ',' 308 10 ']'\n | |\n ---------309-------- -----309-------- \n | | | | \n 291|304 291|304 291|304 |\n | | | |\n 1 'a1' 11 ':' 1 'a2' 2 '10' 11 ':' \n\"\"\"\n", + "methods": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "misc.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "misc.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "misc.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "misc.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "misc.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "misc.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "misc.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "misc.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "misc.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "misc.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "misc.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "misc.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "int_to_symbol", + "long_name": "int_to_symbol( i )", + "filename": "misc.py", + "nloc": 5, + "complexity": 2, + "token_count": 25, + "parameters": [ + "i" + ], + "start_line": 7, + "end_line": 13, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "translate_symbols", + "long_name": "translate_symbols( ast_tuple )", + "filename": "misc.py", + "nloc": 13, + "complexity": 5, + "token_count": 78, + "parameters": [ + "ast_tuple" + ], + "start_line": 15, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "ast_to_string", + "long_name": "ast_to_string( ast_seq )", + "filename": "misc.py", + "nloc": 8, + "complexity": 4, + "token_count": 49, + "parameters": [ + "ast_seq" + ], + "start_line": 34, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "build_atom", + "long_name": "build_atom( expr_string )", + "filename": "misc.py", + "nloc": 6, + "complexity": 2, + "token_count": 56, + "parameters": [ + "expr_string" + ], + "start_line": 50, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 0 + }, + { + "name": "atom_tuple", + "long_name": "atom_tuple( expr_string )", + "filename": "misc.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "expr_string" + ], + "start_line": 68, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "atom_list", + "long_name": "atom_list( expr_string )", + "filename": "misc.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [ + "expr_string" + ], + "start_line": 71, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "find_first_pattern", + "long_name": "find_first_pattern( ast_tuple , pattern_list )", + "filename": "misc.py", + "nloc": 15, + "complexity": 8, + "token_count": 87, + "parameters": [ + "ast_tuple", + "pattern_list" + ], + "start_line": 74, + "end_line": 109, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 0 + }, + { + "name": "remove_duplicates", + "long_name": "remove_duplicates( lst )", + "filename": "misc.py", + "nloc": 6, + "complexity": 3, + "token_count": 28, + "parameters": [ + "lst" + ], + "start_line": 113, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "remove_reserved_names", + "long_name": "remove_reserved_names( lst )", + "filename": "misc.py", + "nloc": 6, + "complexity": 3, + "token_count": 29, + "parameters": [ + "lst" + ], + "start_line": 122, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "harvest_variables", + "long_name": "harvest_variables( ast_list )", + "filename": "misc.py", + "nloc": 12, + "complexity": 5, + "token_count": 84, + "parameters": [ + "ast_list" + ], + "start_line": 133, + "end_line": 146, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "misc.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + }, + { + "name": "tuples_to_lists", + "long_name": "tuples_to_lists( ast_tuple )", + "filename": "misc.py", + "nloc": 7, + "complexity": 3, + "token_count": 41, + "parameters": [ + "ast_tuple" + ], + "start_line": 189, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "match", + "long_name": "match( pattern , data , vars = None )", + "filename": "misc.py", + "nloc": 15, + "complexity": 7, + "token_count": 109, + "parameters": [ + "pattern", + "data", + "vars" + ], + "start_line": 148, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 0 + } + ], + "nloc": 117, + "complexity": 44, + "token_count": 654, + "diff_parsed": { + "added": [ + " \"\"\"match `data' to `pattern', with variable extraction." + ], + "deleted": [ + " \"\"\"Match `data' to `pattern', with variable extraction." + ] + } + } + ] + }, + { + "hash": "6983f43207fd2cca82c98a15e31dd50d14a90127", + "msg": "Changed isposinf and isneginf.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-03T21:12:50+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T21:12:50+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "db8bb3424741a0486653e63d8cee49212c1cc65c" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 544, + "insertions": 18, + "lines": 562, + "files": 5, + "dmm_unit_size": 0.2222222222222222, + "dmm_unit_complexity": 0.05555555555555555, + "dmm_unit_interfacing": 0.22549019607843138, + "modified_files": [ + { + "old_path": "scipy_base/__init__.py", + "new_path": "scipy_base/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,9 +4,6 @@\n import fastumath\n import limits\n \n-#from utility import *\n-#from convenience import *\n-\n from type_check import *\n from index_tricks import *\n from function_base import *\n@@ -20,9 +17,9 @@\n # needs fastumath\n Inf = inf = fastumath.PINF\n try:\n- NaN = nan = fastumath.NAN\n+ NAN = NaN = nan = fastumath.NAN\n except AttributeError:\n- NAN = nan = array(0.0)/array(0.0)\n+ NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n \n \n #---- testing ----#\n", + "added_lines": 2, + "deleted_lines": 5, + "source_code": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\nfrom transform_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NAN = NaN = nan = fastumath.NAN\nexcept AttributeError:\n NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "source_code_before": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\n#from utility import *\n#from convenience import *\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\nfrom transform_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NaN = nan = fastumath.NAN\nexcept AttributeError:\n NAN = nan = array(0.0)/array(0.0)\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 27, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 33, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 36, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 29, + "complexity": 2, + "token_count": 142, + "diff_parsed": { + "added": [ + " NAN = NaN = nan = fastumath.NAN", + " NaN = NAN = nan = fastumath.PINF - fastumath.PINF" + ], + "deleted": [ + "#from utility import *", + "#from convenience import *", + "", + " NaN = nan = fastumath.NAN", + " NAN = nan = array(0.0)/array(0.0)" + ] + } + }, + { + "old_path": "scipy_base/convenience.py", + "new_path": null, + "filename": "convenience.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,520 +0,0 @@\n-\"\"\"Contains basic routines of common interest. Always imported first.\n- Basically MLab minus the LinearAlgebra-dependent functions.\n-\n- But max is changed to amax (array max)\n- and min is changed to amin (array min)\n- so that the builtin max and min are still available.\n-\"\"\"\n-\n-\n-__all__ = ['logspace','linspace','round','any','all','fix','mod','fftshift',\n- 'ifftshift','fftfreq','cont_ft','toeplitz','hankel','real','imag',\n- 'iscomplex','isreal','iscomplexobj','isrealobj','isposinf',\n- 'isneginf','nan_to_num','eye','tri','diag','fliplr','flipud',\n- 'rot90','tril','triu','amax','amin','ptp','cumsum','prod','cumprod',\n- 'diff','squeeze','angle','unwrap','real_if_close',\n- 'sort_complex']\n-\n-import Numeric\n-\n-def logspace(start,stop,num=50,endpoint=1):\n- \"\"\"Evenly spaced samples on a logarithmic scale.\n-\n- Return num evenly spaced samples from 10**start to 10**stop. If\n- endpoint=1 then last sample is 10**stop.\n- \"\"\"\n- if endpoint:\n- step = (stop-start)/float((num-1))\n- y = Numeric.arange(0,num) * step + start\n- else:\n- step = (stop-start)/float(num)\n- y = Numeric.arange(0,num) * step + start\n- return Numeric.power(10.0,y)\n-\n-def linspace(start,stop,num=50,endpoint=1,retstep=0):\n- \"\"\"Evenly spaced samples.\n- \n- Return num evenly spaced samples from start to stop. If endpoint=1 then\n- last sample is stop. If retstep is 1 then return the step value used.\n- \"\"\"\n- if endpoint:\n- step = (stop-start)/float((num-1))\n- y = Numeric.arange(0,num) * step + start \n- else:\n- step = (stop-start)/float(num)\n- y = Numeric.arange(0,num) * step + start\n- if retstep:\n- return y, step\n- else:\n- return y\n-\n-#def round(arr):\n-# return Numeric.floor(arr+0.5)\n-round = Numeric.around\n-any = Numeric.sometrue\n-all = Numeric.alltrue\n-\n-def fix(x):\n- \"\"\"Round x to nearest integer towards zero.\n- \"\"\"\n- x = Numeric.asarray(x)\n- y = Numeric.floor(x)\n- return Numeric.where(x<0,y+1,y)\n-\n-def mod(x,y):\n- \"\"\"x - y*floor(x/y)\n- \n- For numeric arrays, x % y has the same sign as x while\n- mod(x,y) has the same sign as y.\n- \"\"\"\n- return x - y*Numeric.floor(x*1.0/y)\n-\n-def fftshift(x,axes=None):\n- \"\"\"Shift the result of an FFT operation.\n-\n- Return a shifted version of x (useful for obtaining centered spectra).\n- This function swaps \"half-spaces\" for all axes listed (defaults to all)\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.ceil(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def ifftshift(x,axes=None):\n- \"\"\"Reverse the effect of fftshift.\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.floor(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def fftfreq(N,sample=1.0):\n- \"\"\"FFT sample frequencies\n- \n- Return the frequency bins in cycles/unit (with zero at the start) given a\n- window length N and a sample spacing.\n- \"\"\"\n- N = int(N)\n- sample = float(sample)\n- return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n-\n-def cont_ft(gn,fr,delta=1.0,n=None):\n- \"\"\"Compute the (scaled) DFT of gn at frequencies fr.\n-\n- If the gn are alias-free samples of a continuous time function then the\n- correct value for the spacing, delta, will give the properly scaled,\n- continuous Fourier spectrum.\n-\n- The DFT is obtained when delta=1.0\n- \"\"\"\n- if n is None:\n- n = Numeric.arange(len(gn))\n- dT = delta\n- trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n- return dT*Numeric.dot(trans_kernel,gn)\n-\n-def toeplitz(c,r=None):\n- \"\"\"Construct a toeplitz matrix (i.e. a matrix with constant diagonals).\n-\n- Description:\n-\n- toeplitz(c,r) is a non-symmetric Toeplitz matrix with c as its first\n- column and r as its first row.\n-\n- toeplitz(c) is a symmetric (Hermitian) Toeplitz matrix (r=c). \n-\n- See also: hankel\n- \"\"\"\n- if isscalar(c) or isscalar(r):\n- return c \n- if r is None:\n- r = c\n- r[0] = Numeric.conjugate(r[0])\n- c = Numeric.conjugate(c)\n- r,c = map(Numeric.asarray,(r,c))\n- r,c = map(Numeric.ravel,(r,c))\n- rN,cN = map(len,(r,c))\n- if r[0] != c[0]:\n- print \"Warning: column and row values don't agree; column value used.\"\n- vals = r_[r[rN-1:0:-1], c]\n- cols = grid[0:cN]\n- rows = grid[rN:0:-1]\n- indx = cols[:,Numeric.NewAxis]*Numeric.ones((1,rN)) + \\\n- rows[Numeric.NewAxis,:]*Numeric.ones((cN,1)) - 1\n- return Numeric.take(vals, indx)\n-\n-\n-def hankel(c,r=None):\n- \"\"\"Construct a hankel matrix (i.e. matrix with constant anti-diagonals).\n-\n- Description:\n-\n- hankel(c,r) is a Hankel matrix whose first column is c and whose\n- last row is r.\n-\n- hankel(c) is a square Hankel matrix whose first column is C.\n- Elements below the first anti-diagonal are zero.\n-\n- See also: toeplitz\n- \"\"\"\n- if isscalar(c) or isscalar(r):\n- return c \n- if r is None:\n- r = Numeric.zeros(len(c))\n- elif r[0] != c[-1]:\n- print \"Warning: column and row values don't agree; column value used.\"\n- r,c = map(Numeric.asarray,(r,c))\n- r,c = map(Numeric.ravel,(r,c))\n- rN,cN = map(len,(r,c))\n- vals = r_[c, r[1:rN]]\n- cols = grid[1:cN+1]\n- rows = grid[0:rN]\n- indx = cols[:,Numeric.NewAxis]*Numeric.ones((1,rN)) + \\\n- rows[Numeric.NewAxis,:]*Numeric.ones((cN,1)) - 1\n- return Numeric.take(vals, indx)\n-\n-\n-def real(val):\n- aval = asarray(val)\n- if aval.typecode() in ['F', 'D']:\n- return aval.real\n- else:\n- return aval\n-\n-def imag(val):\n- aval = asarray(val)\n- if aval.typecode() in ['F', 'D']:\n- return aval.imag\n- else:\n- return array(0,aval.typecode())*aval\n-\n-def iscomplex(x):\n- return imag(x) != Numeric.zeros(asarray(x).shape)\n-\n-def isreal(x):\n- return imag(x) == Numeric.zeros(asarray(x).shape)\n-\n-def iscomplexobj(x):\n- return asarray(x).typecode() in ['F', 'D']\n-\n-def isrealobj(x):\n- return not asarray(x).typecode() in ['F', 'D']\n-\n-def isposinf(val):\n- # complex not handled currently (and potentially ambiguous)\n- return Numeric.logical_and(isinf(val),val > 0)\n-\n-def isneginf(val):\n- # complex not handled currently (and potentially ambiguous)\n- return Numeric.logical_and(isinf(val),val < 0)\n- \n-def nan_to_num(x):\n- # mapping:\n- # NaN -> 0\n- # Inf -> scipy.limits.double_max\n- # -Inf -> scipy.limits.double_min\n- # complex not handled currently\n- import limits\n- try:\n- t = x.typecode()\n- except AttributeError:\n- t = type(x)\n- if t in [ComplexType,'F','D']: \n- y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n- else: \n- x = Numeric.asarray(x)\n- are_inf = isposinf(x)\n- are_neg_inf = isneginf(x)\n- are_nan = isnan(x)\n- choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n- y = Numeric.choose(choose_array,\n- (x,scipy.limits.double_min, 0., scipy.limits.double_max))\n- return y\n-\n-# These are from Numeric\n-from Numeric import *\n-import Numeric\n-import Matrix\n-from utility import isscalar\n-from fastumath import *\n-\n-\n-# Elementary matrices\n-\n-# zeros is from matrixmodule in C\n-# ones is from Numeric.py\n-\n-\n-def eye(N, M=None, k=0, typecode=None):\n- \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the \n- k-th diagonal is all ones, and everything else is zeros.\n- \"\"\"\n- if M is None: M = N\n- if type(M) == type('d'): \n- typecode = M\n- M = N\n- m = equal(subtract.outer(arange(N), arange(M)),-k)\n- if typecode is None:\n- return m\n- else:\n- return m.astype(typecode)\n-\n-def tri(N, M=None, k=0, typecode=None):\n- \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all\n- the diagonals starting from lower left corner up to the k-th are all ones.\n- \"\"\"\n- if M is None: M = N\n- if type(M) == type('d'): \n- typecode = M\n- M = N\n- m = greater_equal(subtract.outer(arange(N), arange(M)),-k)\n- if typecode is None:\n- return m\n- else:\n- return m.astype(typecode)\n- \n-# matrix manipulation\n-\n-def diag(v, k=0):\n- \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or\n- returns a matrix with v as the k-th diagonal if v is a vector.\n- \"\"\"\n- v = asarray(v)\n- s = v.shape\n- if len(s)==1:\n- n = s[0]+abs(k)\n- if k > 0:\n- v = concatenate((zeros(k, v.typecode()),v))\n- elif k < 0:\n- v = concatenate((v,zeros(-k, v.typecode())))\n- return eye(n, k=k)*v\n- elif len(s)==2:\n- v = add.reduce(eye(s[0], s[1], k=k)*v)\n- if k > 0: return v[k:]\n- elif k < 0: return v[:k]\n- else: return v\n- else:\n- raise ValueError, \"Input must be 1- or 2-D.\"\n- \n-def fliplr(m):\n- \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and\n- columns flipped in the left/right direction. Only works with 2-D\n- arrays.\n- \"\"\"\n- m = asarray(m)\n- if len(m.shape) != 2:\n- raise ValueError, \"Input must be 2-D.\"\n- return m[:, ::-1]\n-\n-def flipud(m):\n- \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and\n- rows flipped in the up/down direction. Only works with 2-D arrays.\n- \"\"\"\n- m = asarray(m)\n- if len(m.shape) != 2:\n- raise ValueError, \"Input must be 2-D.\"\n- return m[::-1]\n- \n-# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n-\n-def rot90(m, k=1):\n- \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees\n- in the counterclockwise direction.\n- \"\"\"\n- m = asarray(m)\n- if len(m.shape) != 2:\n- raise ValueError, \"Input must be 2-D.\"\n- k = k % 4\n- if k == 0: return m\n- elif k == 1: return transpose(fliplr(m))\n- elif k == 2: return fliplr(flipud(m))\n- else: return fliplr(transpose(m)) # k==3\n-\n-def tril(m, k=0):\n- \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of\n- m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n- diagonal.\n- \"\"\"\n- svsp = m.spacesaver()\n- m = asarray(m,savespace=1)\n- out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m\n- out.savespace(svsp)\n- return out\n-\n-def triu(m, k=0):\n- \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of\n- m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n- diagonal.\n- \"\"\"\n- svsp = m.spacesaver()\n- m = asarray(m,savespace=1)\n- out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m\n- out.savespace(svsp)\n- return out\n-\n-# Data analysis\n-\n-# Basic operations\n-def amax(m,axis=-1):\n- \"\"\"Returns the maximum of m along dimension axis. \n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else:\n- m = asarray(m)\n- return maximum.reduce(m,axis)\n-\n-def amin(m,axis=-1):\n- \"\"\"Returns the minimum of m along dimension axis.\n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else: \n- m = asarray(m)\n- return minimum.reduce(m,axis)\n-\n-# Actually from Basis, but it fits in so naturally here...\n-\n-def ptp(m,axis=-1):\n- \"\"\"Returns the maximum - minimum along the the given dimension\n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else:\n- m = asarray(m)\n- return amax(m,axis)-amin(m,axis)\n-\n-def cumsum(m,axis=-1):\n- \"\"\"Returns the cumulative sum of the elements along the given axis\n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else:\n- m = asarray(m)\n- return add.accumulate(m,axis)\n-\n-def prod(m,axis=-1):\n- \"\"\"Returns the product of the elements along the given axis\n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else:\n- m = asarray(m)\n- return multiply.reduce(m,axis)\n-\n-def cumprod(m,axis=-1):\n- \"\"\"Returns the cumulative product of the elments along the given axis\n- \"\"\"\n- if axis is None:\n- m = ravel(m)\n- axis = 0\n- else:\n- m = asarray(m)\n- return multiply.accumulate(m,axis)\n-\n-def diff(x, n=1,axis=-1):\n- \"\"\"Calculates the nth order, discrete difference along given axis.\n- \"\"\"\n- x = asarray(x)\n- nd = len(x.shape)\n- slice1 = [slice(None)]*nd\n- slice2 = [slice(None)]*nd\n- slice1[axis] = slice(1,None)\n- slice2[axis] = slice(None,-1)\n- if n > 1:\n- return diff(x[slice1]-x[slice2], n-1, axis=axis)\n- else:\n- return x[slice1]-x[slice2]\n-\n-def squeeze(a):\n- \"Returns a with any ones from the shape of a removed\"\n- a = asarray(a)\n- b = asarray(a.shape)\n- return reshape (a, tuple (compress (not_equal (b, 1), b)))\n-\n-def angle(z,deg=0):\n- \"\"\"Return the angle of complex argument z.\"\"\"\n- if deg:\n- fact = 180/pi\n- else:\n- fact = 1.0\n- z = asarray(z)\n- if z.typecode() in ['D','F']:\n- zimag = z.imag\n- zreal = z.real\n- else:\n- zimag = 0\n- zreal = z\n- return arctan2(zimag,zreal) * fact\n-\n-import copy\n-def unwrap(p,discont=pi,axis=-1):\n- \"\"\"unwrap(p,discont=pi,axis=-1)\n-\n- unwraps radian phase p by changing absolute jumps greater than discont to\n- their 2*pi complement along the given axis.\n- \"\"\"\n- p = asarray(p)\n- nd = len(p.shape)\n- dd = diff(p,axis=axis)\n- slice1 = [slice(None,None)]*nd # full slices\n- slice1[axis] = slice(1,None)\n- ddmod = mod(dd+pi,2*pi)-pi\n- putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n- ph_correct = ddmod - dd;\n- putmask(ph_correct,abs(dd) 0)\n\ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n return Numeric.logical_and(isinf(val),val < 0)\n \ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> scipy.limits.double_max\n # -Inf -> scipy.limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,scipy.limits.double_min, 0., scipy.limits.double_max))\n return y\n\n# These are from Numeric\nfrom Numeric import *\nimport Numeric\nimport Matrix\nfrom utility import isscalar\nfrom fastumath import *\n\n\n# Elementary matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n\ndef eye(N, M=None, k=0, typecode=None):\n \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the \n k-th diagonal is all ones, and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef tri(N, M=None, k=0, typecode=None):\n \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all\n the diagonals starting from lower left corner up to the k-th are all ones.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = greater_equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n \n# matrix manipulation\n\ndef diag(v, k=0):\n \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or\n returns a matrix with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n \ndef fliplr(m):\n \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and\n columns flipped in the left/right direction. Only works with 2-D\n arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and\n rows flipped in the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees\n in the counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n\ndef tril(m, k=0):\n \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of\n m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n diagonal.\n \"\"\"\n svsp = m.spacesaver()\n m = asarray(m,savespace=1)\n out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m\n out.savespace(svsp)\n return out\n\ndef triu(m, k=0):\n \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of\n m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main\n diagonal.\n \"\"\"\n svsp = m.spacesaver()\n m = asarray(m,savespace=1)\n out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m\n out.savespace(svsp)\n return out\n\n# Data analysis\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef squeeze(a):\n \"Returns a with any ones from the shape of a removed\"\n a = asarray(a)\n b = asarray(a.shape)\n return reshape (a, tuple (compress (not_equal (b, 1), b)))\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\nimport copy\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd) 0)", + "", + "def isneginf(val):", + " # complex not handled currently (and potentially ambiguous)", + " return Numeric.logical_and(isinf(val),val < 0)", + "", + "def nan_to_num(x):", + " # mapping:", + " # NaN -> 0", + " # Inf -> scipy.limits.double_max", + " # -Inf -> scipy.limits.double_min", + " # complex not handled currently", + " import limits", + " try:", + " t = x.typecode()", + " except AttributeError:", + " t = type(x)", + " if t in [ComplexType,'F','D']:", + " y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)", + " else:", + " x = Numeric.asarray(x)", + " are_inf = isposinf(x)", + " are_neg_inf = isneginf(x)", + " are_nan = isnan(x)", + " choose_array = are_neg_inf + are_nan * 2 + are_inf * 3", + " y = Numeric.choose(choose_array,", + " (x,scipy.limits.double_min, 0., scipy.limits.double_max))", + " return y", + "", + "# These are from Numeric", + "from Numeric import *", + "import Numeric", + "import Matrix", + "from utility import isscalar", + "from fastumath import *", + "", + "", + "# Elementary matrices", + "", + "# zeros is from matrixmodule in C", + "# ones is from Numeric.py", + "", + "", + "def eye(N, M=None, k=0, typecode=None):", + " \"\"\"eye(N, M=N, k=0, typecode=None) returns a N-by-M matrix where the", + " k-th diagonal is all ones, and everything else is zeros.", + " \"\"\"", + " if M is None: M = N", + " if type(M) == type('d'):", + " typecode = M", + " M = N", + " m = equal(subtract.outer(arange(N), arange(M)),-k)", + " if typecode is None:", + " return m", + " else:", + " return m.astype(typecode)", + "", + "def tri(N, M=None, k=0, typecode=None):", + " \"\"\"tri(N, M=N, k=0, typecode=None) returns a N-by-M matrix where all", + " the diagonals starting from lower left corner up to the k-th are all ones.", + " \"\"\"", + " if M is None: M = N", + " if type(M) == type('d'):", + " typecode = M", + " M = N", + " m = greater_equal(subtract.outer(arange(N), arange(M)),-k)", + " if typecode is None:", + " return m", + " else:", + " return m.astype(typecode)", + "", + "# matrix manipulation", + "", + "def diag(v, k=0):", + " \"\"\"diag(v,k=0) returns the k-th diagonal if v is a matrix or", + " returns a matrix with v as the k-th diagonal if v is a vector.", + " \"\"\"", + " v = asarray(v)", + " s = v.shape", + " if len(s)==1:", + " n = s[0]+abs(k)", + " if k > 0:", + " v = concatenate((zeros(k, v.typecode()),v))", + " elif k < 0:", + " v = concatenate((v,zeros(-k, v.typecode())))", + " return eye(n, k=k)*v", + " elif len(s)==2:", + " v = add.reduce(eye(s[0], s[1], k=k)*v)", + " if k > 0: return v[k:]", + " elif k < 0: return v[:k]", + " else: return v", + " else:", + " raise ValueError, \"Input must be 1- or 2-D.\"", + "", + "def fliplr(m):", + " \"\"\"fliplr(m) returns a 2-D matrix m with the rows preserved and", + " columns flipped in the left/right direction. Only works with 2-D", + " arrays.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " return m[:, ::-1]", + "", + "def flipud(m):", + " \"\"\"flipud(m) returns a 2-D matrix with the columns preserved and", + " rows flipped in the up/down direction. Only works with 2-D arrays.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " return m[::-1]", + "", + "# reshape(x, m, n) is not used, instead use reshape(x, (m, n))", + "", + "def rot90(m, k=1):", + " \"\"\"rot90(m,k=1) returns the matrix found by rotating m by k*90 degrees", + " in the counterclockwise direction.", + " \"\"\"", + " m = asarray(m)", + " if len(m.shape) != 2:", + " raise ValueError, \"Input must be 2-D.\"", + " k = k % 4", + " if k == 0: return m", + " elif k == 1: return transpose(fliplr(m))", + " elif k == 2: return fliplr(flipud(m))", + " else: return fliplr(transpose(m)) # k==3", + "", + "def tril(m, k=0):", + " \"\"\"tril(m,k=0) returns the elements on and below the k-th diagonal of", + " m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main", + " diagonal.", + " \"\"\"", + " svsp = m.spacesaver()", + " m = asarray(m,savespace=1)", + " out = tri(m.shape[0], m.shape[1], k=k, typecode=m.typecode())*m", + " out.savespace(svsp)", + " return out", + "", + "def triu(m, k=0):", + " \"\"\"triu(m,k=0) returns the elements on and above the k-th diagonal of", + " m. k=0 is the main diagonal, k > 0 is above and k < 0 is below the main", + " diagonal.", + " \"\"\"", + " svsp = m.spacesaver()", + " m = asarray(m,savespace=1)", + " out = (1-tri(m.shape[0], m.shape[1], k-1, m.typecode()))*m", + " out.savespace(svsp)", + " return out", + "", + "# Data analysis", + "", + "# Basic operations", + "def amax(m,axis=-1):", + " \"\"\"Returns the maximum of m along dimension axis.", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return maximum.reduce(m,axis)", + "", + "def amin(m,axis=-1):", + " \"\"\"Returns the minimum of m along dimension axis.", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return minimum.reduce(m,axis)", + "", + "# Actually from Basis, but it fits in so naturally here...", + "", + "def ptp(m,axis=-1):", + " \"\"\"Returns the maximum - minimum along the the given dimension", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return amax(m,axis)-amin(m,axis)", + "", + "def cumsum(m,axis=-1):", + " \"\"\"Returns the cumulative sum of the elements along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return add.accumulate(m,axis)", + "", + "def prod(m,axis=-1):", + " \"\"\"Returns the product of the elements along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return multiply.reduce(m,axis)", + "", + "def cumprod(m,axis=-1):", + " \"\"\"Returns the cumulative product of the elments along the given axis", + " \"\"\"", + " if axis is None:", + " m = ravel(m)", + " axis = 0", + " else:", + " m = asarray(m)", + " return multiply.accumulate(m,axis)", + "", + "def diff(x, n=1,axis=-1):", + " \"\"\"Calculates the nth order, discrete difference along given axis.", + " \"\"\"", + " x = asarray(x)", + " nd = len(x.shape)", + " slice1 = [slice(None)]*nd", + " slice2 = [slice(None)]*nd", + " slice1[axis] = slice(1,None)", + " slice2[axis] = slice(None,-1)", + " if n > 1:", + " return diff(x[slice1]-x[slice2], n-1, axis=axis)", + " else:", + " return x[slice1]-x[slice2]", + "", + "def squeeze(a):", + " \"Returns a with any ones from the shape of a removed\"", + " a = asarray(a)", + " b = asarray(a.shape)", + " return reshape (a, tuple (compress (not_equal (b, 1), b)))", + "", + "def angle(z,deg=0):", + " \"\"\"Return the angle of complex argument z.\"\"\"", + " if deg:", + " fact = 180/pi", + " else:", + " fact = 1.0", + " z = asarray(z)", + " if z.typecode() in ['D','F']:", + " zimag = z.imag", + " zreal = z.real", + " else:", + " zimag = 0", + " zreal = z", + " return arctan2(zimag,zreal) * fact", + "", + "import copy", + "def unwrap(p,discont=pi,axis=-1):", + " \"\"\"unwrap(p,discont=pi,axis=-1)", + "", + " unwraps radian phase p by changing absolute jumps greater than discont to", + " their 2*pi complement along the given axis.", + " \"\"\"", + " p = asarray(p)", + " nd = len(p.shape)", + " dd = diff(p,axis=axis)", + " slice1 = [slice(None,None)]*nd # full slices", + " slice1[axis] = slice(1,None)", + " ddmod = mod(dd+pi,2*pi)-pi", + " putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)", + " ph_correct = ddmod - dd;", + " putmask(ph_correct,abs(dd)\n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "source_code_before": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "methods": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 47, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 55, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 63, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 71, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 88, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 104, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 113, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 129, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 137, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 157, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 162, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 177, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 188, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 231, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 277, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 302, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 311, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 319, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 337, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 342, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 347, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 352, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 360, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 368, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 377, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 386, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 394, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 402, + "end_line": 420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 422, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 442, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 465, + "end_line": 471, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 472, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 486, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 493, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 500, + "end_line": 506, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 507, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 514, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 521, + "end_line": 527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 528, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 535, + "end_line": 541, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 542, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 549, + "end_line": 555, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 556, + "end_line": 562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 563, + "end_line": 569, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 570, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 577, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 584, + "end_line": 590, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 591, + "end_line": 603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 604, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 617, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 722, + "end_line": 826, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 827, + "end_line": 931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 932, + "end_line": 938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 939, + "end_line": 945, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 946, + "end_line": 952, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 953, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 960, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 967, + "end_line": 973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 974, + "end_line": 980, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 981, + "end_line": 987, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 988, + "end_line": 994, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 995, + "end_line": 1001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1002, + "end_line": 1008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1009, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1016, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1023, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1030, + "end_line": 1036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1037, + "end_line": 1043, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1044, + "end_line": 1045, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1046, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1069, + "end_line": 1075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1076, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1083, + "end_line": 1089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1090, + "end_line": 1096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1097, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1104, + "end_line": 1110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1111, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1118, + "end_line": 1124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1125, + "end_line": 1131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1132, + "end_line": 1133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1134, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1206, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1222, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1230, + "end_line": 1236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1237, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1244, + "end_line": 1250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1251, + "end_line": 1257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1258, + "end_line": 1264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1265, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1272, + "end_line": 1278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1279, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1286, + "end_line": 1292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1294, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1301, + "end_line": 1307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1308, + "end_line": 1314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1315, + "end_line": 1321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1322, + "end_line": 1328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1329, + "end_line": 1335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1336, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1343, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1350, + "end_line": 1356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1553, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1554, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1575, + "end_line": 1581, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1638, + "end_line": 1644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1701, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1764, + "end_line": 1765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1789, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1796, + "end_line": 1802, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1803, + "end_line": 1809, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1810, + "end_line": 1816, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1817, + "end_line": 1823, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1824, + "end_line": 1830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1847, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1854, + "end_line": 1860, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1861, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1868, + "end_line": 1874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1875, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1882, + "end_line": 1888, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1889, + "end_line": 1895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1896, + "end_line": 1903, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1904, + "end_line": 1911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1912, + "end_line": 1918, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1919, + "end_line": 1925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1926, + "end_line": 1932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1933, + "end_line": 1939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1940, + "end_line": 1946, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1947, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1954, + "end_line": 1960, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1961, + "end_line": 1967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1968, + "end_line": 1974, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1975, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1982, + "end_line": 1988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1989, + "end_line": 1995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1996, + "end_line": 2002, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2003, + "end_line": 2009, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2010, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2017, + "end_line": 2018, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2019, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2034, + "end_line": 2040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2041, + "end_line": 2047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2055, + "end_line": 2061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2062, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2069, + "end_line": 2075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2076, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2083, + "end_line": 2089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2090, + "end_line": 2096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2183, + "end_line": 2526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2535, + "end_line": 2591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 47, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 55, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 63, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 71, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 88, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 104, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 113, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 129, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 137, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 157, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 162, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 177, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 188, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 231, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 277, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 302, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 311, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 319, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 337, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 342, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 347, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 352, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 360, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 368, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 377, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 386, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 394, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 402, + "end_line": 420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 422, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 442, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 465, + "end_line": 471, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 472, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 486, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 493, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 500, + "end_line": 506, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 507, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 514, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 521, + "end_line": 527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 528, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 535, + "end_line": 541, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 542, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 549, + "end_line": 555, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 556, + "end_line": 562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 563, + "end_line": 569, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 570, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 577, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 584, + "end_line": 590, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 591, + "end_line": 603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 604, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 617, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 722, + "end_line": 826, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 827, + "end_line": 931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 932, + "end_line": 938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 939, + "end_line": 945, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 946, + "end_line": 952, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 953, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 960, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 967, + "end_line": 973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 974, + "end_line": 980, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 981, + "end_line": 987, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 988, + "end_line": 994, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 995, + "end_line": 1001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1002, + "end_line": 1008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1009, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1016, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1023, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1030, + "end_line": 1036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1037, + "end_line": 1043, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1044, + "end_line": 1045, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1046, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1069, + "end_line": 1075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1076, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1083, + "end_line": 1089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1090, + "end_line": 1096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1097, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1104, + "end_line": 1110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1111, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1118, + "end_line": 1124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1125, + "end_line": 1131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1132, + "end_line": 1133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1134, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1206, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1222, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1230, + "end_line": 1236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1237, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1244, + "end_line": 1250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1251, + "end_line": 1257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1258, + "end_line": 1264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1265, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1272, + "end_line": 1278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1279, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1286, + "end_line": 1292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1294, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1301, + "end_line": 1307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1308, + "end_line": 1314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1315, + "end_line": 1321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1322, + "end_line": 1328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1329, + "end_line": 1335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1336, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1343, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1350, + "end_line": 1356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1553, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1554, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1575, + "end_line": 1581, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1638, + "end_line": 1644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1701, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1764, + "end_line": 1765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1789, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1796, + "end_line": 1802, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1803, + "end_line": 1809, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1810, + "end_line": 1816, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1817, + "end_line": 1823, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1824, + "end_line": 1830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1847, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1854, + "end_line": 1860, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1861, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1868, + "end_line": 1874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1875, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1882, + "end_line": 1888, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1889, + "end_line": 1895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1896, + "end_line": 1903, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1904, + "end_line": 1911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1912, + "end_line": 1918, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1919, + "end_line": 1925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1926, + "end_line": 1932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1933, + "end_line": 1939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1940, + "end_line": 1946, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1947, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1954, + "end_line": 1960, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1961, + "end_line": 1967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1968, + "end_line": 1974, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1975, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1982, + "end_line": 1988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1989, + "end_line": 1995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1996, + "end_line": 2002, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2003, + "end_line": 2009, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2010, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2017, + "end_line": 2018, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2019, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2034, + "end_line": 2040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2041, + "end_line": 2047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2055, + "end_line": 2061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2062, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2069, + "end_line": 2075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2076, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2083, + "end_line": 2089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2090, + "end_line": 2096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2183, + "end_line": 2526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2535, + "end_line": 2591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + } + ], + "nloc": 2374, + "complexity": 665, + "token_count": 40039, + "diff_parsed": { + "added": [ + "\t*((unsigned char *)op)= (*((double *)i1) == *((double *)i2));" + ], + "deleted": [ + "\t*((unsigned char *)op)=*((double *)i1) == *((double *)i2);" + ] + } + }, + { + "old_path": "scipy_base/testing.py", + "new_path": "scipy_base/testing.py", + "filename": "testing.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -316,6 +316,18 @@ def assert_array_almost_equal(x,y,decimal=6,err_msg=''):\n print shape(x),shape(y)\n print x, y\n raise ValueError, 'arrays are not almost equal'\n+\n+ def rand(*args):\n+ \"\"\" Returns an array of random numbers with the given shape.\n+ used for testing\n+ \"\"\"\n+ import whrandom\n+ results = zeros(args,Float64)\n+ f = results.flat\n+ for i in range(len(f)):\n+ f[i] = whrandom.random()\n+ return results \n+\n except:\n pass # Numeric not installed\n \n@@ -332,13 +344,3 @@ def output_exception():\n finally:\n type = value = tb = None # clean up\n \n-def rand(*args):\n- \"\"\" Returns an array of random numbers with the given shape.\n- used for testing\n- \"\"\"\n- import whrandom\n- results = zeros(args,Float64)\n- f = results.flat\n- for i in range(len(f)):\n- f[i] = whrandom.random()\n- return results \n", + "added_lines": 12, + "deleted_lines": 10, + "source_code": "import os,sys,time\nimport unittest\n\nclass ScipyTestCase (unittest.TestCase):\n\n def measure(self,code_str,times=1):\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n 'ScipyTestCase runner for '+self.__class__.__name__,\n 'exec')\n i = 0\n elapsed = time.time()\n while i 0)\n- return val == PINF\n+ return isinf(val) & (val > 0)\n \n def isneginf(val):\n- # complex not handled currently (and potentially ambiguous)\n- #return Numeric.logical_and(isinf(val),val < 0)\n- return val == NINF\n+ return isinf(val) & (val < 0)\n \n ##def isinf(val):\n ## return Numeric.logical_or(isposinf(val),isneginf(val))\n", + "added_lines": 3, + "deleted_lines": 8, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename','cast']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntry:\n Char = Numeric.Character\nexcept AttributeError:\n Char = 'c'\n\ntoChar = lambda x: Numeric.array(x, Char)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef iscomplexobj(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef isrealobj(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\n##def isnan(val):\n## # fast, but apparently not portable (according to notes by Tim Peters)\n## #return val != val\n## # very slow -- should really use cephes methods or *something* different\n## import ieee_754\n## vals = ravel(val)\n## if array_iscomplex(vals):\n## r = array(map(ieee_754.isnan,real(vals))) \n## i = array(map(ieee_754.isnan,imag(vals)))\n## results = Numeric.logical_or(r,i)\n## else: \n## results = array(map(ieee_754.isnan,vals))\n## if isscalar(val):\n## results = results[0]\n## return results\n\ndef isposinf(val):\n return isinf(val) & (val > 0)\n \ndef isneginf(val):\n return isinf(val) & (val < 0)\n \n##def isinf(val):\n## return Numeric.logical_or(isposinf(val),isneginf(val))\n\n##def isfinite(val):\n## vals = asarray(val)\n## if iscomplexobj(vals):\n## r = isfinite(real(vals))\n## i = isfinite(imag(vals))\n## results = Numeric.logical_and(r,i)\n## else: \n## fin = Numeric.logical_not(isinf(val))\n## an = Numeric.logical_not(isnan(val))\n## results = Numeric.logical_and(fin,an)\n## return results \n\ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename','cast']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntry:\n Char = Numeric.Character\nexcept AttributeError:\n Char = 'c'\n\ntoChar = lambda x: Numeric.array(x, Char)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef iscomplexobj(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef isrealobj(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\n##def isnan(val):\n## # fast, but apparently not portable (according to notes by Tim Peters)\n## #return val != val\n## # very slow -- should really use cephes methods or *something* different\n## import ieee_754\n## vals = ravel(val)\n## if array_iscomplex(vals):\n## r = array(map(ieee_754.isnan,real(vals))) \n## i = array(map(ieee_754.isnan,imag(vals)))\n## results = Numeric.logical_or(r,i)\n## else: \n## results = array(map(ieee_754.isnan,vals))\n## if isscalar(val):\n## results = results[0]\n## return results\n\ndef isposinf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val > 0)\n return val == PINF\n \ndef isneginf(val):\n # complex not handled currently (and potentially ambiguous)\n #return Numeric.logical_and(isinf(val),val < 0)\n return val == NINF\n \n##def isinf(val):\n## return Numeric.logical_or(isposinf(val),isneginf(val))\n\n##def isfinite(val):\n## vals = asarray(val)\n## if iscomplexobj(vals):\n## r = isfinite(real(vals))\n## i = isfinite(imag(vals))\n## results = Numeric.logical_and(r,i)\n## else: \n## fin = Numeric.logical_not(isinf(val))\n## an = Numeric.logical_not(isnan(val))\n## results = Numeric.logical_and(fin,an)\n## return results \n\ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 114, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 139, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 161, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 172, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 189, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 45, + "end_line": 48, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 50, + "end_line": 55, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 57, + "end_line": 62, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 64, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 70, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 74, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 94, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "val" + ], + "start_line": 99, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 119, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 144, + "end_line": 148, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 166, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 177, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 190, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 194, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + } + ], + "nloc": 120, + "complexity": 24, + "token_count": 955, + "diff_parsed": { + "added": [ + "", + " return isinf(val) & (val > 0)", + " return isinf(val) & (val < 0)" + ], + "deleted": [ + "", + "", + " # complex not handled currently (and potentially ambiguous)", + " #return Numeric.logical_and(isinf(val),val > 0)", + " return val == PINF", + " # complex not handled currently (and potentially ambiguous)", + " #return Numeric.logical_and(isinf(val),val < 0)", + " return val == NINF" + ] + } + } + ] + }, + { + "hash": "f931eed8f80adf37c085fbcb9c7390d780f3ca38", + "msg": "Fixed pathsep problem", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2002-04-03T21:59:19+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T21:59:19+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "6983f43207fd2cca82c98a15e31dd50d14a90127" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 6, + "insertions": 6, + "lines": 12, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_distutils/system_info.py", + "new_path": "scipy_distutils/system_info.py", + "filename": "system_info.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -141,8 +141,8 @@ def __init__ (self,\n #self.__class__.need_refresh = not self.info\n self.local_prefixes = []\n defaults = {}\n- defaults['lib_dir'] = ':'.join(default_lib_dirs)\n- defaults['include_dir'] = ':'.join(default_include_dirs)\n+ defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)\n+ defaults['include_dir'] = os.pathsep.join(default_include_dirs)\n defaults['static_first'] = '1'\n self.cp = ConfigParser.ConfigParser(defaults)\n cf = os.path.join(os.path.split(os.path.abspath(__file__))[0],\n@@ -185,8 +185,8 @@ def calc_info_template(self,prefix):\n \"\"\" Calculate info dictionary. \"\"\"\n \n def get_paths(self, section, key):\n- dirs = self.cp.get(section, key).split(':')\n- default_dirs = self.cp.get('DEFAULT', key).split(':')\n+ dirs = self.cp.get(section, key).split(os.pathsep)\n+ default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs.extend(default_dirs)\n return [ d for d in dirs if os.path.isdir(d) ]\n \n@@ -320,9 +320,9 @@ class atlas_info(system_info):\n section = 'atlas'\n \n def get_paths(self, section, key):\n- default_dirs = self.cp.get('DEFAULT', key).split(':')\n+ default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs = []\n- for d in self.cp.get(section, key).split(':') + default_dirs:\n+ for d in self.cp.get(section, key).split(os.pathsep) + default_dirs:\n dirs.extend([d]+combine_paths(d,['atlas*','ATLAS*']))\n return [ d for d in dirs if os.path.isdir(d) ]\n \n", + "added_lines": 6, + "deleted_lines": 6, + "source_code": "#!/usr/bin/env python\n\"\"\"\nThis file defines a set of system_info classes for getting\ninformation about various resources (libraries, library directories,\ninclude directories, etc.) in the system. Currently, the following\nclasses are available:\n atlas_info\n fftw_info\n x11_info\n\nUsage:\n info_dict = get_info()\n where is a string 'atlas','x11','fftw'.\n\n Returned info_dict is a dictionary which is compatible with\n distutils.setup keyword arguments. If info_dict == {}, then the\n asked resource is not available (or system_info could not find it).\n\nGlobal parameters:\n system_info.static_first - a flag for indicating that static\n libraries are searched first than shared ones.\n system_info.verbose - show the results if set.\n\nThe file 'site.cfg' in the same directory as this module is read\nfor configuration options. The format is that used by ConfigParser (i.e.,\nWindows .INI style). The section DEFAULT has options that are the default\nfor each section. The available sections are fftw, atlas, and x11. Appropiate\ndefaults are used if nothing is specified.\n\nExample:\n----------\n[DEFAULT]\nlib_dir = /usr/lib:/usr/local/lib:/opt/lib\ninclude_dir = /usr/include:/usr/local/include:/opt/include\n# use static libraries in preference to shared ones\nstatic_first = 1\n\n[fftw]\nfftw_libs = fftw, rfftw\nfftw_opt_libs = fftw_threaded, rfftw_threaded\n# if the above aren't found, look for {s,d}fftw_libs and {s,d}fftw_opt_libs\n\n[atlas]\nlib_dir = /usr/lib/3dnow:/usr/lib/3dnow/atlas\n# for overriding the names of the atlas libraries\natlas_libs = f77blas, cblas, atlas\nlapack_libs = lapack\n\n[x11]\nlib_dir = /usr/X11R6/lib\ninclude_dir = /usr/X11R6/include\n----------\n\nAuthors:\n Pearu Peterson , February 2002\n David M. Cooke , April 2002\nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\"\"\"\n\nimport sys,os,re,types\nfrom distutils.errors import DistutilsError\nfrom glob import glob\nimport ConfigParser\n\nfrom distutils.sysconfig import get_config_vars\n\nif sys.platform == 'win32':\n default_lib_dirs = ['C:\\\\'] # probably not very helpful...\n default_include_dirs = []\n default_x11_lib_dirs = []\n default_x11_include_dirs = []\nelse:\n default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib']\n default_include_dirs = ['/usr/local/include',\n '/opt/include', '/usr/include']\n default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib']\n default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include']\n\nif os.path.join(sys.prefix, 'lib') not in default_lib_dirs:\n default_lib_dirs.append(os.path.join(sys.prefix, 'lib'))\n default_include_dirs.append(os.path.join(sys.prefix, 'include'))\ndefault_lib_dirs = filter(os.path.isdir, default_lib_dirs)\ndefault_include_dirs = filter(os.path.isdir, default_include_dirs)\n\nso_ext = get_config_vars('SO')[0] or ''\n\ndef get_info(name):\n cl = {'atlas':atlas_info,\n 'x11':x11_info,\n 'fftw':fftw_info}.get(name.lower(),system_info)\n return cl().get_info()\n\nclass NotFoundError(DistutilsError):\n \"\"\"Some third-party program or library is not found.\"\"\"\n\nclass AtlasNotFoundError(NotFoundError):\n \"\"\"\n Atlas (http://math-atlas.sourceforge.net/) libraries not found.\n Either install them in /usr/local/lib/atlas or /usr/lib/atlas\n and retry setup.py. One can use also ATLAS environment variable\n to indicate the location of Atlas libraries.\"\"\"\n\nclass FFTWNotFoundError(NotFoundError):\n \"\"\"\n FFTW (http://www.fftw.org/) libraries not found.\n Either install them in /usr/local/lib or /usr/lib and retry setup.py.\n One can use also FFTW environment variable to indicate\n the location of FFTW libraries.\"\"\"\n\nclass F2pyNotFoundError(NotFoundError):\n \"\"\"\n f2py2e (http://cens.ioc.ee/projects/f2py2e/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass NumericNotFoundError(NotFoundError):\n \"\"\"\n Numeric (http://pfdubois.com/numpy/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass X11NotFoundError(NotFoundError):\n \"\"\"X11 libraries not found.\"\"\"\n\nclass system_info:\n\n \"\"\" get_info() is the only public method. Don't use others.\n \"\"\"\n section = 'DEFAULT'\n\n static_first = 1\n verbose = 1\n need_refresh = 1\n saved_results = {}\n\n def __init__ (self,\n default_lib_dirs=default_lib_dirs,\n default_include_dirs=default_include_dirs,\n ):\n self.__class__.info = {}\n #self.__class__.need_refresh = not self.info\n self.local_prefixes = []\n defaults = {}\n defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)\n defaults['include_dir'] = os.pathsep.join(default_include_dirs)\n defaults['static_first'] = '1'\n self.cp = ConfigParser.ConfigParser(defaults)\n cf = os.path.join(os.path.split(os.path.abspath(__file__))[0],\n 'site.cfg')\n self.cp.read([cf])\n if not self.cp.has_section(self.section):\n self.cp.add_section(self.section)\n self.static_first = self.cp.getboolean(self.section, 'static_first')\n\n def set_info(self,**info):\n #self.__class__.info = info\n self.saved_results[self.__class__.__name__] = info\n def has_info(self):\n return self.saved_results.has_key(self.__class__.__name__)\n def get_info(self):\n \"\"\" Return a dictonary with items that are compatible\n with scipy_distutils.setup keyword arguments.\n \"\"\"\n flag = 0\n if not self.has_info():\n flag = 1\n if self.verbose:\n print self.__class__.__name__ + ':'\n if hasattr(self, 'calc_info'):\n self.calc_info()\n if self.verbose:\n if not self.has_info():\n print ' NOT AVAILABLE'\n self.set_info()\n else:\n print ' FOUND:'\n res = self.saved_results.get(self.__class__.__name__)\n if self.verbose and flag:\n for k,v in res.items():\n print ' %s = %s'%(k,v)\n print\n return res\n\n def calc_info_template(self,prefix):\n \"\"\" Calculate info dictionary. \"\"\"\n\n def get_paths(self, section, key):\n dirs = self.cp.get(section, key).split(os.pathsep)\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs.extend(default_dirs)\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def get_lib_dirs(self, key='lib_dir'):\n return self.get_paths(self.section, key)\n def get_include_dirs(self, key='include_dir'):\n return self.get_paths(self.section, key)\n\n def get_libs(self, key, default):\n try:\n libs = self.cp.get(self.section, key)\n except ConfigParser.NoOptionError:\n return default\n return [a.strip() for a in libs.split(',')]\n\n def check_libs(self,lib_dir,libs,opt_libs =[]):\n \"\"\" If static or shared libraries are available then return\n their info dictionary. \"\"\"\n mths = [self.check_static_libs,self.check_shared_libs]\n if not self.static_first:\n mths.reverse() # if one prefers shared libraries\n for m in mths:\n info = m(lib_dir,libs,opt_libs)\n if info is not None: return info\n\n def check_static_libs(self,lib_dir,libs,opt_libs =[]):\n #XXX: what are .lib and .dll files under win32?\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs])) == len(libs):\n info = {'libraries':libs,'library_dirs':[lib_dir]}\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs]))\\\n ==len(opt_libs):\n info['libraries'].extend(opt_libs)\n return info\n\n def check_shared_libs(self,lib_dir,libs,opt_libs =[]):\n shared_libs = []\n for l in libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: shared_libs.append(p)\n if len(shared_libs) == len(libs):\n info = {'extra_objects':shared_libs}\n opt_shared_libs = []\n for l in opt_libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: opt_shared_libs.append(p)\n info['extra_objects'].extend(opt_shared_libs)\n return info\n\n\nclass fftw_info(system_info):\n section = 'fftw'\n\n def __init__(self):\n system_info.__init__(self)\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n incl_dirs = self.get_include_dirs()\n incl_dir = None\n\n libs = self.get_libs('fftw_libs', ['fftw','rfftw'])\n opt_libs = self.get_libs('fftw_opt_libs',\n ['fftw_threads','rfftw_threads'])\n info = None\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['fftw.h','rfftw.h']))==2:\n dict_append(info,include_dirs=[d])\n flag = 1\n incl_dirs = [d]\n incl_dir = d\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_FFTW_H',1)])\n else:\n info = None\n\n if info is None:\n libs = self.get_libs('dfftw_libs', ['dfftw', 'drfftw'])\n opt_libs = self.get_libs('dfftw_opt_libs',\n ['dfftw_threads', 'drfftw_threads'])\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['dfftw.h','drfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n incl_dirs = [d]\n incl_dir = d\n flag = 1\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_DFFTW_H',1)])\n else:\n info = None\n\n libs = self.get_libs('sfftw_libs', ['sfftw', 'srfftw'])\n opt_libs = self.get_libs('sfftw_opt_libs',\n ['sfftw_threads', 'srfftw_threads'])\n flag = 0\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n if info is None: info = r\n else: dict_append(info,**r)\n flag = 1\n break\n if info is not None and flag:\n for d in incl_dirs:\n if len(combine_paths(d,['sfftw.h','srfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n dict_append(info,define_macros=[('SCIPY_SFFTW_H',1)])\n break\n if info is not None:\n self.set_info(**info)\n\n\nclass atlas_info(system_info):\n section = 'atlas'\n\n def get_paths(self, section, key):\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs = []\n for d in self.cp.get(section, key).split(os.pathsep) + default_dirs:\n dirs.extend([d]+combine_paths(d,['atlas*','ATLAS*']))\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n\n h = (combine_paths(lib_dirs+include_dirs,'cblas.h') or [None])[0]\n if h: h = os.path.dirname(h)\n info = None\n # lapack must appear before atlas\n lapack_libs = self.get_libs('lapack_libs', ['lapack'])\n for d in lib_dirs:\n lapack = self.check_libs(d,lapack_libs,[])\n if lapack is not None:\n info = lapack \n break\n else:\n return\n atlas_libs = self.get_libs('atlas_libs', ['f77blas', 'cblas', 'atlas'])\n for d in lib_dirs:\n atlas = self.check_libs(d,atlas_libs,[])\n if atlas is not None:\n dict_append(info, **atlas)\n break\n else:\n return\n\n if h: dict_append(info,include_dirs=[h])\n self.set_info(**info)\n\n## class blas_info(system_info):\n## # For Fortran or optimized blas, not atlas.\n## pass\n\n\n## class lapack_info(system_info):\n## # For Fortran or optimized lapack, not atlas\n## pass\n\n\nclass x11_info(system_info):\n section = 'x11'\n\n def __init__(self):\n system_info.__init__(self,\n default_lib_dirs=default_x11_lib_dirs,\n default_include_dirs=default_x11_include_dirs)\n\n def calc_info(self):\n if sys.platform == 'win32':\n return\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n x11_libs = self.get_libs('x11_libs', ['X11'])\n for lib_dir in lib_dirs:\n info = self.check_libs(lib_dir, x11_libs, [])\n if info is not None:\n break\n else:\n return\n inc_dir = None\n for d in include_dirs:\n if combine_paths(d, 'X11/X.h'):\n inc_dir = d\n break\n if inc_dir is not None:\n dict_append(info, include_dirs=[inc_dir])\n self.set_info(**info)\n\ndef shortest_path(pths):\n pths.sort()\n if pths: return pths[0]\n\ndef combine_paths(*args):\n \"\"\" Return a list of existing paths composed by all combinations of\n items from arguments.\n \"\"\"\n r = []\n for a in args:\n if not a: continue\n if type(a) is types.StringType:\n a = [a]\n r.append(a)\n args = r\n if not args: return []\n if len(args)==1:\n result = reduce(lambda a,b:a+b,map(glob,args[0]),[])\n elif len (args)==2:\n result = []\n for a0 in args[0]:\n for a1 in args[1]:\n result.extend(glob(os.path.join(a0,a1)))\n else:\n result = combine_paths(*(combine_paths(args[0],args[1])+args[2:]))\n return result\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 show_all():\n import system_info\n import pprint\n match_info = re.compile(r'.*?_info').match\n for n in filter(match_info,dir(system_info)):\n if n in ['system_info','get_info']: continue\n c = getattr(system_info,n)()\n r = c.get_info()\n\nif __name__ == \"__main__\":\n show_all()\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\nThis file defines a set of system_info classes for getting\ninformation about various resources (libraries, library directories,\ninclude directories, etc.) in the system. Currently, the following\nclasses are available:\n atlas_info\n fftw_info\n x11_info\n\nUsage:\n info_dict = get_info()\n where is a string 'atlas','x11','fftw'.\n\n Returned info_dict is a dictionary which is compatible with\n distutils.setup keyword arguments. If info_dict == {}, then the\n asked resource is not available (or system_info could not find it).\n\nGlobal parameters:\n system_info.static_first - a flag for indicating that static\n libraries are searched first than shared ones.\n system_info.verbose - show the results if set.\n\nThe file 'site.cfg' in the same directory as this module is read\nfor configuration options. The format is that used by ConfigParser (i.e.,\nWindows .INI style). The section DEFAULT has options that are the default\nfor each section. The available sections are fftw, atlas, and x11. Appropiate\ndefaults are used if nothing is specified.\n\nExample:\n----------\n[DEFAULT]\nlib_dir = /usr/lib:/usr/local/lib:/opt/lib\ninclude_dir = /usr/include:/usr/local/include:/opt/include\n# use static libraries in preference to shared ones\nstatic_first = 1\n\n[fftw]\nfftw_libs = fftw, rfftw\nfftw_opt_libs = fftw_threaded, rfftw_threaded\n# if the above aren't found, look for {s,d}fftw_libs and {s,d}fftw_opt_libs\n\n[atlas]\nlib_dir = /usr/lib/3dnow:/usr/lib/3dnow/atlas\n# for overriding the names of the atlas libraries\natlas_libs = f77blas, cblas, atlas\nlapack_libs = lapack\n\n[x11]\nlib_dir = /usr/X11R6/lib\ninclude_dir = /usr/X11R6/include\n----------\n\nAuthors:\n Pearu Peterson , February 2002\n David M. Cooke , April 2002\nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\"\"\"\n\nimport sys,os,re,types\nfrom distutils.errors import DistutilsError\nfrom glob import glob\nimport ConfigParser\n\nfrom distutils.sysconfig import get_config_vars\n\nif sys.platform == 'win32':\n default_lib_dirs = ['C:\\\\'] # probably not very helpful...\n default_include_dirs = []\n default_x11_lib_dirs = []\n default_x11_include_dirs = []\nelse:\n default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib']\n default_include_dirs = ['/usr/local/include',\n '/opt/include', '/usr/include']\n default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib']\n default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include']\n\nif os.path.join(sys.prefix, 'lib') not in default_lib_dirs:\n default_lib_dirs.append(os.path.join(sys.prefix, 'lib'))\n default_include_dirs.append(os.path.join(sys.prefix, 'include'))\ndefault_lib_dirs = filter(os.path.isdir, default_lib_dirs)\ndefault_include_dirs = filter(os.path.isdir, default_include_dirs)\n\nso_ext = get_config_vars('SO')[0] or ''\n\ndef get_info(name):\n cl = {'atlas':atlas_info,\n 'x11':x11_info,\n 'fftw':fftw_info}.get(name.lower(),system_info)\n return cl().get_info()\n\nclass NotFoundError(DistutilsError):\n \"\"\"Some third-party program or library is not found.\"\"\"\n\nclass AtlasNotFoundError(NotFoundError):\n \"\"\"\n Atlas (http://math-atlas.sourceforge.net/) libraries not found.\n Either install them in /usr/local/lib/atlas or /usr/lib/atlas\n and retry setup.py. One can use also ATLAS environment variable\n to indicate the location of Atlas libraries.\"\"\"\n\nclass FFTWNotFoundError(NotFoundError):\n \"\"\"\n FFTW (http://www.fftw.org/) libraries not found.\n Either install them in /usr/local/lib or /usr/lib and retry setup.py.\n One can use also FFTW environment variable to indicate\n the location of FFTW libraries.\"\"\"\n\nclass F2pyNotFoundError(NotFoundError):\n \"\"\"\n f2py2e (http://cens.ioc.ee/projects/f2py2e/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass NumericNotFoundError(NotFoundError):\n \"\"\"\n Numeric (http://pfdubois.com/numpy/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass X11NotFoundError(NotFoundError):\n \"\"\"X11 libraries not found.\"\"\"\n\nclass system_info:\n\n \"\"\" get_info() is the only public method. Don't use others.\n \"\"\"\n section = 'DEFAULT'\n\n static_first = 1\n verbose = 1\n need_refresh = 1\n saved_results = {}\n\n def __init__ (self,\n default_lib_dirs=default_lib_dirs,\n default_include_dirs=default_include_dirs,\n ):\n self.__class__.info = {}\n #self.__class__.need_refresh = not self.info\n self.local_prefixes = []\n defaults = {}\n defaults['lib_dir'] = ':'.join(default_lib_dirs)\n defaults['include_dir'] = ':'.join(default_include_dirs)\n defaults['static_first'] = '1'\n self.cp = ConfigParser.ConfigParser(defaults)\n cf = os.path.join(os.path.split(os.path.abspath(__file__))[0],\n 'site.cfg')\n self.cp.read([cf])\n if not self.cp.has_section(self.section):\n self.cp.add_section(self.section)\n self.static_first = self.cp.getboolean(self.section, 'static_first')\n\n def set_info(self,**info):\n #self.__class__.info = info\n self.saved_results[self.__class__.__name__] = info\n def has_info(self):\n return self.saved_results.has_key(self.__class__.__name__)\n def get_info(self):\n \"\"\" Return a dictonary with items that are compatible\n with scipy_distutils.setup keyword arguments.\n \"\"\"\n flag = 0\n if not self.has_info():\n flag = 1\n if self.verbose:\n print self.__class__.__name__ + ':'\n if hasattr(self, 'calc_info'):\n self.calc_info()\n if self.verbose:\n if not self.has_info():\n print ' NOT AVAILABLE'\n self.set_info()\n else:\n print ' FOUND:'\n res = self.saved_results.get(self.__class__.__name__)\n if self.verbose and flag:\n for k,v in res.items():\n print ' %s = %s'%(k,v)\n print\n return res\n\n def calc_info_template(self,prefix):\n \"\"\" Calculate info dictionary. \"\"\"\n\n def get_paths(self, section, key):\n dirs = self.cp.get(section, key).split(':')\n default_dirs = self.cp.get('DEFAULT', key).split(':')\n dirs.extend(default_dirs)\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def get_lib_dirs(self, key='lib_dir'):\n return self.get_paths(self.section, key)\n def get_include_dirs(self, key='include_dir'):\n return self.get_paths(self.section, key)\n\n def get_libs(self, key, default):\n try:\n libs = self.cp.get(self.section, key)\n except ConfigParser.NoOptionError:\n return default\n return [a.strip() for a in libs.split(',')]\n\n def check_libs(self,lib_dir,libs,opt_libs =[]):\n \"\"\" If static or shared libraries are available then return\n their info dictionary. \"\"\"\n mths = [self.check_static_libs,self.check_shared_libs]\n if not self.static_first:\n mths.reverse() # if one prefers shared libraries\n for m in mths:\n info = m(lib_dir,libs,opt_libs)\n if info is not None: return info\n\n def check_static_libs(self,lib_dir,libs,opt_libs =[]):\n #XXX: what are .lib and .dll files under win32?\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs])) == len(libs):\n info = {'libraries':libs,'library_dirs':[lib_dir]}\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs]))\\\n ==len(opt_libs):\n info['libraries'].extend(opt_libs)\n return info\n\n def check_shared_libs(self,lib_dir,libs,opt_libs =[]):\n shared_libs = []\n for l in libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: shared_libs.append(p)\n if len(shared_libs) == len(libs):\n info = {'extra_objects':shared_libs}\n opt_shared_libs = []\n for l in opt_libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: opt_shared_libs.append(p)\n info['extra_objects'].extend(opt_shared_libs)\n return info\n\n\nclass fftw_info(system_info):\n section = 'fftw'\n\n def __init__(self):\n system_info.__init__(self)\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n incl_dirs = self.get_include_dirs()\n incl_dir = None\n\n libs = self.get_libs('fftw_libs', ['fftw','rfftw'])\n opt_libs = self.get_libs('fftw_opt_libs',\n ['fftw_threads','rfftw_threads'])\n info = None\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['fftw.h','rfftw.h']))==2:\n dict_append(info,include_dirs=[d])\n flag = 1\n incl_dirs = [d]\n incl_dir = d\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_FFTW_H',1)])\n else:\n info = None\n\n if info is None:\n libs = self.get_libs('dfftw_libs', ['dfftw', 'drfftw'])\n opt_libs = self.get_libs('dfftw_opt_libs',\n ['dfftw_threads', 'drfftw_threads'])\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['dfftw.h','drfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n incl_dirs = [d]\n incl_dir = d\n flag = 1\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_DFFTW_H',1)])\n else:\n info = None\n\n libs = self.get_libs('sfftw_libs', ['sfftw', 'srfftw'])\n opt_libs = self.get_libs('sfftw_opt_libs',\n ['sfftw_threads', 'srfftw_threads'])\n flag = 0\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n if info is None: info = r\n else: dict_append(info,**r)\n flag = 1\n break\n if info is not None and flag:\n for d in incl_dirs:\n if len(combine_paths(d,['sfftw.h','srfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n dict_append(info,define_macros=[('SCIPY_SFFTW_H',1)])\n break\n if info is not None:\n self.set_info(**info)\n\n\nclass atlas_info(system_info):\n section = 'atlas'\n\n def get_paths(self, section, key):\n default_dirs = self.cp.get('DEFAULT', key).split(':')\n dirs = []\n for d in self.cp.get(section, key).split(':') + default_dirs:\n dirs.extend([d]+combine_paths(d,['atlas*','ATLAS*']))\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n\n h = (combine_paths(lib_dirs+include_dirs,'cblas.h') or [None])[0]\n if h: h = os.path.dirname(h)\n info = None\n # lapack must appear before atlas\n lapack_libs = self.get_libs('lapack_libs', ['lapack'])\n for d in lib_dirs:\n lapack = self.check_libs(d,lapack_libs,[])\n if lapack is not None:\n info = lapack \n break\n else:\n return\n atlas_libs = self.get_libs('atlas_libs', ['f77blas', 'cblas', 'atlas'])\n for d in lib_dirs:\n atlas = self.check_libs(d,atlas_libs,[])\n if atlas is not None:\n dict_append(info, **atlas)\n break\n else:\n return\n\n if h: dict_append(info,include_dirs=[h])\n self.set_info(**info)\n\n## class blas_info(system_info):\n## # For Fortran or optimized blas, not atlas.\n## pass\n\n\n## class lapack_info(system_info):\n## # For Fortran or optimized lapack, not atlas\n## pass\n\n\nclass x11_info(system_info):\n section = 'x11'\n\n def __init__(self):\n system_info.__init__(self,\n default_lib_dirs=default_x11_lib_dirs,\n default_include_dirs=default_x11_include_dirs)\n\n def calc_info(self):\n if sys.platform == 'win32':\n return\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n x11_libs = self.get_libs('x11_libs', ['X11'])\n for lib_dir in lib_dirs:\n info = self.check_libs(lib_dir, x11_libs, [])\n if info is not None:\n break\n else:\n return\n inc_dir = None\n for d in include_dirs:\n if combine_paths(d, 'X11/X.h'):\n inc_dir = d\n break\n if inc_dir is not None:\n dict_append(info, include_dirs=[inc_dir])\n self.set_info(**info)\n\ndef shortest_path(pths):\n pths.sort()\n if pths: return pths[0]\n\ndef combine_paths(*args):\n \"\"\" Return a list of existing paths composed by all combinations of\n items from arguments.\n \"\"\"\n r = []\n for a in args:\n if not a: continue\n if type(a) is types.StringType:\n a = [a]\n r.append(a)\n args = r\n if not args: return []\n if len(args)==1:\n result = reduce(lambda a,b:a+b,map(glob,args[0]),[])\n elif len (args)==2:\n result = []\n for a0 in args[0]:\n for a1 in args[1]:\n result.extend(glob(os.path.join(a0,a1)))\n else:\n result = combine_paths(*(combine_paths(args[0],args[1])+args[2:]))\n return result\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 show_all():\n import system_info\n import pprint\n match_info = re.compile(r'.*?_info').match\n for n in filter(match_info,dir(system_info)):\n if n in ['system_info','get_info']: continue\n c = getattr(system_info,n)()\n r = c.get_info()\n\nif __name__ == \"__main__\":\n show_all()\n", + "methods": [ + { + "name": "get_info", + "long_name": "get_info( name )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "name" + ], + "start_line": 89, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "set_info", + "long_name": "set_info( self , ** info )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "info" + ], + "start_line": 155, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "has_info", + "long_name": "has_info( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_info", + "long_name": "get_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 9, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 160, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "calc_info_template", + "long_name": "calc_info_template( self , prefix )", + "filename": "system_info.py", + "nloc": 1, + "complexity": 1, + "token_count": 8, + "parameters": [ + "self", + "prefix" + ], + "start_line": 184, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 70, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_lib_dirs", + "long_name": "get_lib_dirs( self , key = 'lib_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 193, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_include_dirs", + "long_name": "get_include_dirs( self , key = 'include_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 195, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_libs", + "long_name": "get_libs( self , key , default )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self", + "key", + "default" + ], + "start_line": 198, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_libs", + "long_name": "check_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 4, + "token_count": 60, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 205, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_static_libs", + "long_name": "check_static_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 5, + "token_count": 91, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 215, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_shared_libs", + "long_name": "check_shared_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 13, + "complexity": 6, + "token_count": 119, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 224, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 242, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 69, + "complexity": 24, + "token_count": 443, + "parameters": [ + "self" + ], + "start_line": 245, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 4, + "token_count": 91, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 322, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 24, + "complexity": 8, + "token_count": 168, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 370, + "end_line": 373, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 7, + "token_count": 110, + "parameters": [ + "self" + ], + "start_line": 375, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "shortest_path", + "long_name": "shortest_path( pths )", + "filename": "system_info.py", + "nloc": 3, + "complexity": 2, + "token_count": 18, + "parameters": [ + "pths" + ], + "start_line": 396, + "end_line": 398, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "combine_paths", + "long_name": "combine_paths( * args )", + "filename": "system_info.py", + "nloc": 19, + "complexity": 9, + "token_count": 162, + "parameters": [ + "args" + ], + "start_line": 400, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 423, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "show_all", + "long_name": "show_all( )", + "filename": "system_info.py", + "nloc": 8, + "complexity": 3, + "token_count": 59, + "parameters": [], + "start_line": 430, + "end_line": 437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "get_info", + "long_name": "get_info( name )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "name" + ], + "start_line": 89, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 148, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "set_info", + "long_name": "set_info( self , ** info )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "info" + ], + "start_line": 155, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "has_info", + "long_name": "has_info( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_info", + "long_name": "get_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 9, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 160, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "calc_info_template", + "long_name": "calc_info_template( self , prefix )", + "filename": "system_info.py", + "nloc": 1, + "complexity": 1, + "token_count": 8, + "parameters": [ + "self", + "prefix" + ], + "start_line": 184, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 66, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_lib_dirs", + "long_name": "get_lib_dirs( self , key = 'lib_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 193, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_include_dirs", + "long_name": "get_include_dirs( self , key = 'include_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 195, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_libs", + "long_name": "get_libs( self , key , default )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self", + "key", + "default" + ], + "start_line": 198, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_libs", + "long_name": "check_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 4, + "token_count": 60, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 205, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_static_libs", + "long_name": "check_static_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 5, + "token_count": 91, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 215, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_shared_libs", + "long_name": "check_shared_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 13, + "complexity": 6, + "token_count": 119, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 224, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 242, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 69, + "complexity": 24, + "token_count": 443, + "parameters": [ + "self" + ], + "start_line": 245, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 4, + "token_count": 87, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 322, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 24, + "complexity": 8, + "token_count": 168, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 370, + "end_line": 373, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 7, + "token_count": 110, + "parameters": [ + "self" + ], + "start_line": 375, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "shortest_path", + "long_name": "shortest_path( pths )", + "filename": "system_info.py", + "nloc": 3, + "complexity": 2, + "token_count": 18, + "parameters": [ + "pths" + ], + "start_line": 396, + "end_line": 398, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "combine_paths", + "long_name": "combine_paths( * args )", + "filename": "system_info.py", + "nloc": 19, + "complexity": 9, + "token_count": 162, + "parameters": [ + "args" + ], + "start_line": 400, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 423, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "show_all", + "long_name": "show_all( )", + "filename": "system_info.py", + "nloc": 8, + "complexity": 3, + "token_count": 59, + "parameters": [], + "start_line": 430, + "end_line": 437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 70, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + } + ], + "nloc": 371, + "complexity": 100, + "token_count": 2195, + "diff_parsed": { + "added": [ + " defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)", + " defaults['include_dir'] = os.pathsep.join(default_include_dirs)", + " dirs = self.cp.get(section, key).split(os.pathsep)", + " default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)", + " default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)", + " for d in self.cp.get(section, key).split(os.pathsep) + default_dirs:" + ], + "deleted": [ + " defaults['lib_dir'] = ':'.join(default_lib_dirs)", + " defaults['include_dir'] = ':'.join(default_include_dirs)", + " dirs = self.cp.get(section, key).split(':')", + " default_dirs = self.cp.get('DEFAULT', key).split(':')", + " default_dirs = self.cp.get('DEFAULT', key).split(':')", + " for d in self.cp.get(section, key).split(':') + default_dirs:" + ] + } + } + ] + }, + { + "hash": "14e7741c7b827c1574b794671cbc7687088c74bf", + "msg": "removed import of transform_base. somehow, it snuck in here.", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-03T22:02:48+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T22:02:48+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "f931eed8f80adf37c085fbcb9c7390d780f3ca38" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 1, + "insertions": 1, + "lines": 2, + "files": 2, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_base/__init__.py", + "new_path": "scipy_base/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -9,7 +9,6 @@\n from function_base import *\n from shape_base import *\n from matrix_base import *\n-from transform_base import *\n \n from polynomial import *\n from scimath import *\n", + "added_lines": 0, + "deleted_lines": 1, + "source_code": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NAN = NaN = nan = fastumath.NAN\nexcept AttributeError:\n NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "source_code_before": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\nfrom transform_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NAN = NaN = nan = fastumath.NAN\nexcept AttributeError:\n NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 32, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 27, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 33, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 28, + "complexity": 2, + "token_count": 138, + "diff_parsed": { + "added": [], + "deleted": [ + "from transform_base import *" + ] + } + }, + { + "old_path": "scipy_base/limits.py", + "new_path": "scipy_base/limits.py", + "filename": "limits.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -14,6 +14,7 @@\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n \n+\n def epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n", + "added_lines": 1, + "deleted_lines": 0, + "source_code": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 18, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 28, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 65, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 69, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 17, + "end_line": 25, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 27, + "end_line": 36, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 55, + "complexity": 10, + "token_count": 329, + "diff_parsed": { + "added": [ + "" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "157a6261d337b88fd77b02639c26ba84fe63276a", + "msg": "Deleted transform_base (again?).", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-03T22:18:58+00:00", + "author_timezone": 0, + "committer_date": "2002-04-03T22:18:58+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "14e7741c7b827c1574b794671cbc7687088c74bf" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 73, + "insertions": 4, + "lines": 77, + "files": 2, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.15789473684210525, + "modified_files": [ + { + "old_path": "scipy_base/fastumathmodule.c", + "new_path": "scipy_base/fastumathmodule.c", + "filename": "fastumathmodule.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -9,6 +9,10 @@\n /* Fast umath module whose functions do not check for range and domain errors.\n \n Replacement for umath + additions for isnan, isfinite, and isinf\n+ Also allows comparison operations on complex numbers (just compares the real part)\n+ and logical operations.\n+\n+ All logical operations return UBYTE arrays.\n */\n \n #ifndef CHAR_BIT\n", + "added_lines": 4, + "deleted_lines": 0, + "source_code": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n Also allows comparison operations on complex numbers (just compares the real part)\n and logical operations.\n\n All logical operations return UBYTE arrays.\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "source_code_before": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "methods": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 59, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 67, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 75, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 84, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 92, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 100, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 108, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 117, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 125, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 133, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 141, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 161, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 166, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 181, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 192, + "end_line": 209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 235, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 281, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 306, + "end_line": 313, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 315, + "end_line": 321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 323, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 329, + "end_line": 333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 335, + "end_line": 339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 341, + "end_line": 344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 346, + "end_line": 349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 351, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 356, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 364, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 372, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 381, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 390, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 398, + "end_line": 404, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 406, + "end_line": 424, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 426, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 446, + "end_line": 466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 469, + "end_line": 475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 476, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 483, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 490, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 497, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 504, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 518, + "end_line": 524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 525, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 532, + "end_line": 538, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 539, + "end_line": 545, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 546, + "end_line": 552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 553, + "end_line": 559, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 560, + "end_line": 566, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 567, + "end_line": 573, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 574, + "end_line": 580, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 581, + "end_line": 587, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 588, + "end_line": 594, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 595, + "end_line": 607, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 608, + "end_line": 620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 621, + "end_line": 725, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 726, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 831, + "end_line": 935, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 936, + "end_line": 942, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 943, + "end_line": 949, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 950, + "end_line": 956, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 957, + "end_line": 963, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 964, + "end_line": 970, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 971, + "end_line": 977, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 978, + "end_line": 984, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 985, + "end_line": 991, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 992, + "end_line": 998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 999, + "end_line": 1005, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1006, + "end_line": 1012, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1013, + "end_line": 1019, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1020, + "end_line": 1026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1027, + "end_line": 1033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1034, + "end_line": 1040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1041, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1063, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1064, + "end_line": 1065, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1066, + "end_line": 1072, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1073, + "end_line": 1079, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1080, + "end_line": 1086, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1087, + "end_line": 1093, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1094, + "end_line": 1100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1101, + "end_line": 1107, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1108, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1115, + "end_line": 1121, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1122, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1129, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1166, + "end_line": 1167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1168, + "end_line": 1174, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1175, + "end_line": 1181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1182, + "end_line": 1188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1189, + "end_line": 1195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1196, + "end_line": 1202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1203, + "end_line": 1209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1210, + "end_line": 1216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1219, + "end_line": 1225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1226, + "end_line": 1232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1234, + "end_line": 1240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1241, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1248, + "end_line": 1254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1255, + "end_line": 1261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1262, + "end_line": 1268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1269, + "end_line": 1275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1276, + "end_line": 1282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1283, + "end_line": 1289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1290, + "end_line": 1296, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1298, + "end_line": 1304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1305, + "end_line": 1311, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1312, + "end_line": 1318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1319, + "end_line": 1325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1326, + "end_line": 1332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1333, + "end_line": 1339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1340, + "end_line": 1346, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1347, + "end_line": 1353, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1354, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1362, + "end_line": 1368, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1369, + "end_line": 1375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1376, + "end_line": 1382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1383, + "end_line": 1389, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1390, + "end_line": 1396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1397, + "end_line": 1403, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1404, + "end_line": 1410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1411, + "end_line": 1417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1418, + "end_line": 1424, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1425, + "end_line": 1431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1432, + "end_line": 1438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1439, + "end_line": 1445, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1446, + "end_line": 1452, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1453, + "end_line": 1459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1460, + "end_line": 1466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1467, + "end_line": 1473, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1474, + "end_line": 1480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1481, + "end_line": 1487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1488, + "end_line": 1494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1495, + "end_line": 1501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1502, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1509, + "end_line": 1515, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1516, + "end_line": 1522, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1523, + "end_line": 1529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1530, + "end_line": 1536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1537, + "end_line": 1543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1544, + "end_line": 1550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1551, + "end_line": 1557, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1558, + "end_line": 1564, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1565, + "end_line": 1571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1572, + "end_line": 1578, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1579, + "end_line": 1585, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1586, + "end_line": 1592, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1593, + "end_line": 1599, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1600, + "end_line": 1606, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1607, + "end_line": 1613, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1614, + "end_line": 1620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1621, + "end_line": 1627, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1628, + "end_line": 1634, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1635, + "end_line": 1641, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1642, + "end_line": 1648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1649, + "end_line": 1655, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1656, + "end_line": 1662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1663, + "end_line": 1669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1670, + "end_line": 1676, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1677, + "end_line": 1683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1684, + "end_line": 1690, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1691, + "end_line": 1697, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1698, + "end_line": 1704, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1705, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1712, + "end_line": 1718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1719, + "end_line": 1725, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1726, + "end_line": 1732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1733, + "end_line": 1739, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1740, + "end_line": 1746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1747, + "end_line": 1753, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1754, + "end_line": 1760, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1761, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1784, + "end_line": 1785, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1786, + "end_line": 1792, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1793, + "end_line": 1799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1800, + "end_line": 1806, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1807, + "end_line": 1813, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1814, + "end_line": 1820, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1821, + "end_line": 1827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1828, + "end_line": 1834, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1835, + "end_line": 1842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1843, + "end_line": 1850, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1851, + "end_line": 1857, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1858, + "end_line": 1864, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1865, + "end_line": 1871, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1872, + "end_line": 1878, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1879, + "end_line": 1885, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1886, + "end_line": 1892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1893, + "end_line": 1899, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1900, + "end_line": 1907, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1908, + "end_line": 1915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1916, + "end_line": 1922, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1923, + "end_line": 1929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1930, + "end_line": 1936, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1937, + "end_line": 1943, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1944, + "end_line": 1950, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1951, + "end_line": 1957, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1958, + "end_line": 1964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1965, + "end_line": 1971, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1972, + "end_line": 1978, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1979, + "end_line": 1985, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1986, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1993, + "end_line": 1999, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2000, + "end_line": 2006, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2007, + "end_line": 2013, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2014, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2028, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2029, + "end_line": 2030, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2031, + "end_line": 2037, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2038, + "end_line": 2044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2045, + "end_line": 2051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2052, + "end_line": 2058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2059, + "end_line": 2065, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2066, + "end_line": 2072, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2073, + "end_line": 2079, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2080, + "end_line": 2086, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2087, + "end_line": 2093, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2094, + "end_line": 2100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2187, + "end_line": 2530, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2539, + "end_line": 2595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 47, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 55, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 63, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 71, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 80, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 88, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 96, + "end_line": 102, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 104, + "end_line": 110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 113, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 121, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 129, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 137, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 157, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 162, + "end_line": 175, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 177, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 188, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 231, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 277, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 302, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 311, + "end_line": 317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 319, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 337, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 342, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 347, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 352, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 360, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 368, + "end_line": 375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 377, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 386, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 394, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 402, + "end_line": 420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 422, + "end_line": 440, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 442, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 465, + "end_line": 471, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 472, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 479, + "end_line": 485, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 486, + "end_line": 492, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 493, + "end_line": 499, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 500, + "end_line": 506, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 507, + "end_line": 513, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 514, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 521, + "end_line": 527, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 528, + "end_line": 534, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 535, + "end_line": 541, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 542, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 549, + "end_line": 555, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 556, + "end_line": 562, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 563, + "end_line": 569, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 570, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 577, + "end_line": 583, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 584, + "end_line": 590, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 591, + "end_line": 603, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 604, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 617, + "end_line": 721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 722, + "end_line": 826, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 827, + "end_line": 931, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 932, + "end_line": 938, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 939, + "end_line": 945, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 946, + "end_line": 952, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 953, + "end_line": 959, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 960, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 967, + "end_line": 973, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 974, + "end_line": 980, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 981, + "end_line": 987, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 988, + "end_line": 994, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 995, + "end_line": 1001, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1002, + "end_line": 1008, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1009, + "end_line": 1015, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1016, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1023, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1030, + "end_line": 1036, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1037, + "end_line": 1043, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1044, + "end_line": 1045, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1046, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1069, + "end_line": 1075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1076, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1083, + "end_line": 1089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1090, + "end_line": 1096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1097, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1104, + "end_line": 1110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1111, + "end_line": 1117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1118, + "end_line": 1124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1125, + "end_line": 1131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1132, + "end_line": 1133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1134, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1206, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1222, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1230, + "end_line": 1236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1237, + "end_line": 1243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1244, + "end_line": 1250, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1251, + "end_line": 1257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1258, + "end_line": 1264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1265, + "end_line": 1271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1272, + "end_line": 1278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1279, + "end_line": 1285, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1286, + "end_line": 1292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1294, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1301, + "end_line": 1307, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1308, + "end_line": 1314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1315, + "end_line": 1321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1322, + "end_line": 1328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1329, + "end_line": 1335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1336, + "end_line": 1342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1343, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1350, + "end_line": 1356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1358, + "end_line": 1364, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1365, + "end_line": 1371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1372, + "end_line": 1378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1379, + "end_line": 1385, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1386, + "end_line": 1392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1393, + "end_line": 1399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1400, + "end_line": 1406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1407, + "end_line": 1413, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1414, + "end_line": 1420, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1421, + "end_line": 1427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1428, + "end_line": 1434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1435, + "end_line": 1441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1442, + "end_line": 1448, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1449, + "end_line": 1455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1456, + "end_line": 1462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1463, + "end_line": 1469, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1470, + "end_line": 1476, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1477, + "end_line": 1483, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1484, + "end_line": 1490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1491, + "end_line": 1497, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1498, + "end_line": 1504, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1505, + "end_line": 1511, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1512, + "end_line": 1518, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1519, + "end_line": 1525, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1526, + "end_line": 1532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1533, + "end_line": 1539, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1540, + "end_line": 1546, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1547, + "end_line": 1553, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1554, + "end_line": 1560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1561, + "end_line": 1567, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1568, + "end_line": 1574, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1575, + "end_line": 1581, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1582, + "end_line": 1588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1589, + "end_line": 1595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1596, + "end_line": 1602, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1603, + "end_line": 1609, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1610, + "end_line": 1616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1617, + "end_line": 1623, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1624, + "end_line": 1630, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1631, + "end_line": 1637, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1638, + "end_line": 1644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1645, + "end_line": 1651, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1652, + "end_line": 1658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1659, + "end_line": 1665, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1666, + "end_line": 1672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1673, + "end_line": 1679, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1680, + "end_line": 1686, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1687, + "end_line": 1693, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1694, + "end_line": 1700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1701, + "end_line": 1707, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1708, + "end_line": 1714, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1715, + "end_line": 1721, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1722, + "end_line": 1728, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1729, + "end_line": 1735, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1736, + "end_line": 1742, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1743, + "end_line": 1749, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1750, + "end_line": 1756, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1757, + "end_line": 1763, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1764, + "end_line": 1765, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1766, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1789, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1796, + "end_line": 1802, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1803, + "end_line": 1809, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1810, + "end_line": 1816, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1817, + "end_line": 1823, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1824, + "end_line": 1830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1847, + "end_line": 1853, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1854, + "end_line": 1860, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1861, + "end_line": 1867, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1868, + "end_line": 1874, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1875, + "end_line": 1881, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1882, + "end_line": 1888, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1889, + "end_line": 1895, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1896, + "end_line": 1903, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1904, + "end_line": 1911, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1912, + "end_line": 1918, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1919, + "end_line": 1925, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1926, + "end_line": 1932, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1933, + "end_line": 1939, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1940, + "end_line": 1946, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1947, + "end_line": 1953, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1954, + "end_line": 1960, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1961, + "end_line": 1967, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1968, + "end_line": 1974, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1975, + "end_line": 1981, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1982, + "end_line": 1988, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1989, + "end_line": 1995, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1996, + "end_line": 2002, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2003, + "end_line": 2009, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2010, + "end_line": 2016, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2017, + "end_line": 2018, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2019, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2034, + "end_line": 2040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2041, + "end_line": 2047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2048, + "end_line": 2054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2055, + "end_line": 2061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2062, + "end_line": 2068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2069, + "end_line": 2075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2076, + "end_line": 2082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2083, + "end_line": 2089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2090, + "end_line": 2096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2183, + "end_line": 2526, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2535, + "end_line": 2591, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 2374, + "complexity": 665, + "token_count": 40039, + "diff_parsed": { + "added": [ + " Also allows comparison operations on complex numbers (just compares the real part)", + " and logical operations.", + "", + " All logical operations return UBYTE arrays." + ], + "deleted": [] + } + }, + { + "old_path": "scipy_base/transform_base.py", + "new_path": null, + "filename": "transform_base.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,73 +0,0 @@\n-import Numeric\n-__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']\n-\n-def fftshift(x,axes=None):\n- \"\"\" Shift the result of an FFT operation.\n-\n- Return a shifted version of x (useful for obtaining centered spectra).\n- This function swaps \"half-spaces\" for all axes listed (defaults to all)\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.ceil(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def ifftshift(x,axes=None):\n- \"\"\" Reverse the effect of fftshift.\n- \"\"\"\n- ndim = len(x.shape)\n- if axes == None:\n- axes = range(ndim)\n- y = x\n- for k in axes:\n- N = x.shape[k]\n- p2 = int(Numeric.floor(N/2.0))\n- mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n- y = Numeric.take(y,mylist,k)\n- return y\n-\n-def fftfreq(N,sample=1.0):\n- \"\"\" FFT sample frequencies\n- \n- Return the frequency bins in cycles/unit (with zero at the start) given a\n- window length N and a sample spacing.\n- \"\"\"\n- N = int(N)\n- sample = float(sample)\n- return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n-\n-def cont_ft(gn,fr,delta=1.0,n=None):\n- \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n-\n- If the gn are alias-free samples of a continuous time function then the\n- correct value for the spacing, delta, will give the properly scaled,\n- continuous Fourier spectrum.\n- \n- The DFT is obtained when delta=1.0\n- \"\"\"\n- if n is None:\n- n = Numeric.arange(len(gn))\n- dT = delta\n- trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n- return dT*Numeric.dot(trans_kernel,gn)\n-\n-#-----------------------------------------------------------------------------\n-# Test Routines\n-#-----------------------------------------------------------------------------\n-\n-def test(level=10):\n- from scipy_base.testing import module_test\n- module_test(__name__,__file__,level=level)\n-\n-def test_suite(level=1):\n- from scipy_base.testing import module_test_suite\n- return module_test_suite(__name__,__file__,level=level)\n-\n-if __name__ == '__main__':\n- test()\n", + "added_lines": 0, + "deleted_lines": 73, + "source_code": null, + "source_code_before": "import Numeric\n__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']\n\ndef fftshift(x,axes=None):\n \"\"\" Shift the result of an FFT operation.\n\n Return a shifted version of x (useful for obtaining centered spectra).\n This function swaps \"half-spaces\" for all axes listed (defaults to all)\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.ceil(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef ifftshift(x,axes=None):\n \"\"\" Reverse the effect of fftshift.\n \"\"\"\n ndim = len(x.shape)\n if axes == None:\n axes = range(ndim)\n y = x\n for k in axes:\n N = x.shape[k]\n p2 = int(Numeric.floor(N/2.0))\n mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))\n y = Numeric.take(y,mylist,k)\n return y\n\ndef fftfreq(N,sample=1.0):\n \"\"\" FFT sample frequencies\n \n Return the frequency bins in cycles/unit (with zero at the start) given a\n window length N and a sample spacing.\n \"\"\"\n N = int(N)\n sample = float(sample)\n return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample\n\ndef cont_ft(gn,fr,delta=1.0,n=None):\n \"\"\" Compute the (scaled) DFT of gn at frequencies fr.\n\n If the gn are alias-free samples of a continuous time function then the\n correct value for the spacing, delta, will give the properly scaled,\n continuous Fourier spectrum.\n \n The DFT is obtained when delta=1.0\n \"\"\"\n if n is None:\n n = Numeric.arange(len(gn))\n dT = delta\n trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)\n return dT*Numeric.dot(trans_kernel,gn)\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()\n", + "methods": [], + "methods_before": [ + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "fftfreq", + "long_name": "fftfreq( N , sample = 1 . 0 )", + "filename": "transform_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 76, + "parameters": [ + "N", + "sample" + ], + "start_line": 35, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 68, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "fftshift", + "long_name": "fftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 4, + "end_line": 19, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "transform_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 64, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "cont_ft", + "long_name": "cont_ft( gn , fr , delta = 1 . 0 , n = None )", + "filename": "transform_base.py", + "nloc": 6, + "complexity": 2, + "token_count": 74, + "parameters": [ + "gn", + "fr", + "delta", + "n" + ], + "start_line": 45, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "ifftshift", + "long_name": "ifftshift( x , axes = None )", + "filename": "transform_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 98, + "parameters": [ + "x", + "axes" + ], + "start_line": 21, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "import Numeric", + "__all__ = ['fftshift','ifftshift','fftfreq','cont_ft']", + "", + "def fftshift(x,axes=None):", + " \"\"\" Shift the result of an FFT operation.", + "", + " Return a shifted version of x (useful for obtaining centered spectra).", + " This function swaps \"half-spaces\" for all axes listed (defaults to all)", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.ceil(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def ifftshift(x,axes=None):", + " \"\"\" Reverse the effect of fftshift.", + " \"\"\"", + " ndim = len(x.shape)", + " if axes == None:", + " axes = range(ndim)", + " y = x", + " for k in axes:", + " N = x.shape[k]", + " p2 = int(Numeric.floor(N/2.0))", + " mylist = Numeric.concatenate((Numeric.arange(p2,N),Numeric.arange(p2)))", + " y = Numeric.take(y,mylist,k)", + " return y", + "", + "def fftfreq(N,sample=1.0):", + " \"\"\" FFT sample frequencies", + "", + " Return the frequency bins in cycles/unit (with zero at the start) given a", + " window length N and a sample spacing.", + " \"\"\"", + " N = int(N)", + " sample = float(sample)", + " return Numeric.concatenate((Numeric.arange(0,(N-1)/2+1,1,'d'),Numeric.arange(-(N-1)/2,0,1,'d')))/N/sample", + "", + "def cont_ft(gn,fr,delta=1.0,n=None):", + " \"\"\" Compute the (scaled) DFT of gn at frequencies fr.", + "", + " If the gn are alias-free samples of a continuous time function then the", + " correct value for the spacing, delta, will give the properly scaled,", + " continuous Fourier spectrum.", + "", + " The DFT is obtained when delta=1.0", + " \"\"\"", + " if n is None:", + " n = Numeric.arange(len(gn))", + " dT = delta", + " trans_kernel = Numeric.exp(-2j*Numeric.pi*fr[:,Numeric.NewAxis]*dT*n)", + " return dT*Numeric.dot(trans_kernel,gn)", + "", + "#-----------------------------------------------------------------------------", + "# Test Routines", + "#-----------------------------------------------------------------------------", + "", + "def test(level=10):", + " from scipy_base.testing import module_test", + " module_test(__name__,__file__,level=level)", + "", + "def test_suite(level=1):", + " from scipy_base.testing import module_test_suite", + " return module_test_suite(__name__,__file__,level=level)", + "", + "if __name__ == '__main__':", + " test()" + ] + } + } + ] + }, + { + "hash": "a039b9c3290bd9962e70c802c4d8bc1d7dc481b1", + "msg": "Fixed spheroidal wave functions. Added lu_solve, lu_factor, cho_solve, cho_factor. Changed help to info if help is already defined.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-04T06:01:31+00:00", + "author_timezone": 0, + "committer_date": "2002-04-04T06:01:31+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "157a6261d337b88fd77b02639c26ba84fe63276a" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 80, + "insertions": 4, + "lines": 84, + "files": 4, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.0, + "modified_files": [ + { + "old_path": "scipy_base/ieee_754.py", + "new_path": null, + "filename": "ieee_754.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,78 +0,0 @@\n-\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.\n-\n-PINF positive infinity\n-MINF minus infinity\n-NAN a generic quiet NaN\n-PZERO positive zero\n-MZERO minus zero\n-\n-isnan(x)\n- Return true iff x is a NaN.\n-\"\"\"\n-\n-def _make_inf():\n- x = 2.0\n- x2 = x * x\n- i = 0\n- while i < 100 and x != x2:\n- x = x2\n- x2 = x * x\n- i = i + 1\n- if x != x2:\n- raise ValueError(\"This machine's floats go on forever!\")\n- return x\n-\n-# NaN-testing.\n-#\n-# The usual method (x != x) doesn't work.\n-# Python forces all comparisons thru a 3-outcome cmp protocol; unordered\n-# isn't a possible outcome. The float cmp outcome is essentially defined\n-# by this C expression (combining some cross-module implementation\n-# details, and where px and py are pointers to C double):\n-# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0\n-# Comparing x to itself thus always yields 0 by the first clause, and so x\n-# != x is never true. If px and py point to distinct NaN objects, a\n-# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n-# returns false, and so\n-# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n-# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n-# combination of condition codes, including both the \"less than\" and\n-# \"equal to\" flags. Microsoft C generates naive code that accepts the\n-# \"less than\" flag at face value, and so the *px < *py clause returns\n-# true, and Python returns -1, i.e. \"not equal\".\n-# So with a proper C 754 implementation Python returns the wrong result,\n-# and under MS's improper 754 implementation Python yields the right\n-# result -- both by accident. It's unclear who should be shot .\n-#\n-# Anyway, the point of all that was to convince you it's tricky getting\n-# the right answer in a portable way!\n-\n-def isnan(x):\n- \"\"\"x -> true iff x is a NaN.\"\"\"\n- # multiply by 1.0 to create a distinct object (x < x *always*\n- # false in Python, due to object identity forcing equality)\n- if x * 1.0 < x:\n- # it's a NaN and this is MS C on a Pentium\n- return 1\n- # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n- # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n- # so we return false. If it is NaN, then assuming a good 754 C \n- # implementation Python maps both unordered outcomes to true. \n- return 1.0 == x == 2.0\n-\n-PINF = _make_inf()\n-MINF = -PINF\n-\n-NAN = PINF - PINF\n-if not isnan(NAN):\n- if NAN != NAN:\n- def isnan(x):\n- return x!= x\n- else:\n- raise ValueError(\"This machine doesn't have NaNs, \"\n- \"'overflows' to a finite number, \"\n- \"suffers a novel way of implementing C comparisons, \"\n- \"or is 754-conformant but is using \" \n- \"a goofy rounding mode.\")\n-PZERO = 0.0\n-MZERO = -PZERO\n\\ No newline at end of file\n", + "added_lines": 0, + "deleted_lines": 78, + "source_code": null, + "source_code_before": "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.\n\nPINF positive infinity\nMINF minus infinity\nNAN a generic quiet NaN\nPZERO positive zero\nMZERO minus zero\n\nisnan(x)\n Return true iff x is a NaN.\n\"\"\"\n\ndef _make_inf():\n x = 2.0\n x2 = x * x\n i = 0\n while i < 100 and x != x2:\n x = x2\n x2 = x * x\n i = i + 1\n if x != x2:\n raise ValueError(\"This machine's floats go on forever!\")\n return x\n\n# NaN-testing.\n#\n# The usual method (x != x) doesn't work.\n# Python forces all comparisons thru a 3-outcome cmp protocol; unordered\n# isn't a possible outcome. The float cmp outcome is essentially defined\n# by this C expression (combining some cross-module implementation\n# details, and where px and py are pointers to C double):\n# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0\n# Comparing x to itself thus always yields 0 by the first clause, and so x\n# != x is never true. If px and py point to distinct NaN objects, a\n# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n# returns false, and so\n# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n# combination of condition codes, including both the \"less than\" and\n# \"equal to\" flags. Microsoft C generates naive code that accepts the\n# \"less than\" flag at face value, and so the *px < *py clause returns\n# true, and Python returns -1, i.e. \"not equal\".\n# So with a proper C 754 implementation Python returns the wrong result,\n# and under MS's improper 754 implementation Python yields the right\n# result -- both by accident. It's unclear who should be shot .\n#\n# Anyway, the point of all that was to convince you it's tricky getting\n# the right answer in a portable way!\n\ndef isnan(x):\n \"\"\"x -> true iff x is a NaN.\"\"\"\n # multiply by 1.0 to create a distinct object (x < x *always*\n # false in Python, due to object identity forcing equality)\n if x * 1.0 < x:\n # it's a NaN and this is MS C on a Pentium\n return 1\n # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n # so we return false. If it is NaN, then assuming a good 754 C \n # implementation Python maps both unordered outcomes to true. \n return 1.0 == x == 2.0\n\nPINF = _make_inf()\nMINF = -PINF\n\nNAN = PINF - PINF\nif not isnan(NAN):\n if NAN != NAN:\n def isnan(x):\n return x!= x\n else:\n raise ValueError(\"This machine doesn't have NaNs, \"\n \"'overflows' to a finite number, \"\n \"suffers a novel way of implementing C comparisons, \"\n \"or is 754-conformant but is using \" \n \"a goofy rounding mode.\")\nPZERO = 0.0\nMZERO = -PZERO", + "methods": [], + "methods_before": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 2 + } + ], + "changed_methods": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.", + "", + "PINF positive infinity", + "MINF minus infinity", + "NAN a generic quiet NaN", + "PZERO positive zero", + "MZERO minus zero", + "", + "isnan(x)", + " Return true iff x is a NaN.", + "\"\"\"", + "", + "def _make_inf():", + " x = 2.0", + " x2 = x * x", + " i = 0", + " while i < 100 and x != x2:", + " x = x2", + " x2 = x * x", + " i = i + 1", + " if x != x2:", + " raise ValueError(\"This machine's floats go on forever!\")", + " return x", + "", + "# NaN-testing.", + "#", + "# The usual method (x != x) doesn't work.", + "# Python forces all comparisons thru a 3-outcome cmp protocol; unordered", + "# isn't a possible outcome. The float cmp outcome is essentially defined", + "# by this C expression (combining some cross-module implementation", + "# details, and where px and py are pointers to C double):", + "# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0", + "# Comparing x to itself thus always yields 0 by the first clause, and so x", + "# != x is never true. If px and py point to distinct NaN objects, a", + "# strange thing happens: 1. On scrupulous 754 implementations, *px < *py", + "# returns false, and so", + "# does *px > *py. Python therefore returns 0, i.e. \"equal\"!", + "# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible", + "# combination of condition codes, including both the \"less than\" and", + "# \"equal to\" flags. Microsoft C generates naive code that accepts the", + "# \"less than\" flag at face value, and so the *px < *py clause returns", + "# true, and Python returns -1, i.e. \"not equal\".", + "# So with a proper C 754 implementation Python returns the wrong result,", + "# and under MS's improper 754 implementation Python yields the right", + "# result -- both by accident. It's unclear who should be shot .", + "#", + "# Anyway, the point of all that was to convince you it's tricky getting", + "# the right answer in a portable way!", + "", + "def isnan(x):", + " \"\"\"x -> true iff x is a NaN.\"\"\"", + " # multiply by 1.0 to create a distinct object (x < x *always*", + " # false in Python, due to object identity forcing equality)", + " if x * 1.0 < x:", + " # it's a NaN and this is MS C on a Pentium", + " return 1", + " # Else it's non-NaN, or NaN on a non-MS+Pentium combo.", + " # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true,", + " # so we return false. If it is NaN, then assuming a good 754 C", + " # implementation Python maps both unordered outcomes to true.", + " return 1.0 == x == 2.0", + "", + "PINF = _make_inf()", + "MINF = -PINF", + "", + "NAN = PINF - PINF", + "if not isnan(NAN):", + " if NAN != NAN:", + " def isnan(x):", + " return x!= x", + " else:", + " raise ValueError(\"This machine doesn't have NaNs, \"", + " \"'overflows' to a finite number, \"", + " \"suffers a novel way of implementing C comparisons, \"", + " \"or is 754-conformant but is using \"", + " \"a goofy rounding mode.\")", + "PZERO = 0.0", + "MZERO = -PZERO" + ] + } + }, + { + "old_path": "scipy_base/limits.py", + "new_path": "scipy_base/limits.py", + "filename": "limits.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,6 +7,8 @@\n \"\"\"\n \n import Numeric\n+import fastumath\n+reload(fastumath)\n from type_check import toFloat32, toFloat64\n \n __all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n", + "added_lines": 2, + "deleted_lines": 0, + "source_code": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nimport fastumath\nreload(fastumath)\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 20, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 30, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 71, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 18, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 28, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 65, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 69, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 57, + "complexity": 10, + "token_count": 335, + "diff_parsed": { + "added": [ + "import fastumath", + "reload(fastumath)" + ], + "deleted": [] + } + }, + { + "old_path": "scipy_base/mconf_lite_BE.h", + "new_path": "scipy_base/mconf_lite_BE.h", + "filename": "mconf_lite_BE.h", + "extension": "h", + "change_type": "MODIFY", + "diff": "@@ -93,7 +93,7 @@ Modified to handle just the parts necessary for isnan to work.\n #define BIGENDIAN 1\n \n #else \n-#define UNK 1 /* Machine not known\n+#define UNK 1 /* Machine not known */\n #define BIGENDIAN 1 /* This is a BE file */\n #endif\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known */\n#define BIGENDIAN 1 /* This is a BE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "source_code_before": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known\n#define BIGENDIAN 1 /* This is a BE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 3, + "complexity": 0, + "token_count": 18, + "diff_parsed": { + "added": [ + "#define UNK 1 /* Machine not known */" + ], + "deleted": [ + "#define UNK 1 /* Machine not known" + ] + } + }, + { + "old_path": "scipy_base/mconf_lite_LE.h", + "new_path": "scipy_base/mconf_lite_LE.h", + "filename": "mconf_lite_LE.h", + "extension": "h", + "change_type": "MODIFY", + "diff": "@@ -93,7 +93,7 @@ Modified to handle just the parts necessary for isnan to work.\n #define BIGENDIAN 1\n \n #else \n-#define UNK 1 /* Machine not known\n+#define UNK 1 /* Machine not known */\n #define BIGENDIAN 0 /* This is a LE file */\n #endif\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known */\n#define BIGENDIAN 0 /* This is a LE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "source_code_before": "/*\t\t\t\t\t\t\tmconf_lite.h\n *\n *\tCommon include file for math routines\n *\n *\n *\n * SYNOPSIS:\n *\n * #include \"mconf_lite.h\"\n *\n *\n *\n * DESCRIPTION:\n *\n * The file also includes a conditional assembly definition\n * for the type of computer arithmetic (IEEE, DEC, Motorola\n * IEEE, or UNKnown).\n * \n * For Digital Equipment PDP-11 and VAX computers, certain\n * IBM systems, and others that use numbers with a 56-bit\n * significand, the symbol DEC should be defined. In this\n * mode, most floating point constants are given as arrays\n * of octal integers to eliminate decimal to binary conversion\n * errors that might be introduced by the compiler.\n *\n * For little-endian computers, such as IBM PC, that follow the\n * IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE\n * Std 754-1985), the symbol IBMPC should be defined. These\n * numbers have 53-bit significands. In this mode, constants\n * are provided as arrays of hexadecimal 16 bit integers.\n *\n * Big-endian IEEE format is denoted MIEEE. On some RISC\n * systems such as Sun SPARC, double precision constants\n * must be stored on 8-byte address boundaries. Since integer\n * arrays may be aligned differently, the MIEEE configuration\n * may fail on such machines.\n *\n * To accommodate other types of computer arithmetic, all\n * constants are also provided in a normal decimal radix\n * which one can hope are correctly converted to a suitable\n * format by the available C language compiler. To invoke\n * this mode, define the symbol UNK.\n *\n * An important difference among these modes is a predefined\n * set of machine arithmetic constants for each. The numbers\n * MACHEP (the machine roundoff error), MAXNUM (largest number\n * represented), and several other parameters are preset by\n * the configuration symbol. Check the file const.c to\n * ensure that these values are correct for your computer.\n *\n * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL\n * may fail on many systems. Verify that they are supposed\n * to work on your computer.\n */\n\f\n/*\nCephes Math Library Release 2.3: June, 1995\nCopyright 1984, 1987, 1989, 1995 by Stephen L. Moshier\n\nModified to handle just the parts necessary for isnan to work.\n*/\n\n\n/* Type of computer arithmetic */\n\n/* PDP-11, Pro350, VAX:\n */\n/* #define DEC 1 */\n\n/* Not sure about these pdp defines */\n#if defined(vax) || defined(__vax__) || defined(decvax) || \\\n defined(__decvax__) || defined(pro350) || defined(pdp11)\n#define DEC 1 \n\n#elif defined(ns32000) || defined(sun386) || \\\n defined(i386) || defined(MIPSEL) || defined(_MIPSEL) || \\\n defined(BIT_ZERO_ON_RIGHT) || defined(__alpha__) || defined(__alpha) || \\\n defined(sequent) || defined(i386) || \\\n defined(__ns32000__) || defined(__sun386__) || defined(__i386__)\n#define IBMPC 1 /* Intel IEEE, low order words come first */\n#define BIGENDIAN 0\n\n#elif defined(sel) || defined(pyr) || defined(mc68000) || defined (m68k) || \\\n defined(is68k) || defined(tahoe) || defined(ibm032) || \\\n defined(ibm370) || defined(MIPSEB) || defined(_MIPSEB) || \\\n defined(__convex__) || defined(DGUX) || defined(hppa) || \\\n defined(apollo) || defined(_CRAY) || defined(__hppa) || \\\n defined(__hp9000) || defined(__hp9000s300) || \\\n defined(__hp9000s700) || defined(__AIX) || defined(_AIX) \\\n defined(__pyr__) || defined(__mc68000__) || defined(__sparc) ||\\\n defined(_IBMR2) || defined (BIT_ZERO_ON_LEFT) \n#define MIEEE 1 /* Motorola IEEE, high order words come first */\n#define BIGENDIAN 1\n\n#else \n#define UNK 1 /* Machine not known\n#define BIGENDIAN 0 /* This is a LE file */\n#endif\n\n\n/* Define to ask for infinity support, else undefine. */\n#define INFINITIES 1\n\n/* Define to ask for support of numbers that are Not-a-Number,\n else undefine. This may automatically define INFINITIES in some files. */\n#define NANS 1\n\n/* Define to distinguish between -0.0 and +0.0. */\n#define MINUSZERO 1\n\n#if !defined(signbit)\nint signbit(double);\n#endif\n#if !defined(isnan)\nint isnan(double);\n#endif\n#if !defined(isfinite)\nint isfinite(double);\n#endif\n", + "methods": [], + "methods_before": [], + "changed_methods": [], + "nloc": 3, + "complexity": 0, + "token_count": 18, + "diff_parsed": { + "added": [ + "#define UNK 1 /* Machine not known */" + ], + "deleted": [ + "#define UNK 1 /* Machine not known" + ] + } + } + ] + }, + { + "hash": "31773e77b8277aea2989bd227292ea556eb46f8f", + "msg": "Removed dependence on ufuncobject PyUFunc_DD type functions which can require structure-returning functions to be passed between differently-compiled code.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-04T22:05:49+00:00", + "author_timezone": 0, + "committer_date": "2002-04-04T22:05:49+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "a039b9c3290bd9962e70c802c4d8bc1d7dc481b1" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 10, + "insertions": 151, + "lines": 161, + "files": 2, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 0.2698412698412698, + "modified_files": [ + { + "old_path": "scipy_base/fastumathmodule.c", + "new_path": "scipy_base/fastumathmodule.c", + "filename": "fastumathmodule.c", + "extension": "c", + "change_type": "MODIFY", + "diff": "@@ -157,6 +157,69 @@ static void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)\n static void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n \n \n+\n+/* Some functions needed from ufunc object, so that Py_complex's aren't being returned \n+between code possibly compiled with different compilers.\n+*/\n+\n+typedef Py_complex ComplexBinaryFunc(Py_complex x, Py_complex y);\n+typedef Py_complex ComplexUnaryFunc(Py_complex x);\n+\n+static void fastumath_F_F_As_D_D(char **args, int *dimensions, int *steps, void *func) {\n+ int i; Py_complex x;\n+ char *ip1=args[0], *op=args[1];\n+ for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {\n+\tx.real = ((float *)ip1)[0]; x.imag = ((float *)ip1)[1];\n+\tx = ((ComplexUnaryFunc *)func)(x);\n+\t((float *)op)[0] = (float)x.real;\n+\t((float *)op)[1] = (float)x.imag;\n+ }\n+}\n+\n+static void fastumath_D_D(char **args, int *dimensions, int *steps, void *func) {\n+ int i; Py_complex x;\n+ char *ip1=args[0], *op=args[1];\n+ for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {\n+\tx.real = ((double *)ip1)[0]; x.imag = ((double *)ip1)[1];\n+\tx = ((ComplexUnaryFunc *)func)(x);\n+\t((double *)op)[0] = x.real;\n+\t((double *)op)[1] = x.imag;\n+ }\n+}\n+\n+\n+static void fastumath_FF_F_As_DD_D(char **args, int *dimensions, int *steps, void *func) {\n+ int i, is1=steps[0],is2=steps[1],os=steps[2];\n+ char *ip1=args[0], *ip2=args[1], *op=args[2];\n+ int n=dimensions[0];\n+ Py_complex x, y;\n+\t\n+ for(i=0; i\n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n Also allows comparison operations on complex numbers (just compares the real part)\n and logical operations.\n\n All logical operations return UBYTE arrays.\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n\n/* Some functions needed from ufunc object, so that Py_complex's aren't being returned \nbetween code possibly compiled with different compilers.\n*/\n\ntypedef Py_complex ComplexBinaryFunc(Py_complex x, Py_complex y);\ntypedef Py_complex ComplexUnaryFunc(Py_complex x);\n\nstatic void fastumath_F_F_As_D_D(char **args, int *dimensions, int *steps, void *func) {\n int i; Py_complex x;\n char *ip1=args[0], *op=args[1];\n for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {\n\tx.real = ((float *)ip1)[0]; x.imag = ((float *)ip1)[1];\n\tx = ((ComplexUnaryFunc *)func)(x);\n\t((float *)op)[0] = (float)x.real;\n\t((float *)op)[1] = (float)x.imag;\n }\n}\n\nstatic void fastumath_D_D(char **args, int *dimensions, int *steps, void *func) {\n int i; Py_complex x;\n char *ip1=args[0], *op=args[1];\n for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {\n\tx.real = ((double *)ip1)[0]; x.imag = ((double *)ip1)[1];\n\tx = ((ComplexUnaryFunc *)func)(x);\n\t((double *)op)[0] = x.real;\n\t((double *)op)[1] = x.imag;\n }\n}\n\n\nstatic void fastumath_FF_F_As_DD_D(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2];\n char *ip1=args[0], *ip2=args[1], *op=args[2];\n int n=dimensions[0];\n Py_complex x, y;\n\t\n for(i=0; i */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = fastumath_FF_F_As_DD_D;\n multiply_functions[8] = fastumath_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = fastumath_FF_F_As_DD_D;\n divide_functions[8] = fastumath_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = fastumath_FF_F_As_DD_D;\n divide_safe_functions[8] = fastumath_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = fastumath_FF_F_As_DD_D;\n power_functions[8] = fastumath_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = fastumath_F_F_As_D_D;\n arccos_functions[3] = fastumath_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "source_code_before": "\n#include \"Python.h\"\n#include \"Numeric/arrayobject.h\"\n#include \"Numeric/ufuncobject.h\"\n#include \"abstract.h\"\n#include \n#include \"mconf_lite.h\"\n\n/* Fast umath module whose functions do not check for range and domain errors.\n\n Replacement for umath + additions for isnan, isfinite, and isinf\n Also allows comparison operations on complex numbers (just compares the real part)\n and logical operations.\n\n All logical operations return UBYTE arrays.\n */\n\n#ifndef CHAR_BIT\n#define CHAR_BIT 8\n#endif\n\n#ifndef LONG_BIT\n#define LONG_BIT (CHAR_BIT * sizeof(long))\n#endif\n\n#ifndef INT_BIT\n#define INT_BIT (CHAR_BIT * sizeof(int))\n#endif\n\n#ifndef SHORT_BIT\n#define SHORT_BIT (CHAR_BIT * sizeof(short))\n#endif\n\n/* A whole slew of basic math functions are provided 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\n#ifndef M_PI\n#define M_PI 3.1415926535897931\n#endif\n\n\n#define ABS(x) ((x) < 0 ? -(x) : (x))\n\n/* isnan and isinf and isfinite functions */\nstatic void FLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) ABS(isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((float *)i1)[0]) || isnan((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isnan(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isnan((double)((double *)i1)[0]) || isnan((double)((double *)i1)[1]);\n }\n}\n\n\nstatic void FLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) !(isfinite((double)(*((float *)i1))) || isnan((double)(*((float *)i1))));\n }\n}\n\nstatic void DOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !(isfinite((double)(*((double *)i1))) || isnan((double)(*((double *)i1))));\n }\n}\n\nstatic void CFLOAT_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((float *)i1)[0])) && isfinite((double)(((float *)i1)[1]))) || isnan((double)(((float *)i1)[0])) || isnan((double)(((float *)i1)[1])));\n }\n}\n\nstatic void CDOUBLE_isinf(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op)= (unsigned char) !((isfinite((double)(((double *)i1)[0])) && isfinite((double)(((double *)i1)[1]))) || isnan((double)(((double *)i1)[0])) || isnan((double)(((double *)i1)[1])));\n }\n}\n\n\nstatic void FLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((float *)i1)));\n }\n}\n\nstatic void DOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)(*((double *)i1)));\n }\n}\n\nstatic void CFLOAT_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((float *)i1)[0]) && isfinite((double)((float *)i1)[1]);\n }\n}\n\nstatic void CDOUBLE_isfinite(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0], os=steps[1], n=dimensions[0];\n char *i1=args[0], *op=args[1];\n for (i=0; i < n; i++, i1+=is1, op+=os) {\n\t*((unsigned char *)op) = (unsigned char) isfinite((double)((double *)i1)[0]) && isfinite((double)((double *)i1)[1]);\n }\n}\n\nstatic PyUFuncGenericFunction isnan_functions[] = {FLOAT_isnan, DOUBLE_isnan, CFLOAT_isnan, CDOUBLE_isnan, NULL};\nstatic PyUFuncGenericFunction isinf_functions[] = {FLOAT_isinf, DOUBLE_isinf, CFLOAT_isinf, CDOUBLE_isinf, NULL};\nstatic PyUFuncGenericFunction isfinite_functions[] = {FLOAT_isfinite, DOUBLE_isfinite, CFLOAT_isfinite, CDOUBLE_isfinite, NULL};\n\nstatic char isinf_signatures[] = { PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\n\nstatic void * isnan_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isinf_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * isfinite_data[] = {(void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\n\n\n#if !defined(HAVE_INVERSE_HYPERBOLIC)\nstatic double acosh(double x)\n{\n return log(x + sqrt((x-1.0)*(x+1.0)));\n}\n\nstatic double asinh(double xx)\n{\n double x;\n int sign;\n if (x < 0.0) {\n\tsign = -1;\n\tx = -xx;\n }\n else {\n\tsign = 1;\n\tx = xx;\n }\n return sign*log(x + sqrt(x*x+1.0));\n}\n\nstatic double atanh(double x)\n{\n return 0.5*log((1.0+x)/(1.0-x));\n}\n#endif\n\n#if defined(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 double yx;\n\n x = fabs(x);\n y = fabs(y);\n if (x < y) {\n\tdouble temp = x;\n\tx = y;\n\ty = temp;\n }\n if (x == 0.)\n\treturn 0.;\n else {\n\tyx = y/x;\n\treturn x*sqrt(1.+yx*yx);\n }\n}\n#endif\n\n#ifdef i860\n/* Cray APP has bogus definition of HUGE_VAL in */\n#undef HUGE_VAL\n#endif\n\n#ifdef HUGE_VAL\n#define CHECK(x) if (errno != 0) ; \telse if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \telse errno = ERANGE\n#else\n#define CHECK(x) /* Don't know how to check */\n#endif\n\n\n\n/* First, the C functions that do the real work */\n\n/* constants */\nstatic Py_complex c_1 = {1., 0.};\nstatic Py_complex c_half = {0.5, 0.};\nstatic Py_complex c_i = {0., 1.};\nstatic Py_complex c_i2 = {0., 0.5};\nstatic Py_complex c_mi = {0., -1.};\nstatic Py_complex c_pi2 = {M_PI/2., 0.};\n\nstatic Py_complex c_quot_fast(Py_complex a, Py_complex b)\n{\n /******************************************************************/\n \n /* This algorithm is better, and is pretty obvious: first divide the\n * numerators and denominator by whichever of {b.real, b.imag} has\n * larger magnitude. The earliest reference I found was to CACM\n * Algorithm 116 (Complex Division, Robert L. Smith, Stanford\n * University). As usual, though, we're still ignoring all IEEE\n * endcases.\n */\n Py_complex r; /* the result */\n\n const double abs_breal = b.real < 0 ? -b.real : b.real;\n const double abs_bimag = b.imag < 0 ? -b.imag : b.imag;\n\n if ((b.real == 0.0) && (b.imag == 0.0)) {\n\tr.real = a.real / b.real;\n\tr.imag = a.imag / b.imag;\n/* \tif (a.real == 0.0) {r.real = a.real/b.real;} */\n/* \telse if (a.real < 0.0) {r.real = -1.0/0.0;} */\n/* \telse if (a.real > 0.0) {r.real = 1.0/0.0;} */\n\t\n/* \tif (a.imag == 0.0) {r.imag = a.imag/b.imag;} */\n/* \telse if (a.imag < 0.0) {r.imag = -1.0/0.0;} */\n/* \telse if (a.imag > 0.0) {r.imag = 1.0/0.0;} */\n\treturn r;\n }\n \n if (abs_breal >= abs_bimag) {\n\t/* divide tops and bottom by b.real */\n\tconst double ratio = b.imag / b.real;\n\tconst double denom = b.real + b.imag * ratio;\n\tr.real = (a.real + a.imag * ratio) / denom;\n\tr.imag = (a.imag - a.real * ratio) / denom;\n }\n else {\n\t/* divide tops and bottom by b.imag */\n\tconst double ratio = b.real / b.imag;\n\tconst double denom = b.real * ratio + b.imag;\n\tr.real = (a.real * ratio + a.imag) / denom;\n\tr.imag = (a.imag * ratio - a.real) / denom;\n }\n return r;\n}\n\nstatic Py_complex c_sqrt(Py_complex x)\n{\n Py_complex r;\n double s,d;\n if (x.real == 0. && x.imag == 0.)\n\tr = x;\n else {\n\ts = sqrt(0.5*(fabs(x.real) + hypot(x.real,x.imag)));\n\td = 0.5*x.imag/s;\n\tif (x.real > 0.) {\n\t r.real = s;\n\t r.imag = d;\n\t}\n\telse if (x.imag >= 0.) {\n\t r.real = d;\n\t r.imag = s;\n\t}\n\telse {\n\t r.real = -d;\n\t r.imag = -s;\n\t}\n }\n return r;\n}\n\nstatic Py_complex c_log(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real);\n r.real = log(l);\n return r;\n}\n\nstatic Py_complex c_prodi(Py_complex x)\n{\n Py_complex r;\n r.real = -x.imag;\n r.imag = x.real;\n return r;\n}\n\nstatic Py_complex c_acos(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(x,c_prod(c_i,\n\t\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x))))))));\n}\n\nstatic Py_complex c_acosh(Py_complex x)\n{\n return c_log(c_sum(x,c_prod(c_i,\n\t\t\t\tc_sqrt(c_diff(c_1,c_prod(x,x))))));\n}\n\nstatic Py_complex c_asin(Py_complex x)\n{\n return c_neg(c_prodi(c_log(c_sum(c_prod(c_i,x),\n\t\t\t\t c_sqrt(c_diff(c_1,c_prod(x,x)))))));\n}\n\nstatic Py_complex c_asinh(Py_complex x)\n{\n return c_neg(c_log(c_diff(c_sqrt(c_sum(c_1,c_prod(x,x))),x)));\n}\n\nstatic Py_complex c_atan(Py_complex x)\n{\n return c_prod(c_i2,c_log(c_quot_fast(c_sum(c_i,x),c_diff(c_i,x))));\n}\n\nstatic Py_complex c_atanh(Py_complex x)\n{\n return c_prod(c_half,c_log(c_quot_fast(c_sum(c_1,x),c_diff(c_1,x))));\n}\n\nstatic Py_complex c_cos(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.real)*cosh(x.imag);\n r.imag = -sin(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_cosh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*cosh(x.real);\n r.imag = sin(x.imag)*sinh(x.real);\n return r;\n}\n\nstatic Py_complex c_exp(Py_complex x)\n{\n Py_complex r;\n double l = exp(x.real);\n r.real = l*cos(x.imag);\n r.imag = l*sin(x.imag);\n return r;\n}\n\nstatic Py_complex c_log10(Py_complex x)\n{\n Py_complex r;\n double l = hypot(x.real,x.imag);\n r.imag = atan2(x.imag, x.real)/log(10.);\n r.real = log10(l);\n return r;\n}\n\nstatic Py_complex c_sin(Py_complex x)\n{\n Py_complex r;\n r.real = sin(x.real)*cosh(x.imag);\n r.imag = cos(x.real)*sinh(x.imag);\n return r;\n}\n\nstatic Py_complex c_sinh(Py_complex x)\n{\n Py_complex r;\n r.real = cos(x.imag)*sinh(x.real);\n r.imag = sin(x.imag)*cosh(x.real);\n return r;\n}\n\nstatic Py_complex c_tan(Py_complex x)\n{\n Py_complex r;\n double sr,cr,shi,chi;\n double rs,is,rc,ic;\n double d;\n sr = sin(x.real);\n cr = cos(x.real);\n shi = sinh(x.imag);\n chi = cosh(x.imag);\n rs = sr*chi;\n is = cr*shi;\n rc = cr*chi;\n ic = -sr*shi;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic Py_complex c_tanh(Py_complex x)\n{\n Py_complex r;\n double si,ci,shr,chr;\n double rs,is,rc,ic;\n double d;\n si = sin(x.imag);\n ci = cos(x.imag);\n shr = sinh(x.real);\n chr = cosh(x.real);\n rs = ci*shr;\n is = si*chr;\n rc = ci*chr;\n ic = si*shr;\n d = rc*rc + ic*ic;\n r.real = (rs*rc+is*ic)/d;\n r.imag = (is*rc-rs*ic)/d;\n return r;\n}\n\nstatic long powll(long x, long n, int nbits)\n /* Overflow check: overflow will occur if log2(abs(x)) * n > nbits. */\n{\n long r = 1;\n long p = x;\n double logtwox;\n long mask = 1;\n if (n < 0) PyErr_SetString(PyExc_ValueError, \"Integer to a negative power\");\n if (x != 0) {\n\tlogtwox = log10 (fabs ( (double) x))/log10 ( (double) 2.0);\n\tif (logtwox * (double) n > (double) nbits)\n\t PyErr_SetString(PyExc_ArithmeticError, \"Integer overflow in power.\");\n }\n while (mask > 0 && n >= mask) {\n\tif (n & mask)\n\t r *= p;\n\tmask <<= 1;\n\tp *= p;\n }\n return r;\n}\n\n\nstatic void UBYTE_add(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i 255) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((unsigned char *)op)=(unsigned char) x;\n }\n}\nstatic void SBYTE_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int x;\n for(i=0; i 127 || x < -128) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((signed char *)op)=(signed char) x;\n }\n}\nstatic void SHORT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n short a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (SHORT_BIT/2);\n\tbh = b >> (SHORT_BIT/2);\n\t/* Quick test for common case: two small positive shorts */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (SHORT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((short *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (SHORT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((short *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (SHORT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (SHORT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (SHORT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((short *)op)=s*x;\n }\n}\nstatic void INT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n int a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (INT_BIT/2);\n\tbh = b >> (INT_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (INT_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((int *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (INT_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((int *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1 << (INT_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1 << (INT_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (INT_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((int *)op)=s*x;\n }\n}\nstatic void LONG_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n long a, b, ah, bh, x, y;\n int s;\n for(i=0; i> (LONG_BIT/2);\n\tbh = b >> (LONG_BIT/2);\n\t/* Quick test for common case: two small positive ints */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=x;\n\t\tcontinue;\n\t }\n\t}\n\t/* Arrange that a >= b >= 0 */\n\tif (a < 0) {\n\t a = -a;\n\t if (a < 0) {\n\t\t/* Largest negative */\n\t\tif (b == 0 || b == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t ah = a >> (LONG_BIT/2);\n\t}\n\tif (b < 0) {\n\t b = -b;\n\t if (b < 0) {\n\t\t/* Largest negative */\n\t\tif (a == 0 || a == 1) {\n\t\t *((long *)op)=a*b;\n\t\t continue;\n\t\t}\n\t\telse {\n\t\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\t return;\n\t\t}\n\t }\n\t s = -s;\n\t bh = b >> (LONG_BIT/2);\n\t}\n\t/* 1) both ah and bh > 0 : then report overflow */\n\tif (ah != 0 && bh != 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t/* 2) both ah and bh = 0 : then compute a*b and report\n\t overflow if it comes out negative */\n\tif (ah == 0 && bh == 0) {\n\t if ((x=a*b) < 0) {\n\t\tPyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t\treturn;\n\t }\n\t else {\n\t\t*((long *)op)=s * x;\n\t\tcontinue;\n\t }\n\t}\n\tif (a < b) {\n\t /* Swap */\n\t x = a;\n\t a = b;\n\t b = x;\n\t ah = bh;\n\t /* bh not used beyond this point */\n\t}\n\t/* 3) ah > 0 and bh = 0 : compute ah*bl and report overflow if\n\t it's >= 2^31\n\t compute al*bl and report overflow if it's negative\n\t add (ah*bl)<<32 to al*bl and report overflow if\n\t it's negative\n\t (NB b == bl in this case, and we make a = al) */\n\ty = ah*b;\n\tif (y >= (1L << (LONG_BIT/2 - 1))) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\ta &= (1L << (LONG_BIT/2)) - 1;\n\tx = a*b;\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\tx += y << (LONG_BIT/2);\n\tif (x < 0) {\n\t PyErr_SetString (PyExc_ArithmeticError, \"Integer overflow in multiply.\");\n\t return;\n\t}\n\t*((long *)op)=s*x;\n }\n}\nstatic void FLOAT_multiply(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2);\n }\n}\nstatic void SHORT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2);\n }\n}\nstatic void INT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2);\n }\n}\nstatic void LONG_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2);\n }\n}\nstatic void FLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2);\n }\n}\nstatic void DOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2);\n }\n}\n\n/* complex numbers are compared by there real parts. */\nstatic void CFLOAT_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((float *)i2)[0];\n }\n}\nstatic void CDOUBLE_greater(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i ((double *)i2)[0];\n }\n}\n\nstatic void UBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((signed char *)i2);\n }\n}\nstatic void SHORT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((short *)i2);\n }\n}\nstatic void INT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((int *)i2);\n }\n}\nstatic void LONG_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((long *)i2);\n }\n}\nstatic void FLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void DOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\nstatic void CFLOAT_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((float *)i2);\n }\n}\nstatic void CDOUBLE_greater_equal(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i= *((double *)i2);\n }\n}\n\nstatic void UBYTE_less(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((unsigned char *)i2) ? *((unsigned char *)i1) : *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((signed char *)i2) ? *((signed char *)i1) : *((signed char *)i2);\n }\n}\nstatic void SHORT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((short *)i2) ? *((short *)i1) : *((short *)i2);\n }\n}\nstatic void INT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((int *)i2) ? *((int *)i1) : *((int *)i2);\n }\n}\nstatic void LONG_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((long *)i2) ? *((long *)i1) : *((long *)i2);\n }\n}\nstatic void FLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n }\n}\nstatic void DOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n }\n}\nstatic void CFLOAT_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((float *)i2) ? *((float *)i1) : *((float *)i2);\n\t((float *)op)[1]=*((float *)i1) > *((float *)i2) ? ((float *)i1)[1] : ((float *)i2)[1];\n }\n}\nstatic void CDOUBLE_maximum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i *((double *)i2) ? *((double *)i1) : *((double *)i2);\n\t((double *)op)[1]=*((double *)i1) > *((double *)i2) ? ((double *)i1)[1] : ((double *)i2)[1];\n }\n}\nstatic void UBYTE_minimum(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((unsigned char *)i2);\n }\n}\nstatic void SBYTE_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((signed char *)i2);\n }\n}\nstatic void SHORT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((short *)i2);\n }\n}\nstatic void INT_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((int *)i2);\n }\n}\nstatic void LONG_right_shift(char **args, int *dimensions, int *steps, void *func) {\n int i, is1=steps[0],is2=steps[1],os=steps[2], n=dimensions[0];\n char *i1=args[0], *i2=args[1], *op=args[2];\n for(i=0; i> *((long *)i2);\n }\n}\n\nstatic PyUFuncGenericFunction add_functions[] = { UBYTE_add, SBYTE_add, SHORT_add, INT_add, LONG_add, FLOAT_add, DOUBLE_add, CFLOAT_add, CDOUBLE_add, NULL, };\nstatic PyUFuncGenericFunction subtract_functions[] = { UBYTE_subtract, SBYTE_subtract, SHORT_subtract, INT_subtract, LONG_subtract, FLOAT_subtract, DOUBLE_subtract, CFLOAT_subtract, CDOUBLE_subtract, NULL, };\nstatic PyUFuncGenericFunction multiply_functions[] = { UBYTE_multiply, SBYTE_multiply, SHORT_multiply, INT_multiply, LONG_multiply, FLOAT_multiply, DOUBLE_multiply, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_functions[] = { UBYTE_divide, SBYTE_divide, SHORT_divide, INT_divide, LONG_divide, FLOAT_divide, DOUBLE_divide, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction divide_safe_functions[] = { UBYTE_divide_safe, SBYTE_divide_safe, SHORT_divide_safe, INT_divide_safe, LONG_divide_safe, FLOAT_divide_safe, DOUBLE_divide_safe, };\nstatic PyUFuncGenericFunction conjugate_functions[] = { UBYTE_conjugate, SBYTE_conjugate, SHORT_conjugate, INT_conjugate, LONG_conjugate, FLOAT_conjugate, DOUBLE_conjugate, CFLOAT_conjugate, CDOUBLE_conjugate, NULL, };\nstatic PyUFuncGenericFunction remainder_functions[] = { UBYTE_remainder, SBYTE_remainder, SHORT_remainder, INT_remainder, LONG_remainder, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction power_functions[] = { UBYTE_power, SBYTE_power, SHORT_power, INT_power, LONG_power, NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction absolute_functions[] = { SBYTE_absolute, SHORT_absolute, INT_absolute, LONG_absolute, FLOAT_absolute, DOUBLE_absolute, CFLOAT_absolute, CDOUBLE_absolute, NULL, };\nstatic PyUFuncGenericFunction negative_functions[] = { SBYTE_negative, SHORT_negative, INT_negative, LONG_negative, FLOAT_negative, DOUBLE_negative, CFLOAT_negative, CDOUBLE_negative, NULL, };\nstatic PyUFuncGenericFunction greater_functions[] = { UBYTE_greater, SBYTE_greater, SHORT_greater, INT_greater, LONG_greater, FLOAT_greater, DOUBLE_greater, CFLOAT_greater, CDOUBLE_greater, };\nstatic PyUFuncGenericFunction greater_equal_functions[] = { UBYTE_greater_equal, SBYTE_greater_equal, SHORT_greater_equal, INT_greater_equal, LONG_greater_equal, FLOAT_greater_equal, DOUBLE_greater_equal, CFLOAT_greater_equal, CDOUBLE_greater_equal, };\nstatic PyUFuncGenericFunction less_functions[] = { UBYTE_less, SBYTE_less, SHORT_less, INT_less, LONG_less, FLOAT_less, DOUBLE_less, CFLOAT_less, CDOUBLE_less, };\nstatic PyUFuncGenericFunction less_equal_functions[] = { UBYTE_less_equal, SBYTE_less_equal, SHORT_less_equal, INT_less_equal, LONG_less_equal, FLOAT_less_equal, DOUBLE_less_equal, CFLOAT_less_equal, CDOUBLE_less_equal, };\nstatic PyUFuncGenericFunction equal_functions[] = { CHAR_equal, UBYTE_equal, SBYTE_equal, SHORT_equal, INT_equal, LONG_equal, FLOAT_equal, DOUBLE_equal, CFLOAT_equal, CDOUBLE_equal, OBJECT_equal};\nstatic PyUFuncGenericFunction not_equal_functions[] = { CHAR_not_equal, UBYTE_not_equal, SBYTE_not_equal, SHORT_not_equal, INT_not_equal, LONG_not_equal, FLOAT_not_equal, DOUBLE_not_equal, CFLOAT_not_equal, CDOUBLE_not_equal, OBJECT_not_equal};\nstatic PyUFuncGenericFunction logical_and_functions[] = { UBYTE_logical_and, SBYTE_logical_and, SHORT_logical_and, INT_logical_and, LONG_logical_and, FLOAT_logical_and, DOUBLE_logical_and, CFLOAT_logical_and, CDOUBLE_logical_and, };\nstatic PyUFuncGenericFunction logical_or_functions[] = { UBYTE_logical_or, SBYTE_logical_or, SHORT_logical_or, INT_logical_or, LONG_logical_or, FLOAT_logical_or, DOUBLE_logical_or, CFLOAT_logical_or, CDOUBLE_logical_or, };\nstatic PyUFuncGenericFunction logical_xor_functions[] = { UBYTE_logical_xor, SBYTE_logical_xor, SHORT_logical_xor, INT_logical_xor, LONG_logical_xor, FLOAT_logical_xor, DOUBLE_logical_xor, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction logical_not_functions[] = { UBYTE_logical_not, SBYTE_logical_not, SHORT_logical_not, INT_logical_not, LONG_logical_not, FLOAT_logical_not, DOUBLE_logical_not, CFLOAT_logical_xor, CDOUBLE_logical_xor, };\nstatic PyUFuncGenericFunction maximum_functions[] = { UBYTE_maximum, SBYTE_maximum, SHORT_maximum, INT_maximum, LONG_maximum, FLOAT_maximum, DOUBLE_maximum, CFLOAT_maximum, CDOUBLE_maximum,};\nstatic PyUFuncGenericFunction minimum_functions[] = { UBYTE_minimum, SBYTE_minimum, SHORT_minimum, INT_minimum, LONG_minimum, FLOAT_minimum, DOUBLE_minimum, CFLOAT_minimum, CDOUBLE_minimum, };\nstatic PyUFuncGenericFunction bitwise_and_functions[] = { UBYTE_bitwise_and, SBYTE_bitwise_and, SHORT_bitwise_and, INT_bitwise_and, LONG_bitwise_and, NULL, };\nstatic PyUFuncGenericFunction bitwise_or_functions[] = { UBYTE_bitwise_or, SBYTE_bitwise_or, SHORT_bitwise_or, INT_bitwise_or, LONG_bitwise_or, NULL, };\nstatic PyUFuncGenericFunction bitwise_xor_functions[] = { UBYTE_bitwise_xor, SBYTE_bitwise_xor, SHORT_bitwise_xor, INT_bitwise_xor, LONG_bitwise_xor, NULL, };\nstatic PyUFuncGenericFunction invert_functions[] = { UBYTE_invert, SBYTE_invert, SHORT_invert, INT_invert, LONG_invert, };\nstatic PyUFuncGenericFunction left_shift_functions[] = { UBYTE_left_shift, SBYTE_left_shift, SHORT_left_shift, INT_left_shift, LONG_left_shift, NULL, };\nstatic PyUFuncGenericFunction right_shift_functions[] = { UBYTE_right_shift, SBYTE_right_shift, SHORT_right_shift, INT_right_shift, LONG_right_shift, NULL, };\nstatic PyUFuncGenericFunction arccos_functions[] = { NULL, NULL, NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction ceil_functions[] = { NULL, NULL, NULL, };\nstatic PyUFuncGenericFunction arctan2_functions[] = { NULL, NULL, NULL, };\nstatic void * add_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * subtract_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * divide_safe_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * conjugate_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * remainder_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * power_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * absolute_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * negative_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * equal_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL};\nstatic void * bitwise_and_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_or_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * bitwise_xor_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * invert_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL,};\nstatic void * left_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * right_shift_data[] = { (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, (void *)NULL, };\nstatic void * arccos_data[] = { (void *)acos, (void *)acos, (void *)c_acos, (void *)c_acos, (void *)\"arccos\", };\nstatic void * arcsin_data[] = { (void *)asin, (void *)asin, (void *)c_asin, (void *)c_asin, (void *)\"arcsin\", };\nstatic void * arctan_data[] = { (void *)atan, (void *)atan, (void *)c_atan, (void *)c_atan, (void *)\"arctan\", };\nstatic void * arccosh_data[] = { (void *)acosh, (void *)acosh, (void *)c_acosh, (void *)c_acosh, (void *)\"arccosh\", };\nstatic void * arcsinh_data[] = { (void *)asinh, (void *)asinh, (void *)c_asinh, (void *)c_asinh, (void *)\"arcsinh\", };\nstatic void * arctanh_data[] = { (void *)atanh, (void *)atanh, (void *)c_atanh, (void *)c_atanh, (void *)\"arctanh\", };\nstatic void * cos_data[] = { (void *)cos, (void *)cos, (void *)c_cos, (void *)c_cos, (void *)\"cos\", };\nstatic void * cosh_data[] = { (void *)cosh, (void *)cosh, (void *)c_cosh, (void *)c_cosh, (void *)\"cosh\", };\nstatic void * exp_data[] = { (void *)exp, (void *)exp, (void *)c_exp, (void *)c_exp, (void *)\"exp\", };\nstatic void * log_data[] = { (void *)log, (void *)log, (void *)c_log, (void *)c_log, (void *)\"log\", };\nstatic void * log10_data[] = { (void *)log10, (void *)log10, (void *)c_log10, (void *)c_log10, (void *)\"log10\", };\nstatic void * sin_data[] = { (void *)sin, (void *)sin, (void *)c_sin, (void *)c_sin, (void *)\"sin\", };\nstatic void * sinh_data[] = { (void *)sinh, (void *)sinh, (void *)c_sinh, (void *)c_sinh, (void *)\"sinh\", };\nstatic void * sqrt_data[] = { (void *)sqrt, (void *)sqrt, (void *)c_sqrt, (void *)c_sqrt, (void *)\"sqrt\", };\nstatic void * tan_data[] = { (void *)tan, (void *)tan, (void *)c_tan, (void *)c_tan, (void *)\"tan\", };\nstatic void * tanh_data[] = { (void *)tanh, (void *)tanh, (void *)c_tanh, (void *)c_tanh, (void *)\"tanh\", };\nstatic void * ceil_data[] = { (void *)ceil, (void *)ceil, (void *)\"ceil\", };\nstatic void * fabs_data[] = { (void *)fabs, (void *)fabs, (void *)\"fabs\", };\nstatic void * floor_data[] = { (void *)floor, (void *)floor, (void *)\"floor\", };\nstatic void * arctan2_data[] = { (void *)atan2, (void *)atan2, (void *)\"arctan2\", };\nstatic void * fmod_data[] = { (void *)fmod, (void *)fmod, (void *)\"fmod\", };\nstatic void * hypot_data[] = { (void *)hypot, (void *)hypot, (void *)\"hypot\", };\nstatic char add_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char divide_safe_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, };\nstatic char conjugate_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char remainder_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char absolute_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_FLOAT, PyArray_CDOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char negative_signatures[] = { PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char equal_signatures[] = { PyArray_CHAR, PyArray_CHAR, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE, PyArray_OBJECT, PyArray_OBJECT, PyArray_UBYTE};\nstatic char greater_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_UBYTE };\nstatic char logical_not_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_UBYTE, PyArray_SHORT, PyArray_UBYTE, PyArray_INT, PyArray_UBYTE, PyArray_LONG, PyArray_UBYTE, PyArray_FLOAT, PyArray_UBYTE, PyArray_DOUBLE, PyArray_UBYTE, PyArray_CFLOAT, PyArray_UBYTE, PyArray_CDOUBLE, PyArray_UBYTE, };\nstatic char maximum_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_CDOUBLE, };\nstatic char bitwise_and_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char invert_signatures[] = { PyArray_UBYTE, PyArray_UBYTE, PyArray_SBYTE, PyArray_SBYTE, PyArray_SHORT, PyArray_SHORT, PyArray_INT, PyArray_INT, PyArray_LONG, PyArray_LONG, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arccos_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_CFLOAT, PyArray_CFLOAT, PyArray_CDOUBLE, PyArray_CDOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char ceil_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic char arctan2_signatures[] = { PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_OBJECT, PyArray_OBJECT, };\nstatic void InitOperators(PyObject *dictionary) {\n PyObject *f;\n\n add_data[9] =(void *)PyNumber_Add;\n subtract_data[9] = (void *)PyNumber_Subtract;\n multiply_data[7] = (void *)c_prod;\n multiply_data[8] = (void *)c_prod;\n multiply_data[9] = (void *)PyNumber_Multiply;\n divide_data[7] = (void *)c_quot_fast;\n divide_data[8] = (void *)c_quot_fast;\n divide_data[9] = (void *)PyNumber_Divide;\n divide_safe_data[7] = (void *)c_quot;\n divide_safe_data[8] = (void *)c_quot;\n divide_safe_data[9] = (void *)PyNumber_Divide;\n conjugate_data[9] = (void *)\"conjugate\";\n remainder_data[5] = (void *)fmod;\n remainder_data[6] = (void *)fmod;\n remainder_data[7] = (void *)PyNumber_Remainder;\n power_data[5] = (void *)pow;\n power_data[6] = (void *)pow;\n power_data[7] = (void *)c_pow;\n power_data[8] = (void *)c_pow;\n power_data[9] = (void *)PyNumber_Power;\n absolute_data[8] = (void *)PyNumber_Absolute;\n negative_data[8] = (void *)PyNumber_Negative;\n bitwise_and_data[5] = (void *)PyNumber_And;\n bitwise_or_data[5] = (void *)PyNumber_Or;\n bitwise_xor_data[5] = (void *)PyNumber_Xor;\n invert_data[5] = (void *)PyNumber_Invert;\n left_shift_data[5] = (void *)PyNumber_Lshift;\n right_shift_data[5] = (void *)PyNumber_Rshift;\n\n\n add_functions[9] = PyUFunc_OO_O;\n subtract_functions[9] = PyUFunc_OO_O;\n multiply_functions[7] = PyUFunc_FF_F_As_DD_D;\n multiply_functions[8] = PyUFunc_DD_D;\n multiply_functions[9] = PyUFunc_OO_O;\n divide_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_functions[8] = PyUFunc_DD_D;\n divide_functions[9] = PyUFunc_OO_O;\n divide_safe_functions[7] = PyUFunc_FF_F_As_DD_D;\n divide_safe_functions[8] = PyUFunc_DD_D;\n divide_safe_functions[9] = PyUFunc_OO_O;\n conjugate_functions[9] = PyUFunc_O_O_method;\n remainder_functions[5] = PyUFunc_ff_f_As_dd_d;\n remainder_functions[6] = PyUFunc_dd_d;\n remainder_functions[7] = PyUFunc_OO_O;\n power_functions[5] = PyUFunc_ff_f_As_dd_d;\n power_functions[6] = PyUFunc_dd_d;\n power_functions[7] = PyUFunc_FF_F_As_DD_D;\n power_functions[8] = PyUFunc_DD_D;\n power_functions[9] = PyUFunc_OO_O;\n absolute_functions[8] = PyUFunc_O_O;\n negative_functions[8] = PyUFunc_O_O;\n bitwise_and_functions[5] = PyUFunc_OO_O;\n bitwise_or_functions[5] = PyUFunc_OO_O;\n bitwise_xor_functions[5] = PyUFunc_OO_O;\n invert_functions[5] = PyUFunc_O_O;\n left_shift_functions[5] = PyUFunc_OO_O;\n right_shift_functions[5] = PyUFunc_OO_O;\n arccos_functions[0] = PyUFunc_f_f_As_d_d;\n arccos_functions[1] = PyUFunc_d_d;\n arccos_functions[2] = PyUFunc_F_F_As_D_D;\n arccos_functions[3] = PyUFunc_D_D;\n arccos_functions[4] = PyUFunc_O_O_method;\n ceil_functions[0] = PyUFunc_f_f_As_d_d;\n ceil_functions[1] = PyUFunc_d_d;\n ceil_functions[2] = PyUFunc_O_O_method;\n arctan2_functions[0] = PyUFunc_ff_f_As_dd_d;\n arctan2_functions[1] = PyUFunc_dd_d;\n arctan2_functions[2] = PyUFunc_O_O_method;\n\n\n f = PyUFunc_FromFuncAndData(isinf_functions, isinf_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isinf\", \n \"isinf(x) returns non-zero if x is infinity.\", 0);\n PyDict_SetItemString(dictionary, \"isinf\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isfinite_functions, isfinite_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isfinite\", \n \"isfinite(x) returns non-zero if x is not infinity or not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isfinite\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(isnan_functions, isnan_data, isinf_signatures, \n 4, 1, 1, PyUFunc_None, \"isnan\", \n \"isnan(x) returns non-zero if x is not a number.\", 0);\n PyDict_SetItemString(dictionary, \"isnan\", f);\n Py_DECREF(f);\n\n f = PyUFunc_FromFuncAndData(add_functions, add_data, add_signatures, 10, \n\t\t\t\t2, 1, PyUFunc_Zero, \"add\", \n\t\t\t\t\"Add the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"add\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(subtract_functions, subtract_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_Zero, \"subtract\", \n\t\t\t\t\"Subtract the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"subtract\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(multiply_functions, multiply_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"multiply\", \n\t\t\t\t\"Multiply the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"multiply\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_functions, divide_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"divide\", \n\t\t\t\t\"Divide the arguments elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"divide\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(divide_safe_functions, divide_safe_data, divide_safe_signatures, \n\t\t\t\t7, 2, 1, PyUFunc_One, \"divide_safe\", \n\t\t\t\t\"Divide elementwise, ZeroDivision exception thrown if necessary.\", 0);\n PyDict_SetItemString(dictionary, \"divide_safe\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(conjugate_functions, conjugate_data, conjugate_signatures, \n\t\t\t\t10, 1, 1, PyUFunc_None, \"conjugate\", \n\t\t\t\t\"returns conjugate of each element\", 0);\n PyDict_SetItemString(dictionary, \"conjugate\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(remainder_functions, remainder_data, remainder_signatures, \n\t\t\t\t8, 2, 1, PyUFunc_Zero, \"remainder\", \n\t\t\t\t\"returns remainder of division elementwise\", 0);\n PyDict_SetItemString(dictionary, \"remainder\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(power_functions, power_data, add_signatures, \n\t\t\t\t10, 2, 1, PyUFunc_One, \"power\", \n\t\t\t\t\"power(x,y) = x**y elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"power\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(absolute_functions, absolute_data, absolute_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"absolute\", \n\t\t\t\t\"returns absolute value of each element\", 0);\n PyDict_SetItemString(dictionary, \"absolute\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(negative_functions, negative_data, negative_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"negative\", \n\t\t\t\t\"negative(x) == -x elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"negative\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater\", \n\t\t\t\t\"greater(x,y) is array of 1's where x > y, 0 otherwise.\",1);\n PyDict_SetItemString(dictionary, \"greater\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(greater_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"greater_equal\", \n\t\t\t\t\"greater_equal(x,y) is array of 1's where x >=y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"greater_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less\", \n\t\t\t\t\"less(x,y) is array of 1's where x < y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(less_equal_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"less_equal\", \n\t\t\t\t\"less_equal(x,y) is array of 1's where x <= y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"less_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_One, \"equal\", \n\t\t\t\t\"equal(x,y) is array of 1's where x == y, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(not_equal_functions, equal_data, equal_signatures, \n\t\t\t\t11, 2, 1, PyUFunc_None, \"not_equal\", \n\t\t\t\t\"not_equal(x,y) is array of 0's where x == y, 1 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"not_equal\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_and_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_One, \"logical_and\", \n\t\t\t\t\"logical_and(x,y) returns array of 1's where x and y both true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_or_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_Zero, \"logical_or\", \n\t\t\t\t\"logical_or(x,y) returns array of 1's where x or y or both are true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_xor_functions, divide_safe_data, greater_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"logical_xor\", \n\t\t\t\t\"logical_xor(x,y) returns array of 1's where exactly one of x or y is true.\", 0);\n PyDict_SetItemString(dictionary, \"logical_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(logical_not_functions, divide_safe_data, logical_not_signatures, \n\t\t\t\t9, 1, 1, PyUFunc_None, \"logical_not\", \n\t\t\t\t\"logical_not(x) returns array of 1's where x is false, 0 otherwise.\", 0);\n PyDict_SetItemString(dictionary, \"logical_not\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(maximum_functions, divide_safe_data, maximum_signatures, \n\t\t\t\t9, 2, 1, PyUFunc_None, \"maximum\", \n\t\t\t\t\"maximum(x,y) returns maximum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"maximum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(minimum_functions, divide_safe_data, maximum_signatures,\n\t\t\t\t9, 2, 1, PyUFunc_None, \"minimum\", \n\t\t\t\t\"minimum(x,y) returns minimum of x and y taken elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"minimum\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_and_functions, bitwise_and_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_One, \"bitwise_and\", \n\t\t\t\t\"bitwise_and(x,y) returns array of bitwise-and of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_and\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_or_functions, bitwise_or_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_Zero, \"bitwise_or\", \n\t\t\t\t\"bitwise_or(x,y) returns array of bitwise-or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_or\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(bitwise_xor_functions, bitwise_xor_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"bitwise_xor\", \n\t\t\t\t\"bitwise_xor(x,y) returns array of bitwise exclusive or of respective elements.\", 0);\n PyDict_SetItemString(dictionary, \"bitwise_xor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(invert_functions, invert_data, invert_signatures, \n\t\t\t\t6, 1, 1, PyUFunc_None, \"invert\", \n\t\t\t\t\"invert(n) returns array of bit inversion elementwise if n is an integer array.\", 0);\n PyDict_SetItemString(dictionary, \"invert\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(left_shift_functions, left_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"left_shift\", \n\t\t\t\t\"left_shift(n, m) is n << m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"left_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(right_shift_functions, right_shift_data, bitwise_and_signatures, \n\t\t\t\t6, 2, 1, PyUFunc_None, \"right_shift\", \n\t\t\t\t\"right_shift(n, m) is n >> m elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"right_shift\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccos\", \n\t\t\t\t\"arccos(x) returns array of elementwise inverse cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsin\", \n\t\t\t\t\"arcsin(x) returns array of elementwise inverse sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctan\", \n\t\t\t\t\"arctan(x) returns array of elementwise inverse tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arctanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arctanh\",\n\t\t\t\t\"arctanh(x) returns array of elementwise inverse hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"arctanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arccosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arccosh\",\n\t\t\t\t\"arccosh(x) returns array of elementwise inverse hyperbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"arccosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, arcsinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"arcsinh\",\n\t\t\t\t\"arcsinh(x) returns array of elementwise inverse hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"arcsinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cos_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cos\", \n\t\t\t\t\"cos(x) returns array of elementwise cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cos\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, cosh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"cosh\", \n\t\t\t\t\"cosh(x) returns array of elementwise hyberbolic cosines.\", 0);\n PyDict_SetItemString(dictionary, \"cosh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, exp_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"exp\", \n\t\t\t\t\"exp(x) returns array of elementwise e**x.\", 0);\n PyDict_SetItemString(dictionary, \"exp\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log\", \n\t\t\t\t\"log(x) returns array of elementwise natural logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, log10_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"log10\", \n\t\t\t\t\"log10(x) returns array of elementwise base-10 logarithms.\", 0);\n PyDict_SetItemString(dictionary, \"log10\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sin_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sin\", \n\t\t\t\t\"sin(x) returns array of elementwise sines.\", 0);\n PyDict_SetItemString(dictionary, \"sin\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sinh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sinh\", \n\t\t\t\t\"sinh(x) returns array of elementwise hyperbolic sines.\", 0);\n PyDict_SetItemString(dictionary, \"sinh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, sqrt_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"sqrt\",\n\t\t\t\t\"sqrt(x) returns array of elementwise square roots.\", 0);\n PyDict_SetItemString(dictionary, \"sqrt\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tan_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tan\", \n\t\t\t\t\"tan(x) returns array of elementwise tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tan\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arccos_functions, tanh_data, arccos_signatures, \n\t\t\t\t5, 1, 1, PyUFunc_None, \"tanh\", \n\t\t\t\t\"tanh(x) returns array of elementwise hyperbolic tangents.\", 0);\n PyDict_SetItemString(dictionary, \"tanh\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, ceil_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"ceil\", \n\t\t\t\t\"ceil(x) returns array of elementwise least whole number >= x.\", 0);\n PyDict_SetItemString(dictionary, \"ceil\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, fabs_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"fabs\", \n\t\t\t\t\"fabs(x) returns array of elementwise absolute values, 32 bit if x is.\", 0);\n\n PyDict_SetItemString(dictionary, \"fabs\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(ceil_functions, floor_data, ceil_signatures, \n\t\t\t\t3, 1, 1, PyUFunc_None, \"floor\", \n\t\t\t\t\"floor(x) returns array of elementwise least whole number <= x.\", 0);\n PyDict_SetItemString(dictionary, \"floor\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, arctan2_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"arctan2\", \n\t\t\t\t\"arctan2(x,y) is a safe and correct tan(x/y).\", 0);\n PyDict_SetItemString(dictionary, \"arctan2\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, fmod_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"fmod\", \n\t\t\t\t\"fmod(x,y) is remainder(x,y)\", 0);\n PyDict_SetItemString(dictionary, \"fmod\", f);\n Py_DECREF(f);\n f = PyUFunc_FromFuncAndData(arctan2_functions, hypot_data, arctan2_signatures, \n\t\t\t\t3, 2, 1, PyUFunc_None, \"hypot\", \n\t\t\t\t\"hypot(x,y) = sqrt(x**2 + y**2), elementwise.\", 0);\n PyDict_SetItemString(dictionary, \"hypot\", f);\n Py_DECREF(f);\n}\n\n\n/* Initialization function for the module (*must* be called initArray) */\n\nstatic struct PyMethodDef methods[] = {\n {NULL,\t\tNULL, 0}\t\t/* sentinel */\n};\n\nDL_EXPORT(void) initfastumath() {\n PyObject *m, *d, *s, *f1, *f2;\n \n /* Create the module and add the functions */\n m = Py_InitModule(\"fastumath\", methods); \n\n /* Import the array and ufunc objects */\n import_array();\n import_ufunc();\n\n /* Add some symbolic constants to the module */\n d = PyModule_GetDict(m);\n\n s = PyString_FromString(\"2.0\");\n PyDict_SetItemString(d, \"__version__\", s);\n Py_DECREF(s);\n\n /* Load the ufunc operators into the array module's namespace */\n InitOperators(d); \n\n PyDict_SetItemString(d, \"pi\", s = PyFloat_FromDouble(atan(1.0) * 4.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"e\", s = PyFloat_FromDouble(exp(1.0)));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PINF\", s = PyFloat_FromDouble(1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NINF\", s = PyFloat_FromDouble(-1.0/0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"PZERO\", s = PyFloat_FromDouble(0.0));\n Py_DECREF(s);\n PyDict_SetItemString(d, \"NZERO\", s = PyFloat_FromDouble(-0.0));\n Py_DECREF(s);\n#if defined(NAN) \n PyDict_SetItemString(d, \"NAN\", s = PyFloat_FromDouble(NAN));\n Py_DECREF(s);\n#endif\n\n /* Temporarily set \"invert\" to \"conjugate\" in the dictionary so the call\n to SetNumericOps will make ~ do complex conjugation */\n\n f1 = PyDict_GetItemString(d, \"conjugate\"); /* Borrowed reference */\n /* f2 = PyDict_GetItemString(d, \"invert\"); */ /* Borrowed reference */\n /* Py_INCREF(f2);*//*so we must incref it or it will be destroyed on next line*/\n /* PyDict_SetItemString(d, \"invert\", f1);*/ /* Set invert to this reference so \n that ~ will mean conjugation */\n /* Setup the array object's numerical structures */\n PyArray_SetNumericOps(d);\n\n /* Reset dictionary so that \"invert\" will mean bitwise invert */\n /* PyDict_SetItemString(d, \"invert\", f2); \n Py_DECREF(f2) */\n PyDict_SetItemString(d, \"conj\", f1); /* shorthand for conjugate */\n \n /* Check for errors */\n if (PyErr_Occurred())\n\tPy_FatalError(\"can't initialize module fast_umath\");\n}\n\n", + "methods": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 59, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 67, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 75, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 84, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 92, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 100, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 108, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 117, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 125, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 133, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 141, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "fastumath_F_F_As_D_D", + "long_name": "fastumath_F_F_As_D_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 152, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 168, + "end_line": 177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "fastumath_D_D", + "long_name": "fastumath_D_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 146, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 179, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "fastumath_FF_F_As_DD_D", + "long_name": "fastumath_FF_F_As_DD_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 2, + "token_count": 220, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 191, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "fastumath_DD_D", + "long_name": "fastumath_DD_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 2, + "token_count": 214, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 206, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 224, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 229, + "end_line": 242, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 244, + "end_line": 247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 255, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 298, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 344, + "end_line": 367, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 369, + "end_line": 376, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 378, + "end_line": 384, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 386, + "end_line": 390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 392, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 398, + "end_line": 402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 404, + "end_line": 407, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 409, + "end_line": 412, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 414, + "end_line": 417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 419, + "end_line": 425, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 427, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 435, + "end_line": 442, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 444, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 453, + "end_line": 459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 461, + "end_line": 467, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 469, + "end_line": 487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 489, + "end_line": 507, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 509, + "end_line": 529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 532, + "end_line": 538, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 539, + "end_line": 545, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 546, + "end_line": 552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 553, + "end_line": 559, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 560, + "end_line": 566, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 567, + "end_line": 573, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 574, + "end_line": 580, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 581, + "end_line": 587, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 588, + "end_line": 594, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 595, + "end_line": 601, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 602, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 609, + "end_line": 615, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 616, + "end_line": 622, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 623, + "end_line": 629, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 630, + "end_line": 636, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 637, + "end_line": 643, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 644, + "end_line": 650, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 651, + "end_line": 657, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 658, + "end_line": 670, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 671, + "end_line": 683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 684, + "end_line": 788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 789, + "end_line": 893, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 894, + "end_line": 998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 999, + "end_line": 1005, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1006, + "end_line": 1012, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1013, + "end_line": 1019, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1020, + "end_line": 1026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1027, + "end_line": 1033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1034, + "end_line": 1040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1041, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1054, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1055, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1068, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1069, + "end_line": 1075, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1076, + "end_line": 1082, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1083, + "end_line": 1089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1090, + "end_line": 1096, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1097, + "end_line": 1103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1104, + "end_line": 1110, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1111, + "end_line": 1112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1113, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1115, + "end_line": 1116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1117, + "end_line": 1118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1119, + "end_line": 1120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1121, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1123, + "end_line": 1124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1125, + "end_line": 1126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1127, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1129, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1142, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1143, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1157, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1171, + "end_line": 1177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1178, + "end_line": 1184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1185, + "end_line": 1191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1192, + "end_line": 1198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1199, + "end_line": 1200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1201, + "end_line": 1202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1203, + "end_line": 1204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1205, + "end_line": 1206, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1207, + "end_line": 1208, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1209, + "end_line": 1210, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1211, + "end_line": 1212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1213, + "end_line": 1214, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1215, + "end_line": 1216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1217, + "end_line": 1218, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1219, + "end_line": 1220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1221, + "end_line": 1222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1223, + "end_line": 1224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1225, + "end_line": 1226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1227, + "end_line": 1228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1229, + "end_line": 1230, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1231, + "end_line": 1237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1238, + "end_line": 1244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1245, + "end_line": 1251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1252, + "end_line": 1258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1259, + "end_line": 1265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1266, + "end_line": 1272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1273, + "end_line": 1279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1282, + "end_line": 1288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1289, + "end_line": 1295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1297, + "end_line": 1303, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1304, + "end_line": 1310, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1311, + "end_line": 1317, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1318, + "end_line": 1324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1325, + "end_line": 1331, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1332, + "end_line": 1338, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1339, + "end_line": 1345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1346, + "end_line": 1352, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1353, + "end_line": 1359, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1361, + "end_line": 1367, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1368, + "end_line": 1374, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1375, + "end_line": 1381, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1382, + "end_line": 1388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1389, + "end_line": 1395, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1396, + "end_line": 1402, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1403, + "end_line": 1409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1410, + "end_line": 1416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1417, + "end_line": 1423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1425, + "end_line": 1431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1432, + "end_line": 1438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1439, + "end_line": 1445, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1446, + "end_line": 1452, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1453, + "end_line": 1459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1460, + "end_line": 1466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1467, + "end_line": 1473, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1474, + "end_line": 1480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1481, + "end_line": 1487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1488, + "end_line": 1494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1495, + "end_line": 1501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1502, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1509, + "end_line": 1515, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1516, + "end_line": 1522, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1523, + "end_line": 1529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1530, + "end_line": 1536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1537, + "end_line": 1543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1544, + "end_line": 1550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1551, + "end_line": 1557, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1558, + "end_line": 1564, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1565, + "end_line": 1571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1572, + "end_line": 1578, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1579, + "end_line": 1585, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1586, + "end_line": 1592, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1593, + "end_line": 1599, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1600, + "end_line": 1606, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1607, + "end_line": 1613, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1614, + "end_line": 1620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1621, + "end_line": 1627, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1628, + "end_line": 1634, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1635, + "end_line": 1641, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1642, + "end_line": 1648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1649, + "end_line": 1655, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1656, + "end_line": 1662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1663, + "end_line": 1669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1670, + "end_line": 1676, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1677, + "end_line": 1683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1684, + "end_line": 1690, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1691, + "end_line": 1697, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1698, + "end_line": 1704, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1705, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1712, + "end_line": 1718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1719, + "end_line": 1725, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1726, + "end_line": 1732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1733, + "end_line": 1739, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1740, + "end_line": 1746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1747, + "end_line": 1753, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1754, + "end_line": 1760, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1761, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1774, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1775, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1788, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1789, + "end_line": 1795, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1796, + "end_line": 1802, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1803, + "end_line": 1809, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1810, + "end_line": 1816, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1817, + "end_line": 1823, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1824, + "end_line": 1830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1831, + "end_line": 1832, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1833, + "end_line": 1834, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1835, + "end_line": 1836, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1837, + "end_line": 1838, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1839, + "end_line": 1840, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1841, + "end_line": 1842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1843, + "end_line": 1844, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1845, + "end_line": 1846, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1847, + "end_line": 1848, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1849, + "end_line": 1855, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1856, + "end_line": 1862, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1863, + "end_line": 1869, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1870, + "end_line": 1876, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1877, + "end_line": 1883, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1884, + "end_line": 1890, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1891, + "end_line": 1897, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1898, + "end_line": 1905, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1906, + "end_line": 1913, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1914, + "end_line": 1920, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1921, + "end_line": 1927, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1928, + "end_line": 1934, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1935, + "end_line": 1941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1942, + "end_line": 1948, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1949, + "end_line": 1955, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1956, + "end_line": 1962, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1963, + "end_line": 1970, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1971, + "end_line": 1978, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1979, + "end_line": 1985, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1986, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1993, + "end_line": 1999, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2000, + "end_line": 2006, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2007, + "end_line": 2013, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2014, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2027, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2028, + "end_line": 2034, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2035, + "end_line": 2041, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2042, + "end_line": 2048, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2049, + "end_line": 2055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2056, + "end_line": 2062, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2063, + "end_line": 2069, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2070, + "end_line": 2076, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2077, + "end_line": 2083, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2084, + "end_line": 2085, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2086, + "end_line": 2087, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2088, + "end_line": 2089, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2090, + "end_line": 2091, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2092, + "end_line": 2093, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2094, + "end_line": 2100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2101, + "end_line": 2107, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2108, + "end_line": 2114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2115, + "end_line": 2121, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2122, + "end_line": 2128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2129, + "end_line": 2135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2136, + "end_line": 2142, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2143, + "end_line": 2149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2150, + "end_line": 2156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2157, + "end_line": 2163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2250, + "end_line": 2593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2602, + "end_line": 2658, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "FLOAT_isnan", + "long_name": "FLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isnan", + "long_name": "DOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 118, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 59, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isnan", + "long_name": "CFLOAT_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 67, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isnan", + "long_name": "CDOUBLE_isnan( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 75, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isinf", + "long_name": "FLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 84, + "end_line": 90, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isinf", + "long_name": "DOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 92, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isinf", + "long_name": "CFLOAT_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 100, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isinf", + "long_name": "CDOUBLE_isinf( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 179, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 108, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_isfinite", + "long_name": "FLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 117, + "end_line": 123, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_isfinite", + "long_name": "DOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 125, + "end_line": 131, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_isfinite", + "long_name": "CFLOAT_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 133, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_isfinite", + "long_name": "CDOUBLE_isfinite( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 141, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "acosh", + "long_name": "acosh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 28, + "parameters": [ + "x" + ], + "start_line": 161, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "asinh", + "long_name": "asinh( double xx)", + "filename": "fastumathmodule.c", + "nloc": 14, + "complexity": 2, + "token_count": 59, + "parameters": [ + "xx" + ], + "start_line": 166, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "atanh", + "long_name": "atanh( double x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x" + ], + "start_line": 181, + "end_line": 184, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "hypot", + "long_name": "hypot( double x , double y)", + "filename": "fastumathmodule.c", + "nloc": 17, + "complexity": 3, + "token_count": 78, + "parameters": [ + "x", + "y" + ], + "start_line": 192, + "end_line": 209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "c_quot_fast", + "long_name": "c_quot_fast( Py_complex a , Py_complex b)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 6, + "token_count": 236, + "parameters": [ + "a", + "b" + ], + "start_line": 235, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 45, + "top_nesting_level": 0 + }, + { + "name": "c_sqrt", + "long_name": "c_sqrt( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 24, + "complexity": 5, + "token_count": 138, + "parameters": [ + "x" + ], + "start_line": 281, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "c_log", + "long_name": "c_log( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 306, + "end_line": 313, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_prodi", + "long_name": "c_prodi( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 30, + "parameters": [ + "x" + ], + "start_line": 315, + "end_line": 321, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_acos", + "long_name": "c_acos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 323, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_acosh", + "long_name": "c_acosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 36, + "parameters": [ + "x" + ], + "start_line": 329, + "end_line": 333, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asin", + "long_name": "c_asin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 5, + "complexity": 1, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 335, + "end_line": 339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "c_asinh", + "long_name": "c_asinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [ + "x" + ], + "start_line": 341, + "end_line": 344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atan", + "long_name": "c_atan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 346, + "end_line": 349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_atanh", + "long_name": "c_atanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "x" + ], + "start_line": 351, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "c_cos", + "long_name": "c_cos( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 50, + "parameters": [ + "x" + ], + "start_line": 356, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_cosh", + "long_name": "c_cosh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 364, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_exp", + "long_name": "c_exp( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 372, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_log10", + "long_name": "c_log10( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 1, + "token_count": 56, + "parameters": [ + "x" + ], + "start_line": 381, + "end_line": 388, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "c_sin", + "long_name": "c_sin( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 390, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_sinh", + "long_name": "c_sinh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 1, + "token_count": 49, + "parameters": [ + "x" + ], + "start_line": 398, + "end_line": 404, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "c_tan", + "long_name": "c_tan( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 137, + "parameters": [ + "x" + ], + "start_line": 406, + "end_line": 424, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "c_tanh", + "long_name": "c_tanh( Py_complex x)", + "filename": "fastumathmodule.c", + "nloc": 19, + "complexity": 1, + "token_count": 136, + "parameters": [ + "x" + ], + "start_line": 426, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 0 + }, + { + "name": "powll", + "long_name": "powll( long x , long n , int nbits)", + "filename": "fastumathmodule.c", + "nloc": 20, + "complexity": 7, + "token_count": 129, + "parameters": [ + "x", + "n", + "nbits" + ], + "start_line": 446, + "end_line": 466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_add", + "long_name": "UBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 469, + "end_line": 475, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_add", + "long_name": "SBYTE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 476, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_add", + "long_name": "SHORT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 483, + "end_line": 489, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_add", + "long_name": "INT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 490, + "end_line": 496, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_add", + "long_name": "LONG_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 497, + "end_line": 503, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_add", + "long_name": "FLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 504, + "end_line": 510, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_add", + "long_name": "DOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 511, + "end_line": 517, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_add", + "long_name": "CFLOAT_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 518, + "end_line": 524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_add", + "long_name": "CDOUBLE_add( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 525, + "end_line": 531, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_subtract", + "long_name": "UBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 532, + "end_line": 538, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_subtract", + "long_name": "SBYTE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 539, + "end_line": 545, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_subtract", + "long_name": "SHORT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 546, + "end_line": 552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_subtract", + "long_name": "INT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 553, + "end_line": 559, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_subtract", + "long_name": "LONG_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 560, + "end_line": 566, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_subtract", + "long_name": "FLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 567, + "end_line": 573, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_subtract", + "long_name": "DOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 574, + "end_line": 580, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_subtract", + "long_name": "CFLOAT_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 581, + "end_line": 587, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_subtract", + "long_name": "CDOUBLE_subtract( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 169, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 588, + "end_line": 594, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_multiply", + "long_name": "UBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 3, + "token_count": 174, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 595, + "end_line": 607, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_multiply", + "long_name": "SBYTE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 4, + "token_count": 176, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 608, + "end_line": 620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "SHORT_multiply", + "long_name": "SHORT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 621, + "end_line": 725, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "INT_multiply", + "long_name": "INT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 726, + "end_line": 830, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "LONG_multiply", + "long_name": "LONG_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 90, + "complexity": 22, + "token_count": 581, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 831, + "end_line": 935, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 105, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_multiply", + "long_name": "FLOAT_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 936, + "end_line": 942, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_multiply", + "long_name": "DOUBLE_multiply( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 943, + "end_line": 949, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide", + "long_name": "UBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 950, + "end_line": 956, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide", + "long_name": "SBYTE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 957, + "end_line": 963, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide", + "long_name": "SHORT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 964, + "end_line": 970, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide", + "long_name": "INT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 971, + "end_line": 977, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide", + "long_name": "LONG_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 978, + "end_line": 984, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide", + "long_name": "FLOAT_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 985, + "end_line": 991, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide", + "long_name": "DOUBLE_divide( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 992, + "end_line": 998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_divide_safe", + "long_name": "UBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 999, + "end_line": 1005, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_divide_safe", + "long_name": "SBYTE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1006, + "end_line": 1012, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_divide_safe", + "long_name": "SHORT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1013, + "end_line": 1019, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_divide_safe", + "long_name": "INT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1020, + "end_line": 1026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_divide_safe", + "long_name": "LONG_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1027, + "end_line": 1033, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_divide_safe", + "long_name": "FLOAT_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1034, + "end_line": 1040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_divide_safe", + "long_name": "DOUBLE_divide_safe( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 150, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1041, + "end_line": 1047, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_conjugate", + "long_name": "UBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1048, + "end_line": 1049, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_conjugate", + "long_name": "SBYTE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1050, + "end_line": 1051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_conjugate", + "long_name": "SHORT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1052, + "end_line": 1053, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_conjugate", + "long_name": "INT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1054, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_conjugate", + "long_name": "LONG_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1056, + "end_line": 1057, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_conjugate", + "long_name": "FLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1058, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_conjugate", + "long_name": "DOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1060, + "end_line": 1061, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_conjugate", + "long_name": "CFLOAT_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1062, + "end_line": 1063, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_conjugate", + "long_name": "CDOUBLE_conjugate( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 115, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1064, + "end_line": 1065, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_remainder", + "long_name": "UBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1066, + "end_line": 1072, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_remainder", + "long_name": "SBYTE_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1073, + "end_line": 1079, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_remainder", + "long_name": "SHORT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1080, + "end_line": 1086, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_remainder", + "long_name": "INT_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1087, + "end_line": 1093, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_remainder", + "long_name": "LONG_remainder( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1094, + "end_line": 1100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_power", + "long_name": "UBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1101, + "end_line": 1107, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_power", + "long_name": "SBYTE_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 142, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1108, + "end_line": 1114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_power", + "long_name": "SHORT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 140, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1115, + "end_line": 1121, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_power", + "long_name": "INT_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1122, + "end_line": 1128, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_power", + "long_name": "LONG_power( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 137, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1129, + "end_line": 1135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_absolute", + "long_name": "SBYTE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 113, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1136, + "end_line": 1137, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_absolute", + "long_name": "SHORT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1138, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_absolute", + "long_name": "INT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1140, + "end_line": 1141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_absolute", + "long_name": "LONG_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1142, + "end_line": 1143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_absolute", + "long_name": "FLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1144, + "end_line": 1145, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_absolute", + "long_name": "DOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 3, + "token_count": 109, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1146, + "end_line": 1147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_absolute", + "long_name": "CFLOAT_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 129, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1148, + "end_line": 1149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_absolute", + "long_name": "CDOUBLE_absolute( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 126, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1150, + "end_line": 1151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_negative", + "long_name": "SBYTE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1152, + "end_line": 1153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_negative", + "long_name": "SHORT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1154, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_negative", + "long_name": "INT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1156, + "end_line": 1157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_negative", + "long_name": "LONG_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1158, + "end_line": 1159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_negative", + "long_name": "FLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1160, + "end_line": 1161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_negative", + "long_name": "DOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 89, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1162, + "end_line": 1163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_negative", + "long_name": "CFLOAT_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1164, + "end_line": 1165, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_negative", + "long_name": "CDOUBLE_negative( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 116, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1166, + "end_line": 1167, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater", + "long_name": "UBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 132, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1168, + "end_line": 1174, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater", + "long_name": "SBYTE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1175, + "end_line": 1181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater", + "long_name": "SHORT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1182, + "end_line": 1188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater", + "long_name": "INT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1189, + "end_line": 1195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater", + "long_name": "LONG_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1196, + "end_line": 1202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater", + "long_name": "FLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1203, + "end_line": 1209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater", + "long_name": "DOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1210, + "end_line": 1216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater", + "long_name": "CFLOAT_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1219, + "end_line": 1225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater", + "long_name": "CDOUBLE_greater( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 135, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1226, + "end_line": 1232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_greater_equal", + "long_name": "UBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1234, + "end_line": 1240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_greater_equal", + "long_name": "SBYTE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1241, + "end_line": 1247, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_greater_equal", + "long_name": "SHORT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1248, + "end_line": 1254, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_greater_equal", + "long_name": "INT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1255, + "end_line": 1261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_greater_equal", + "long_name": "LONG_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1262, + "end_line": 1268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_greater_equal", + "long_name": "FLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1269, + "end_line": 1275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_greater_equal", + "long_name": "DOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1276, + "end_line": 1282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_greater_equal", + "long_name": "CFLOAT_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1283, + "end_line": 1289, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_greater_equal", + "long_name": "CDOUBLE_greater_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1290, + "end_line": 1296, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less", + "long_name": "UBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1298, + "end_line": 1304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less", + "long_name": "SBYTE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1305, + "end_line": 1311, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less", + "long_name": "SHORT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1312, + "end_line": 1318, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less", + "long_name": "INT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1319, + "end_line": 1325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less", + "long_name": "LONG_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1326, + "end_line": 1332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less", + "long_name": "FLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1333, + "end_line": 1339, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less", + "long_name": "DOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1340, + "end_line": 1346, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less", + "long_name": "CFLOAT_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1347, + "end_line": 1353, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less", + "long_name": "CDOUBLE_less( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1354, + "end_line": 1360, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_less_equal", + "long_name": "UBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1362, + "end_line": 1368, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_less_equal", + "long_name": "SBYTE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1369, + "end_line": 1375, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_less_equal", + "long_name": "SHORT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1376, + "end_line": 1382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_less_equal", + "long_name": "INT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1383, + "end_line": 1389, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_less_equal", + "long_name": "LONG_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1390, + "end_line": 1396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_less_equal", + "long_name": "FLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1397, + "end_line": 1403, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_less_equal", + "long_name": "DOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1404, + "end_line": 1410, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_less_equal", + "long_name": "CFLOAT_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1411, + "end_line": 1417, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_less_equal", + "long_name": "CDOUBLE_less_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1418, + "end_line": 1424, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_equal", + "long_name": "CHAR_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1425, + "end_line": 1431, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_equal", + "long_name": "UBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1432, + "end_line": 1438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_equal", + "long_name": "SBYTE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1439, + "end_line": 1445, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_equal", + "long_name": "SHORT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1446, + "end_line": 1452, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_equal", + "long_name": "INT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1453, + "end_line": 1459, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_equal", + "long_name": "LONG_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1460, + "end_line": 1466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_equal", + "long_name": "FLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1467, + "end_line": 1473, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_equal", + "long_name": "DOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1474, + "end_line": 1480, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_equal", + "long_name": "CFLOAT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1481, + "end_line": 1487, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_equal", + "long_name": "CDOUBLE_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1488, + "end_line": 1494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_equal", + "long_name": "OBJECT_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1495, + "end_line": 1501, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CHAR_not_equal", + "long_name": "CHAR_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1502, + "end_line": 1508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_not_equal", + "long_name": "UBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1509, + "end_line": 1515, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_not_equal", + "long_name": "SBYTE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1516, + "end_line": 1522, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_not_equal", + "long_name": "SHORT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1523, + "end_line": 1529, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_not_equal", + "long_name": "INT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1530, + "end_line": 1536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_not_equal", + "long_name": "LONG_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1537, + "end_line": 1543, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_not_equal", + "long_name": "FLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1544, + "end_line": 1550, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_not_equal", + "long_name": "DOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1551, + "end_line": 1557, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_not_equal", + "long_name": "CFLOAT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1558, + "end_line": 1564, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_not_equal", + "long_name": "CDOUBLE_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 161, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1565, + "end_line": 1571, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "OBJECT_not_equal", + "long_name": "OBJECT_not_equal( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 138, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1572, + "end_line": 1578, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_and", + "long_name": "UBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1579, + "end_line": 1585, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_and", + "long_name": "SBYTE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1586, + "end_line": 1592, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_and", + "long_name": "SHORT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1593, + "end_line": 1599, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_and", + "long_name": "INT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1600, + "end_line": 1606, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_and", + "long_name": "LONG_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1607, + "end_line": 1613, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_and", + "long_name": "FLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1614, + "end_line": 1620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_and", + "long_name": "DOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1621, + "end_line": 1627, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_and", + "long_name": "CFLOAT_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1628, + "end_line": 1634, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_and", + "long_name": "CDOUBLE_logical_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1635, + "end_line": 1641, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_or", + "long_name": "UBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1642, + "end_line": 1648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_or", + "long_name": "SBYTE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1649, + "end_line": 1655, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_or", + "long_name": "SHORT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1656, + "end_line": 1662, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_or", + "long_name": "INT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1663, + "end_line": 1669, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_or", + "long_name": "LONG_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1670, + "end_line": 1676, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_or", + "long_name": "FLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1677, + "end_line": 1683, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_or", + "long_name": "DOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1684, + "end_line": 1690, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_or", + "long_name": "CFLOAT_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1691, + "end_line": 1697, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_or", + "long_name": "CDOUBLE_logical_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1698, + "end_line": 1704, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_xor", + "long_name": "UBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1705, + "end_line": 1711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_xor", + "long_name": "SBYTE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 158, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1712, + "end_line": 1718, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_xor", + "long_name": "SHORT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1719, + "end_line": 1725, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_xor", + "long_name": "INT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1726, + "end_line": 1732, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_xor", + "long_name": "LONG_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1733, + "end_line": 1739, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_xor", + "long_name": "FLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1740, + "end_line": 1746, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_xor", + "long_name": "DOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1747, + "end_line": 1753, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_xor", + "long_name": "CFLOAT_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 156, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1754, + "end_line": 1760, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_xor", + "long_name": "CDOUBLE_logical_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 5, + "token_count": 154, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1761, + "end_line": 1767, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_logical_not", + "long_name": "UBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1768, + "end_line": 1769, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_logical_not", + "long_name": "SBYTE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 91, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1770, + "end_line": 1771, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_logical_not", + "long_name": "SHORT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1772, + "end_line": 1773, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_logical_not", + "long_name": "INT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1774, + "end_line": 1775, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_logical_not", + "long_name": "LONG_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1776, + "end_line": 1777, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_logical_not", + "long_name": "FLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1778, + "end_line": 1779, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_logical_not", + "long_name": "DOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1780, + "end_line": 1781, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_logical_not", + "long_name": "CFLOAT_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 92, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1782, + "end_line": 1783, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_logical_not", + "long_name": "CDOUBLE_logical_not( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1784, + "end_line": 1785, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_maximum", + "long_name": "UBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1786, + "end_line": 1792, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_maximum", + "long_name": "SBYTE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1793, + "end_line": 1799, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_maximum", + "long_name": "SHORT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1800, + "end_line": 1806, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_maximum", + "long_name": "INT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1807, + "end_line": 1813, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_maximum", + "long_name": "LONG_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1814, + "end_line": 1820, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_maximum", + "long_name": "FLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1821, + "end_line": 1827, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_maximum", + "long_name": "DOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1828, + "end_line": 1834, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_maximum", + "long_name": "CFLOAT_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1835, + "end_line": 1842, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_maximum", + "long_name": "CDOUBLE_maximum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1843, + "end_line": 1850, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_minimum", + "long_name": "UBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1851, + "end_line": 1857, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_minimum", + "long_name": "SBYTE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 153, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1858, + "end_line": 1864, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_minimum", + "long_name": "SHORT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1865, + "end_line": 1871, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_minimum", + "long_name": "INT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1872, + "end_line": 1878, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_minimum", + "long_name": "LONG_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1879, + "end_line": 1885, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "FLOAT_minimum", + "long_name": "FLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1886, + "end_line": 1892, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "DOUBLE_minimum", + "long_name": "DOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 3, + "token_count": 148, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1893, + "end_line": 1899, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "CFLOAT_minimum", + "long_name": "CFLOAT_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1900, + "end_line": 1907, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "CDOUBLE_minimum", + "long_name": "CDOUBLE_minimum( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 8, + "complexity": 4, + "token_count": 199, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1908, + "end_line": 1915, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_and", + "long_name": "UBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1916, + "end_line": 1922, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_and", + "long_name": "SBYTE_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1923, + "end_line": 1929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_and", + "long_name": "SHORT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1930, + "end_line": 1936, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_and", + "long_name": "INT_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1937, + "end_line": 1943, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_and", + "long_name": "LONG_bitwise_and( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1944, + "end_line": 1950, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_or", + "long_name": "UBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1951, + "end_line": 1957, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_or", + "long_name": "SBYTE_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1958, + "end_line": 1964, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_or", + "long_name": "SHORT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1965, + "end_line": 1971, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_or", + "long_name": "INT_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1972, + "end_line": 1978, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_or", + "long_name": "LONG_bitwise_or( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1979, + "end_line": 1985, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_bitwise_xor", + "long_name": "UBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1986, + "end_line": 1992, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_bitwise_xor", + "long_name": "SBYTE_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 133, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 1993, + "end_line": 1999, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_bitwise_xor", + "long_name": "SHORT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2000, + "end_line": 2006, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_bitwise_xor", + "long_name": "INT_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2007, + "end_line": 2013, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_bitwise_xor", + "long_name": "LONG_bitwise_xor( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 130, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2014, + "end_line": 2020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_invert", + "long_name": "UBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2021, + "end_line": 2022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_invert", + "long_name": "SBYTE_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 90, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2023, + "end_line": 2024, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "SHORT_invert", + "long_name": "SHORT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2025, + "end_line": 2026, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "INT_invert", + "long_name": "INT_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2027, + "end_line": 2028, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "LONG_invert", + "long_name": "LONG_invert( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 2, + "complexity": 2, + "token_count": 88, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2029, + "end_line": 2030, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_left_shift", + "long_name": "UBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2031, + "end_line": 2037, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_left_shift", + "long_name": "SBYTE_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2038, + "end_line": 2044, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_left_shift", + "long_name": "SHORT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2045, + "end_line": 2051, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_left_shift", + "long_name": "INT_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2052, + "end_line": 2058, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_left_shift", + "long_name": "LONG_left_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2059, + "end_line": 2065, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "UBYTE_right_shift", + "long_name": "UBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2066, + "end_line": 2072, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SBYTE_right_shift", + "long_name": "SBYTE_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 134, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2073, + "end_line": 2079, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "SHORT_right_shift", + "long_name": "SHORT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2080, + "end_line": 2086, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "INT_right_shift", + "long_name": "INT_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2087, + "end_line": 2093, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "LONG_right_shift", + "long_name": "LONG_right_shift( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 7, + "complexity": 2, + "token_count": 131, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 2094, + "end_line": 2100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2187, + "end_line": 2530, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "initfastumath", + "long_name": "initfastumath()", + "filename": "fastumathmodule.c", + "nloc": 30, + "complexity": 3, + "token_count": 251, + "parameters": [], + "start_line": 2539, + "end_line": 2595, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 57, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "fastumath_D_D", + "long_name": "fastumath_D_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 146, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 179, + "end_line": 188, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "InitOperators", + "long_name": "InitOperators( PyObject * dictionary)", + "filename": "fastumathmodule.c", + "nloc": 335, + "complexity": 1, + "token_count": 2660, + "parameters": [ + "dictionary" + ], + "start_line": 2250, + "end_line": 2593, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 344, + "top_nesting_level": 0 + }, + { + "name": "fastumath_DD_D", + "long_name": "fastumath_DD_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 2, + "token_count": 214, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 206, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "fastumath_FF_F_As_DD_D", + "long_name": "fastumath_FF_F_As_DD_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 13, + "complexity": 2, + "token_count": 220, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 191, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "fastumath_F_F_As_D_D", + "long_name": "fastumath_F_F_As_D_D( char ** args , int * dimensions , int * steps , * func)", + "filename": "fastumathmodule.c", + "nloc": 10, + "complexity": 2, + "token_count": 152, + "parameters": [ + "args", + "dimensions", + "steps", + "func" + ], + "start_line": 168, + "end_line": 177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "nloc": 2422, + "complexity": 673, + "token_count": 40798, + "diff_parsed": { + "added": [ + "", + "/* Some functions needed from ufunc object, so that Py_complex's aren't being returned", + "between code possibly compiled with different compilers.", + "*/", + "", + "typedef Py_complex ComplexBinaryFunc(Py_complex x, Py_complex y);", + "typedef Py_complex ComplexUnaryFunc(Py_complex x);", + "", + "static void fastumath_F_F_As_D_D(char **args, int *dimensions, int *steps, void *func) {", + " int i; Py_complex x;", + " char *ip1=args[0], *op=args[1];", + " for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {", + "\tx.real = ((float *)ip1)[0]; x.imag = ((float *)ip1)[1];", + "\tx = ((ComplexUnaryFunc *)func)(x);", + "\t((float *)op)[0] = (float)x.real;", + "\t((float *)op)[1] = (float)x.imag;", + " }", + "}", + "", + "static void fastumath_D_D(char **args, int *dimensions, int *steps, void *func) {", + " int i; Py_complex x;", + " char *ip1=args[0], *op=args[1];", + " for(i=0; i<*dimensions; i++, ip1+=steps[0], op+=steps[1]) {", + "\tx.real = ((double *)ip1)[0]; x.imag = ((double *)ip1)[1];", + "\tx = ((ComplexUnaryFunc *)func)(x);", + "\t((double *)op)[0] = x.real;", + "\t((double *)op)[1] = x.imag;", + " }", + "}", + "", + "", + "static void fastumath_FF_F_As_DD_D(char **args, int *dimensions, int *steps, void *func) {", + " int i, is1=steps[0],is2=steps[1],os=steps[2];", + " char *ip1=args[0], *ip2=args[1], *op=args[2];", + " int n=dimensions[0];", + " Py_complex x, y;", + "", + " for(i=0; i *py ? 1 : 0\n+# Comparing x to itself thus always yields 0 by the first clause, and so x\n+# != x is never true. If px and py point to distinct NaN objects, a\n+# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n+# returns false, and so\n+# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n+# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n+# combination of condition codes, including both the \"less than\" and\n+# \"equal to\" flags. Microsoft C generates naive code that accepts the\n+# \"less than\" flag at face value, and so the *px < *py clause returns\n+# true, and Python returns -1, i.e. \"not equal\".\n+# So with a proper C 754 implementation Python returns the wrong result,\n+# and under MS's improper 754 implementation Python yields the right\n+# result -- both by accident. It's unclear who should be shot .\n+#\n+# Anyway, the point of all that was to convince you it's tricky getting\n+# the right answer in a portable way!\n+\n+def isnan(x):\n+ \"\"\"x -> true iff x is a NaN.\"\"\"\n+ # multiply by 1.0 to create a distinct object (x < x *always*\n+ # false in Python, due to object identity forcing equality)\n+ if x * 1.0 < x:\n+ # it's a NaN and this is MS C on a Pentium\n+ return 1\n+ # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n+ # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n+ # so we return false. If it is NaN, then assuming a good 754 C \n+ # implementation Python maps both unordered outcomes to true. \n+ return 1.0 == x == 2.0\n+\n+PINF = _make_inf()\n+MINF = -PINF\n+\n+NAN = PINF - PINF\n+if not isnan(NAN):\n+ if NAN != NAN:\n+ def isnan(x):\n+ return x!= x\n+ else:\n+ raise ValueError(\"This machine doesn't have NaNs, \"\n+ \"'overflows' to a finite number, \"\n+ \"suffers a novel way of implementing C comparisons, \"\n+ \"or is 754-conformant but is using \" \n+ \"a goofy rounding mode.\")\n+PZERO = 0.0\n+MZERO = -PZERO\n", + "added_lines": 78, + "deleted_lines": 0, + "source_code": "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.\n\nPINF positive infinity\nMINF minus infinity\nNAN a generic quiet NaN\nPZERO positive zero\nMZERO minus zero\n\nisnan(x)\n Return true iff x is a NaN.\n\"\"\"\n\ndef _make_inf():\n x = 2.0\n x2 = x * x\n i = 0\n while i < 100 and x != x2:\n x = x2\n x2 = x * x\n i = i + 1\n if x != x2:\n raise ValueError(\"This machine's floats go on forever!\")\n return x\n\n# NaN-testing.\n#\n# The usual method (x != x) doesn't work.\n# Python forces all comparisons thru a 3-outcome cmp protocol; unordered\n# isn't a possible outcome. The float cmp outcome is essentially defined\n# by this C expression (combining some cross-module implementation\n# details, and where px and py are pointers to C double):\n# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0\n# Comparing x to itself thus always yields 0 by the first clause, and so x\n# != x is never true. If px and py point to distinct NaN objects, a\n# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n# returns false, and so\n# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n# combination of condition codes, including both the \"less than\" and\n# \"equal to\" flags. Microsoft C generates naive code that accepts the\n# \"less than\" flag at face value, and so the *px < *py clause returns\n# true, and Python returns -1, i.e. \"not equal\".\n# So with a proper C 754 implementation Python returns the wrong result,\n# and under MS's improper 754 implementation Python yields the right\n# result -- both by accident. It's unclear who should be shot .\n#\n# Anyway, the point of all that was to convince you it's tricky getting\n# the right answer in a portable way!\n\ndef isnan(x):\n \"\"\"x -> true iff x is a NaN.\"\"\"\n # multiply by 1.0 to create a distinct object (x < x *always*\n # false in Python, due to object identity forcing equality)\n if x * 1.0 < x:\n # it's a NaN and this is MS C on a Pentium\n return 1\n # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n # so we return false. If it is NaN, then assuming a good 754 C \n # implementation Python maps both unordered outcomes to true. \n return 1.0 == x == 2.0\n\nPINF = _make_inf()\nMINF = -PINF\n\nNAN = PINF - PINF\nif not isnan(NAN):\n if NAN != NAN:\n def isnan(x):\n return x!= x\n else:\n raise ValueError(\"This machine doesn't have NaNs, \"\n \"'overflows' to a finite number, \"\n \"suffers a novel way of implementing C comparisons, \"\n \"or is 754-conformant but is using \" \n \"a goofy rounding mode.\")\nPZERO = 0.0\nMZERO = -PZERO\n", + "source_code_before": null, + "methods": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 2 + } + ], + "methods_before": [], + "changed_methods": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + } + ], + "nloc": 41, + "complexity": 7, + "token_count": 137, + "diff_parsed": { + "added": [ + "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.", + "", + "PINF positive infinity", + "MINF minus infinity", + "NAN a generic quiet NaN", + "PZERO positive zero", + "MZERO minus zero", + "", + "isnan(x)", + " Return true iff x is a NaN.", + "\"\"\"", + "", + "def _make_inf():", + " x = 2.0", + " x2 = x * x", + " i = 0", + " while i < 100 and x != x2:", + " x = x2", + " x2 = x * x", + " i = i + 1", + " if x != x2:", + " raise ValueError(\"This machine's floats go on forever!\")", + " return x", + "", + "# NaN-testing.", + "#", + "# The usual method (x != x) doesn't work.", + "# Python forces all comparisons thru a 3-outcome cmp protocol; unordered", + "# isn't a possible outcome. The float cmp outcome is essentially defined", + "# by this C expression (combining some cross-module implementation", + "# details, and where px and py are pointers to C double):", + "# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0", + "# Comparing x to itself thus always yields 0 by the first clause, and so x", + "# != x is never true. If px and py point to distinct NaN objects, a", + "# strange thing happens: 1. On scrupulous 754 implementations, *px < *py", + "# returns false, and so", + "# does *px > *py. Python therefore returns 0, i.e. \"equal\"!", + "# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible", + "# combination of condition codes, including both the \"less than\" and", + "# \"equal to\" flags. Microsoft C generates naive code that accepts the", + "# \"less than\" flag at face value, and so the *px < *py clause returns", + "# true, and Python returns -1, i.e. \"not equal\".", + "# So with a proper C 754 implementation Python returns the wrong result,", + "# and under MS's improper 754 implementation Python yields the right", + "# result -- both by accident. It's unclear who should be shot .", + "#", + "# Anyway, the point of all that was to convince you it's tricky getting", + "# the right answer in a portable way!", + "", + "def isnan(x):", + " \"\"\"x -> true iff x is a NaN.\"\"\"", + " # multiply by 1.0 to create a distinct object (x < x *always*", + " # false in Python, due to object identity forcing equality)", + " if x * 1.0 < x:", + " # it's a NaN and this is MS C on a Pentium", + " return 1", + " # Else it's non-NaN, or NaN on a non-MS+Pentium combo.", + " # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true,", + " # so we return false. If it is NaN, then assuming a good 754 C", + " # implementation Python maps both unordered outcomes to true.", + " return 1.0 == x == 2.0", + "", + "PINF = _make_inf()", + "MINF = -PINF", + "", + "NAN = PINF - PINF", + "if not isnan(NAN):", + " if NAN != NAN:", + " def isnan(x):", + " return x!= x", + " else:", + " raise ValueError(\"This machine doesn't have NaNs, \"", + " \"'overflows' to a finite number, \"", + " \"suffers a novel way of implementing C comparisons, \"", + " \"or is 754-conformant but is using \"", + " \"a goofy rounding mode.\")", + "PZERO = 0.0", + "MZERO = -PZERO" + ], + "deleted": [] + } + } + ] + }, + { + "hash": "461dee0ff44fdc2762f9baed7b7f0a3a45a100e3", + "msg": "Removed ieee_754.py (again...)", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-05T01:48:14+00:00", + "author_timezone": 0, + "committer_date": "2002-04-05T01:48:14+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "31773e77b8277aea2989bd227292ea556eb46f8f" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 78, + "insertions": 0, + "lines": 78, + "files": 1, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.0, + "modified_files": [ + { + "old_path": "scipy_base/ieee_754.py", + "new_path": null, + "filename": "ieee_754.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,78 +0,0 @@\n-\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.\n-\n-PINF positive infinity\n-MINF minus infinity\n-NAN a generic quiet NaN\n-PZERO positive zero\n-MZERO minus zero\n-\n-isnan(x)\n- Return true iff x is a NaN.\n-\"\"\"\n-\n-def _make_inf():\n- x = 2.0\n- x2 = x * x\n- i = 0\n- while i < 100 and x != x2:\n- x = x2\n- x2 = x * x\n- i = i + 1\n- if x != x2:\n- raise ValueError(\"This machine's floats go on forever!\")\n- return x\n-\n-# NaN-testing.\n-#\n-# The usual method (x != x) doesn't work.\n-# Python forces all comparisons thru a 3-outcome cmp protocol; unordered\n-# isn't a possible outcome. The float cmp outcome is essentially defined\n-# by this C expression (combining some cross-module implementation\n-# details, and where px and py are pointers to C double):\n-# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0\n-# Comparing x to itself thus always yields 0 by the first clause, and so x\n-# != x is never true. If px and py point to distinct NaN objects, a\n-# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n-# returns false, and so\n-# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n-# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n-# combination of condition codes, including both the \"less than\" and\n-# \"equal to\" flags. Microsoft C generates naive code that accepts the\n-# \"less than\" flag at face value, and so the *px < *py clause returns\n-# true, and Python returns -1, i.e. \"not equal\".\n-# So with a proper C 754 implementation Python returns the wrong result,\n-# and under MS's improper 754 implementation Python yields the right\n-# result -- both by accident. It's unclear who should be shot .\n-#\n-# Anyway, the point of all that was to convince you it's tricky getting\n-# the right answer in a portable way!\n-\n-def isnan(x):\n- \"\"\"x -> true iff x is a NaN.\"\"\"\n- # multiply by 1.0 to create a distinct object (x < x *always*\n- # false in Python, due to object identity forcing equality)\n- if x * 1.0 < x:\n- # it's a NaN and this is MS C on a Pentium\n- return 1\n- # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n- # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n- # so we return false. If it is NaN, then assuming a good 754 C \n- # implementation Python maps both unordered outcomes to true. \n- return 1.0 == x == 2.0\n-\n-PINF = _make_inf()\n-MINF = -PINF\n-\n-NAN = PINF - PINF\n-if not isnan(NAN):\n- if NAN != NAN:\n- def isnan(x):\n- return x!= x\n- else:\n- raise ValueError(\"This machine doesn't have NaNs, \"\n- \"'overflows' to a finite number, \"\n- \"suffers a novel way of implementing C comparisons, \"\n- \"or is 754-conformant but is using \" \n- \"a goofy rounding mode.\")\n-PZERO = 0.0\n-MZERO = -PZERO\n", + "added_lines": 0, + "deleted_lines": 78, + "source_code": null, + "source_code_before": "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.\n\nPINF positive infinity\nMINF minus infinity\nNAN a generic quiet NaN\nPZERO positive zero\nMZERO minus zero\n\nisnan(x)\n Return true iff x is a NaN.\n\"\"\"\n\ndef _make_inf():\n x = 2.0\n x2 = x * x\n i = 0\n while i < 100 and x != x2:\n x = x2\n x2 = x * x\n i = i + 1\n if x != x2:\n raise ValueError(\"This machine's floats go on forever!\")\n return x\n\n# NaN-testing.\n#\n# The usual method (x != x) doesn't work.\n# Python forces all comparisons thru a 3-outcome cmp protocol; unordered\n# isn't a possible outcome. The float cmp outcome is essentially defined\n# by this C expression (combining some cross-module implementation\n# details, and where px and py are pointers to C double):\n# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0\n# Comparing x to itself thus always yields 0 by the first clause, and so x\n# != x is never true. If px and py point to distinct NaN objects, a\n# strange thing happens: 1. On scrupulous 754 implementations, *px < *py\n# returns false, and so\n# does *px > *py. Python therefore returns 0, i.e. \"equal\"!\n# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible\n# combination of condition codes, including both the \"less than\" and\n# \"equal to\" flags. Microsoft C generates naive code that accepts the\n# \"less than\" flag at face value, and so the *px < *py clause returns\n# true, and Python returns -1, i.e. \"not equal\".\n# So with a proper C 754 implementation Python returns the wrong result,\n# and under MS's improper 754 implementation Python yields the right\n# result -- both by accident. It's unclear who should be shot .\n#\n# Anyway, the point of all that was to convince you it's tricky getting\n# the right answer in a portable way!\n\ndef isnan(x):\n \"\"\"x -> true iff x is a NaN.\"\"\"\n # multiply by 1.0 to create a distinct object (x < x *always*\n # false in Python, due to object identity forcing equality)\n if x * 1.0 < x:\n # it's a NaN and this is MS C on a Pentium\n return 1\n # Else it's non-NaN, or NaN on a non-MS+Pentium combo.\n # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true, \n # so we return false. If it is NaN, then assuming a good 754 C \n # implementation Python maps both unordered outcomes to true. \n return 1.0 == x == 2.0\n\nPINF = _make_inf()\nMINF = -PINF\n\nNAN = PINF - PINF\nif not isnan(NAN):\n if NAN != NAN:\n def isnan(x):\n return x!= x\n else:\n raise ValueError(\"This machine doesn't have NaNs, \"\n \"'overflows' to a finite number, \"\n \"suffers a novel way of implementing C comparisons, \"\n \"or is 754-conformant but is using \" \n \"a goofy rounding mode.\")\nPZERO = 0.0\nMZERO = -PZERO\n", + "methods": [], + "methods_before": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 2 + } + ], + "changed_methods": [ + { + "name": "_make_inf", + "long_name": "_make_inf( )", + "filename": "ieee_754.py", + "nloc": 11, + "complexity": 4, + "token_count": 51, + "parameters": [], + "start_line": 13, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "isnan", + "long_name": "isnan( x )", + "filename": "ieee_754.py", + "nloc": 4, + "complexity": 2, + "token_count": 27, + "parameters": [ + "x" + ], + "start_line": 50, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "\"\"\"Module ieee: exports a few useful IEEE-754 constants and functions.", + "", + "PINF positive infinity", + "MINF minus infinity", + "NAN a generic quiet NaN", + "PZERO positive zero", + "MZERO minus zero", + "", + "isnan(x)", + " Return true iff x is a NaN.", + "\"\"\"", + "", + "def _make_inf():", + " x = 2.0", + " x2 = x * x", + " i = 0", + " while i < 100 and x != x2:", + " x = x2", + " x2 = x * x", + " i = i + 1", + " if x != x2:", + " raise ValueError(\"This machine's floats go on forever!\")", + " return x", + "", + "# NaN-testing.", + "#", + "# The usual method (x != x) doesn't work.", + "# Python forces all comparisons thru a 3-outcome cmp protocol; unordered", + "# isn't a possible outcome. The float cmp outcome is essentially defined", + "# by this C expression (combining some cross-module implementation", + "# details, and where px and py are pointers to C double):", + "# px == py ? 0 : *px < *py ? -1 : *px > *py ? 1 : 0", + "# Comparing x to itself thus always yields 0 by the first clause, and so x", + "# != x is never true. If px and py point to distinct NaN objects, a", + "# strange thing happens: 1. On scrupulous 754 implementations, *px < *py", + "# returns false, and so", + "# does *px > *py. Python therefore returns 0, i.e. \"equal\"!", + "# 2. On Pentium HW, an unordered outcome sets an otherwise-impossible", + "# combination of condition codes, including both the \"less than\" and", + "# \"equal to\" flags. Microsoft C generates naive code that accepts the", + "# \"less than\" flag at face value, and so the *px < *py clause returns", + "# true, and Python returns -1, i.e. \"not equal\".", + "# So with a proper C 754 implementation Python returns the wrong result,", + "# and under MS's improper 754 implementation Python yields the right", + "# result -- both by accident. It's unclear who should be shot .", + "#", + "# Anyway, the point of all that was to convince you it's tricky getting", + "# the right answer in a portable way!", + "", + "def isnan(x):", + " \"\"\"x -> true iff x is a NaN.\"\"\"", + " # multiply by 1.0 to create a distinct object (x < x *always*", + " # false in Python, due to object identity forcing equality)", + " if x * 1.0 < x:", + " # it's a NaN and this is MS C on a Pentium", + " return 1", + " # Else it's non-NaN, or NaN on a non-MS+Pentium combo.", + " # If it's non-NaN, then x == 1.0 and x == 2.0 can't both be true,", + " # so we return false. If it is NaN, then assuming a good 754 C", + " # implementation Python maps both unordered outcomes to true.", + " return 1.0 == x == 2.0", + "", + "PINF = _make_inf()", + "MINF = -PINF", + "", + "NAN = PINF - PINF", + "if not isnan(NAN):", + " if NAN != NAN:", + " def isnan(x):", + " return x!= x", + " else:", + " raise ValueError(\"This machine doesn't have NaNs, \"", + " \"'overflows' to a finite number, \"", + " \"suffers a novel way of implementing C comparisons, \"", + " \"or is 754-conformant but is using \"", + " \"a goofy rounding mode.\")", + "PZERO = 0.0", + "MZERO = -PZERO" + ] + } + } + ] + }, + { + "hash": "ad8ff90e28c2798e23d4edc0ea8d424569b7b8c3", + "msg": "Fixed random buglets.", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-05T11:28:30+00:00", + "author_timezone": 0, + "committer_date": "2002-04-05T11:28:30+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "461dee0ff44fdc2762f9baed7b7f0a3a45a100e3" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 32, + "insertions": 34, + "lines": 66, + "files": 15, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_base/__init__.py", + "new_path": "scipy_base/__init__.py", + "filename": "__init__.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,7 +1,7 @@\n \n import Numeric\n from Numeric import *\n-import fastumath\n+import scipy_base.fastumath\n import limits\n \n from type_check import *\n@@ -13,12 +13,12 @@\n from polynomial import *\n from scimath import *\n \n-# needs fastumath\n-Inf = inf = fastumath.PINF\n+# needs scipy_base.fastumath\n+Inf = inf = scipy_base.fastumath.PINF\n try:\n- NAN = NaN = nan = fastumath.NAN\n+ NAN = NaN = nan = scipy_base.fastumath.NAN\n except AttributeError:\n- NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n+ NaN = NAN = nan = scipy_base.fastumath.PINF - scipy_base.fastumath.PINF\n \n \n #---- testing ----#\n", + "added_lines": 5, + "deleted_lines": 5, + "source_code": "\nimport Numeric\nfrom Numeric import *\nimport scipy_base.fastumath\nimport limits\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs scipy_base.fastumath\nInf = inf = scipy_base.fastumath.PINF\ntry:\n NAN = NaN = nan = scipy_base.fastumath.NAN\nexcept AttributeError:\n NaN = NAN = nan = scipy_base.fastumath.PINF - scipy_base.fastumath.PINF\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "source_code_before": "\nimport Numeric\nfrom Numeric import *\nimport fastumath\nimport limits\n\nfrom type_check import *\nfrom index_tricks import *\nfrom function_base import *\nfrom shape_base import *\nfrom matrix_base import *\n\nfrom polynomial import *\nfrom scimath import *\n\n# needs fastumath\nInf = inf = fastumath.PINF\ntry:\n NAN = NaN = nan = fastumath.NAN\nexcept AttributeError:\n NaN = NAN = nan = fastumath.PINF - fastumath.PINF\n\n\n#---- testing ----#\n\ndef test(level=10):\n import unittest\n runner = unittest.TextTestRunner()\n runner.run(test_suite())\n return runner\n\ndef test_suite(level=1):\n import scipy_base.testing\n import scipy_base\n this_mod = scipy_base\n # testing is the module that actually does all the testing...\n ignore = ['testing']\n return scipy_base.testing.harvest_test_suites(this_mod,ignore = ignore,\n level=level)\n\n\n", + "methods": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 32, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "__init__.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "level" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "__init__.py", + "nloc": 7, + "complexity": 1, + "token_count": 38, + "parameters": [ + "level" + ], + "start_line": 32, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 28, + "complexity": 2, + "token_count": 148, + "diff_parsed": { + "added": [ + "import scipy_base.fastumath", + "# needs scipy_base.fastumath", + "Inf = inf = scipy_base.fastumath.PINF", + " NAN = NaN = nan = scipy_base.fastumath.NAN", + " NaN = NAN = nan = scipy_base.fastumath.PINF - scipy_base.fastumath.PINF" + ], + "deleted": [ + "import fastumath", + "# needs fastumath", + "Inf = inf = fastumath.PINF", + " NAN = NaN = nan = fastumath.NAN", + " NaN = NAN = nan = fastumath.PINF - fastumath.PINF" + ] + } + }, + { + "old_path": "scipy_base/function_base.py", + "new_path": "scipy_base/function_base.py", + "filename": "function_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,7 +1,8 @@\n import types\n import Numeric\n from Numeric import *\n-from fastumath import *\n+from scipy_base.fastumath import *\n+from type_check import ScalarType\n \n __all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n@@ -11,6 +12,7 @@\n any = Numeric.sometrue\n all = Numeric.alltrue\n \n+\n def logspace(start,stop,num=50,endpoint=1):\n \"\"\" Evenly spaced samples on a logarithmic scale.\n \n", + "added_lines": 3, + "deleted_lines": 1, + "source_code": "import types\nimport Numeric\nfrom Numeric import *\nfrom scipy_base.fastumath import *\nfrom type_check import ScalarType\n\n__all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n 'prod','cumprod','diff','angle','unwrap','sort_complex']\n\nround = Numeric.around\nany = Numeric.sometrue\nall = Numeric.alltrue\n\n\ndef logspace(start,stop,num=50,endpoint=1):\n \"\"\" Evenly spaced samples on a logarithmic scale.\n\n Return num evenly spaced samples from 10**start to 10**stop. If\n endpoint=1 then last sample is 10**stop.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start\n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n return Numeric.power(10.0,y)\n\ndef linspace(start,stop,num=50,endpoint=1,retstep=0):\n \"\"\" Evenly spaced samples.\n \n Return num evenly spaced samples from start to stop. If endpoint=1 then\n last sample is stop. If retstep is 1 then return the step value used.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start \n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef fix(x):\n \"\"\" Round x to nearest integer towards zero.\n \"\"\"\n x = Numeric.asarray(x)\n y = Numeric.floor(x)\n return Numeric.where(x<0,y+1,y)\n\ndef mod(x,y):\n \"\"\" x - y*floor(x/y)\n \n For numeric arrays, x % y has the same sign as x while\n mod(x,y) has the same sign as y.\n \"\"\"\n return x - y*Numeric.floor(x*1.0/y)\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Returns an array comprised from different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n \n choicelist is a list of choice matrices (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0,...,cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0,...,vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n \n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n \n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n \n Note, that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"List of cases, must be same length as the list of conditions.\"\n choicelist.insert(0,default) \n S = 0\n pfac = 1\n for k in range(1,n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k]) \n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd)>> import scipy\n >>> a = array((0,0,0,1,2,3,2,1,0))\n >>> scipy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n if 'f' in trim or 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'b' in trim or 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\n__all__ = ['round','any','all','logspace','linspace','fix','mod',\n 'select','trim_zeros','amax','amin','ptp','cumsum',\n 'prod','cumprod','diff','angle','unwrap','sort_complex']\n\nround = Numeric.around\nany = Numeric.sometrue\nall = Numeric.alltrue\n\ndef logspace(start,stop,num=50,endpoint=1):\n \"\"\" Evenly spaced samples on a logarithmic scale.\n\n Return num evenly spaced samples from 10**start to 10**stop. If\n endpoint=1 then last sample is 10**stop.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start\n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n return Numeric.power(10.0,y)\n\ndef linspace(start,stop,num=50,endpoint=1,retstep=0):\n \"\"\" Evenly spaced samples.\n \n Return num evenly spaced samples from start to stop. If endpoint=1 then\n last sample is stop. If retstep is 1 then return the step value used.\n \"\"\"\n if endpoint:\n step = (stop-start)/float((num-1))\n y = Numeric.arange(0,num) * step + start \n else:\n step = (stop-start)/float(num)\n y = Numeric.arange(0,num) * step + start\n if retstep:\n return y, step\n else:\n return y\n\ndef fix(x):\n \"\"\" Round x to nearest integer towards zero.\n \"\"\"\n x = Numeric.asarray(x)\n y = Numeric.floor(x)\n return Numeric.where(x<0,y+1,y)\n\ndef mod(x,y):\n \"\"\" x - y*floor(x/y)\n \n For numeric arrays, x % y has the same sign as x while\n mod(x,y) has the same sign as y.\n \"\"\"\n return x - y*Numeric.floor(x*1.0/y)\n\ndef select(condlist, choicelist, default=0):\n \"\"\" Returns an array comprised from different elements of choicelist\n depending on the list of conditions.\n\n condlist is a list of condition arrays containing ones or zeros\n \n choicelist is a list of choice matrices (of the \"same\" size as the\n arrays in condlist). The result array has the \"same\" size as the\n arrays in choicelist. If condlist is [c0,...,cN-1] then choicelist\n must be of length N. The elements of the choicelist can then be\n represented as [v0,...,vN-1]. The default choice if none of the\n conditions are met is given as the default argument. \n \n The conditions are tested in order and the first one statisfied is\n used to select the choice. In other words, the elements of the\n output array are found from the following tree (notice the order of\n the conditions matters):\n \n if c0: v0\n elif c1: v1\n elif c2: v2\n ...\n elif cN-1: vN-1\n else: default\n \n Note, that one of the condition arrays must be large enough to handle\n the largest array in the choice list.\n \"\"\"\n n = len(condlist)\n n2 = len(choicelist)\n if n2 != n:\n raise ValueError, \"List of cases, must be same length as the list of conditions.\"\n choicelist.insert(0,default) \n S = 0\n pfac = 1\n for k in range(1,n+1):\n S += k * pfac * asarray(condlist[k-1])\n if k < n:\n pfac *= (1-asarray(condlist[k-1]))\n # handle special case of a 1-element condition but\n # a multi-element choice\n if type(S) in ScalarType or max(asarray(S).shape)==1:\n pfac = asarray(1)\n for k in range(n2+1):\n pfac = pfac + asarray(choicelist[k]) \n S = S*ones(asarray(pfac).shape)\n return choose(S, tuple(choicelist))\n\n# Basic operations\ndef amax(m,axis=-1):\n \"\"\"Returns the maximum of m along dimension axis. \n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return maximum.reduce(m,axis)\n\ndef amin(m,axis=-1):\n \"\"\"Returns the minimum of m along dimension axis.\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else: \n m = asarray(m)\n return minimum.reduce(m,axis)\n\n# Actually from Basis, but it fits in so naturally here...\n\ndef ptp(m,axis=-1):\n \"\"\"Returns the maximum - minimum along the the given dimension\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return amax(m,axis)-amin(m,axis)\n\ndef cumsum(m,axis=-1):\n \"\"\"Returns the cumulative sum of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return add.accumulate(m,axis)\n\ndef prod(m,axis=-1):\n \"\"\"Returns the product of the elements along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.reduce(m,axis)\n\ndef cumprod(m,axis=-1):\n \"\"\"Returns the cumulative product of the elments along the given axis\n \"\"\"\n if axis is None:\n m = ravel(m)\n axis = 0\n else:\n m = asarray(m)\n return multiply.accumulate(m,axis)\n\ndef diff(x, n=1,axis=-1):\n \"\"\"Calculates the nth order, discrete difference along given axis.\n \"\"\"\n x = asarray(x)\n nd = len(x.shape)\n slice1 = [slice(None)]*nd\n slice2 = [slice(None)]*nd\n slice1[axis] = slice(1,None)\n slice2[axis] = slice(None,-1)\n if n > 1:\n return diff(x[slice1]-x[slice2], n-1, axis=axis)\n else:\n return x[slice1]-x[slice2]\n\ndef angle(z,deg=0):\n \"\"\"Return the angle of complex argument z.\"\"\"\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if z.typecode() in ['D','F']:\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag,zreal) * fact\n\ndef unwrap(p,discont=pi,axis=-1):\n \"\"\"unwrap(p,discont=pi,axis=-1)\n\n unwraps radian phase p by changing absolute jumps greater than discont to\n their 2*pi complement along the given axis.\n \"\"\"\n p = asarray(p)\n nd = len(p.shape)\n dd = diff(p,axis=axis)\n slice1 = [slice(None,None)]*nd # full slices\n slice1[axis] = slice(1,None)\n ddmod = mod(dd+pi,2*pi)-pi\n putmask(ddmod,(ddmod==-pi) & (dd > 0),pi)\n ph_correct = ddmod - dd;\n putmask(ph_correct,abs(dd)>> import scipy\n >>> a = array((0,0,0,1,2,3,2,1,0))\n >>> scipy.trim_zeros(a)\n array([1, 2, 3, 2, 1])\n \"\"\"\n first = 0\n if 'f' in trim or 'F' in trim:\n for i in filt:\n if i != 0.: break\n else: first = first + 1\n last = len(filt)\n if 'b' in trim or 'B' in trim:\n for i in filt[::-1]:\n if i != 0.: break\n else: last = last - 1\n return filt[first:last]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n test()\n", + "methods": [ + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = 1 )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 88, + "parameters": [ + "start", + "stop", + "num", + "endpoint" + ], + "start_line": 16, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = 1 , retstep = 0 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 30, + "end_line": 45, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "fix", + "long_name": "fix( x )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "x" + ], + "start_line": 47, + "end_line": 52, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "mod", + "long_name": "mod( x , y )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x", + "y" + ], + "start_line": 54, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 62, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "amax", + "long_name": "amax( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 111, + "end_line": 119, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "amin", + "long_name": "amin( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 121, + "end_line": 129, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "ptp", + "long_name": "ptp( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "m", + "axis" + ], + "start_line": 133, + "end_line": 141, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumsum", + "long_name": "cumsum( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 143, + "end_line": 151, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "prod", + "long_name": "prod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 153, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumprod", + "long_name": "cumprod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 163, + "end_line": 171, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( x , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 2, + "token_count": 110, + "parameters": [ + "x", + "n", + "axis" + ], + "start_line": 173, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 71, + "parameters": [ + "z", + "deg" + ], + "start_line": 187, + "end_line": 200, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 146, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 202, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "sort_complex.complex_cmp", + "long_name": "sort_complex.complex_cmp( x , y )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 225, + "end_line": 229, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "a" + ], + "start_line": 221, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 9, + "token_count": 87, + "parameters": [ + "filt", + "trim" + ], + "start_line": 234, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 259, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 263, + "end_line": 265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "logspace", + "long_name": "logspace( start , stop , num = 50 , endpoint = 1 )", + "filename": "function_base.py", + "nloc": 8, + "complexity": 2, + "token_count": 88, + "parameters": [ + "start", + "stop", + "num", + "endpoint" + ], + "start_line": 14, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "linspace", + "long_name": "linspace( start , stop , num = 50 , endpoint = 1 , retstep = 0 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 3, + "token_count": 92, + "parameters": [ + "start", + "stop", + "num", + "endpoint", + "retstep" + ], + "start_line": 28, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "fix", + "long_name": "fix( x )", + "filename": "function_base.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "x" + ], + "start_line": 45, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "mod", + "long_name": "mod( x , y )", + "filename": "function_base.py", + "nloc": 2, + "complexity": 1, + "token_count": 25, + "parameters": [ + "x", + "y" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "select", + "long_name": "select( condlist , choicelist , default = 0 )", + "filename": "function_base.py", + "nloc": 18, + "complexity": 7, + "token_count": 165, + "parameters": [ + "condlist", + "choicelist", + "default" + ], + "start_line": 60, + "end_line": 106, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 47, + "top_nesting_level": 0 + }, + { + "name": "amax", + "long_name": "amax( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 109, + "end_line": 117, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "amin", + "long_name": "amin( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 119, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "ptp", + "long_name": "ptp( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 47, + "parameters": [ + "m", + "axis" + ], + "start_line": 131, + "end_line": 139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumsum", + "long_name": "cumsum( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 141, + "end_line": 149, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "prod", + "long_name": "prod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 151, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "cumprod", + "long_name": "cumprod( m , axis = - 1 )", + "filename": "function_base.py", + "nloc": 7, + "complexity": 2, + "token_count": 42, + "parameters": [ + "m", + "axis" + ], + "start_line": 161, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "diff", + "long_name": "diff( x , n = 1 , axis = - 1 )", + "filename": "function_base.py", + "nloc": 11, + "complexity": 2, + "token_count": 110, + "parameters": [ + "x", + "n", + "axis" + ], + "start_line": 171, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "angle", + "long_name": "angle( z , deg = 0 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 3, + "token_count": 71, + "parameters": [ + "z", + "deg" + ], + "start_line": 185, + "end_line": 198, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 0 + }, + { + "name": "unwrap", + "long_name": "unwrap( p , discont = pi , axis = - 1 )", + "filename": "function_base.py", + "nloc": 13, + "complexity": 1, + "token_count": 146, + "parameters": [ + "p", + "discont", + "axis" + ], + "start_line": 200, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "sort_complex.complex_cmp", + "long_name": "sort_complex.complex_cmp( x , y )", + "filename": "function_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "x", + "y" + ], + "start_line": 223, + "end_line": 227, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "sort_complex", + "long_name": "sort_complex( a )", + "filename": "function_base.py", + "nloc": 6, + "complexity": 1, + "token_count": 44, + "parameters": [ + "a" + ], + "start_line": 219, + "end_line": 230, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "trim_zeros", + "long_name": "trim_zeros( filt , trim = 'fb' )", + "filename": "function_base.py", + "nloc": 12, + "complexity": 9, + "token_count": 87, + "parameters": [ + "filt", + "trim" + ], + "start_line": 232, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 257, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "function_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 261, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 163, + "complexity": 46, + "token_count": 1306, + "diff_parsed": { + "added": [ + "from scipy_base.fastumath import *", + "from type_check import ScalarType", + "" + ], + "deleted": [ + "from fastumath import *" + ] + } + }, + { + "old_path": "scipy_base/limits.py", + "new_path": "scipy_base/limits.py", + "filename": "limits.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,8 +7,8 @@\n \"\"\"\n \n import Numeric\n-import fastumath\n-reload(fastumath)\n+import scipy_base.fastumath\n+reload(scipy_base.fastumath)\n from type_check import toFloat32, toFloat64\n \n __all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nimport scipy_base.fastumath\nreload(scipy_base.fastumath)\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "\"\"\" This really needs some work...\n\n Calculate machine limits for Float32 and Float64.\n Actually, max and min are hard coded - and wrong!\n They are close, however.\n\n\"\"\"\n\nimport Numeric\nimport fastumath\nreload(fastumath)\nfrom type_check import toFloat32, toFloat64\n\n__all__ = ['epsilon','tiny','float_epsilon','float_tiny','float_min',\n 'float_max','float_precision','float_resolution',\n 'double_epsilon','double_tiny','double_min','double_max',\n 'double_precision','double_resolution']\n\n\ndef epsilon(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n elif typecode == Numeric.Float64: cast = toFloat64\n one = cast(1.0)\n x = cast(1.0)\n while one+x > one:\n x = x * cast(.5)\n x = x * cast(2.0)\n return x\n\ndef tiny(typecode):\n if typecode == Numeric.Float32: cast = toFloat32\n if typecode == Numeric.Float64: cast = toFloat64\n zero = cast(0.0)\n d1 = cast(1.0)\n d2 = cast(1.0)\n while d1 > zero:\n d2 = d1\n d1 = d1 * cast(.5)\n return d2\n\n \n\nfloat_epsilon = epsilon(Numeric.Float32)\nfloat_tiny = tiny(Numeric.Float32)\n#not correct\nfloat_min = -3.402823e38\nfloat_max = 3.402823e38\nfloat_precision = 6\nfloat_resolution = 10.0**(-float_precision)\n\n# hard coded - taken from Norbert's Fortran code.\n# INTEGER, PARAMETER :: kind_DBLE = KIND(0D0) ! 8 (HP-UX)\n# INTEGER, PARAMETER :: prec_DBLE = PRECISION(0D0) ! 15\n# INTEGER, PARAMETER :: range_DBLE = RANGE(0D0) ! 307\n# REAL(kind_DBLE), PARAMETER :: eps_DBLE = EPSILON(0D0) ! 2.22e-16\n# REAL(kind_DBLE), PARAMETER :: tiny_DBLE = TINY(0D0) ! 2.23e-308\n# REAL(kind_DBLE), PARAMETER :: huge_DBLE = HUGE(0D0) ! 1.80e+308\ndouble_epsilon = epsilon(Numeric.Float64)\ndouble_tiny = tiny(Numeric.Float64)\n\n# not quite right...\ndouble_min = -1.797683134862318e308\ndouble_max = 1.797683134862318e308\ndouble_precision = 15\ndouble_resolution = 10.0**(-double_precision)\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 20, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 30, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 71, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "epsilon", + "long_name": "epsilon( typecode )", + "filename": "limits.py", + "nloc": 9, + "complexity": 4, + "token_count": 69, + "parameters": [ + "typecode" + ], + "start_line": 20, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "tiny", + "long_name": "tiny( typecode )", + "filename": "limits.py", + "nloc": 10, + "complexity": 4, + "token_count": 68, + "parameters": [ + "typecode" + ], + "start_line": 30, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 67, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "limits.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 71, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 57, + "complexity": 10, + "token_count": 339, + "diff_parsed": { + "added": [ + "import scipy_base.fastumath", + "reload(scipy_base.fastumath)" + ], + "deleted": [ + "import fastumath", + "reload(fastumath)" + ] + } + }, + { + "old_path": "scipy_base/matrix_base.py", + "new_path": "scipy_base/matrix_base.py", + "filename": "matrix_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,7 +7,7 @@\n # These are from Numeric\n import Matrix\n from Numeric import *\n-from fastumath import *\n+from scipy_base.fastumath import *\n from type_check import isscalar\n from index_tricks import mgrid,r_,c_\n # Elementary matrices\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\" Basic functions for manipulating 2d arrays\n\n\"\"\"\n\n__all__ = ['diag','eye','fliplr','flipud','rot90']\n \n# These are from Numeric\nimport Matrix\nfrom Numeric import *\nfrom scipy_base.fastumath import *\nfrom type_check import isscalar\nfrom index_tricks import mgrid,r_,c_\n# Elementary matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n \ndef fliplr(m):\n \"\"\" returns a 2-D matrix m with the rows preserved and columns flipped \n in the left/right direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\" returns a 2-D matrix with the columns preserved and rows flipped in\n the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\" returns the matrix found by rotating m by k*90 degrees in the \n counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n \ndef eye(N, M=None, k=0, typecode=None):\n \"\"\" eye returns a N-by-M matrix where the k-th diagonal is all ones, \n and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef diag(v, k=0):\n \"\"\" returns the k-th diagonal if v is a matrix or returns a matrix \n with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "\"\"\" Basic functions for manipulating 2d arrays\n\n\"\"\"\n\n__all__ = ['diag','eye','fliplr','flipud','rot90']\n \n# These are from Numeric\nimport Matrix\nfrom Numeric import *\nfrom fastumath import *\nfrom type_check import isscalar\nfrom index_tricks import mgrid,r_,c_\n# Elementary matrices\n\n# zeros is from matrixmodule in C\n# ones is from Numeric.py\n\n \ndef fliplr(m):\n \"\"\" returns a 2-D matrix m with the rows preserved and columns flipped \n in the left/right direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[:, ::-1]\n\ndef flipud(m):\n \"\"\" returns a 2-D matrix with the columns preserved and rows flipped in\n the up/down direction. Only works with 2-D arrays.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n return m[::-1]\n \n# reshape(x, m, n) is not used, instead use reshape(x, (m, n))\n\ndef rot90(m, k=1):\n \"\"\" returns the matrix found by rotating m by k*90 degrees in the \n counterclockwise direction.\n \"\"\"\n m = asarray(m)\n if len(m.shape) != 2:\n raise ValueError, \"Input must be 2-D.\"\n k = k % 4\n if k == 0: return m\n elif k == 1: return transpose(fliplr(m))\n elif k == 2: return fliplr(flipud(m))\n else: return fliplr(transpose(m)) # k==3\n \ndef eye(N, M=None, k=0, typecode=None):\n \"\"\" eye returns a N-by-M matrix where the k-th diagonal is all ones, \n and everything else is zeros.\n \"\"\"\n if M is None: M = N\n if type(M) == type('d'): \n typecode = M\n M = N\n m = equal(subtract.outer(arange(N), arange(M)),-k)\n if typecode is None:\n return m\n else:\n return m.astype(typecode)\n\ndef diag(v, k=0):\n \"\"\" returns the k-th diagonal if v is a matrix or returns a matrix \n with v as the k-th diagonal if v is a vector.\n \"\"\"\n v = asarray(v)\n s = v.shape\n if len(s)==1:\n n = s[0]+abs(k)\n if k > 0:\n v = concatenate((zeros(k, v.typecode()),v))\n elif k < 0:\n v = concatenate((v,zeros(-k, v.typecode())))\n return eye(n, k=k)*v\n elif len(s)==2:\n v = add.reduce(eye(s[0], s[1], k=k)*v)\n if k > 0: return v[k:]\n elif k < 0: return v[:k]\n else: return v\n else:\n raise ValueError, \"Input must be 1- or 2-D.\"\n\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "fliplr", + "long_name": "fliplr( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "m" + ], + "start_line": 19, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "flipud", + "long_name": "flipud( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 28, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "rot90", + "long_name": "rot90( m , k = 1 )", + "filename": "matrix_base.py", + "nloc": 9, + "complexity": 5, + "token_count": 78, + "parameters": [ + "m", + "k" + ], + "start_line": 39, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "eye", + "long_name": "eye( N , M = None , k = 0 , typecode = None )", + "filename": "matrix_base.py", + "nloc": 10, + "complexity": 4, + "token_count": 81, + "parameters": [ + "N", + "M", + "k", + "typecode" + ], + "start_line": 52, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "diag", + "long_name": "diag( v , k = 0 )", + "filename": "matrix_base.py", + "nloc": 17, + "complexity": 7, + "token_count": 165, + "parameters": [ + "v", + "k" + ], + "start_line": 66, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 96, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "fliplr", + "long_name": "fliplr( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "m" + ], + "start_line": 19, + "end_line": 26, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "flipud", + "long_name": "flipud( m )", + "filename": "matrix_base.py", + "nloc": 5, + "complexity": 2, + "token_count": 33, + "parameters": [ + "m" + ], + "start_line": 28, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "rot90", + "long_name": "rot90( m , k = 1 )", + "filename": "matrix_base.py", + "nloc": 9, + "complexity": 5, + "token_count": 78, + "parameters": [ + "m", + "k" + ], + "start_line": 39, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "eye", + "long_name": "eye( N , M = None , k = 0 , typecode = None )", + "filename": "matrix_base.py", + "nloc": 10, + "complexity": 4, + "token_count": 81, + "parameters": [ + "N", + "M", + "k", + "typecode" + ], + "start_line": 52, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "diag", + "long_name": "diag( v , k = 0 )", + "filename": "matrix_base.py", + "nloc": 17, + "complexity": 7, + "token_count": 165, + "parameters": [ + "v", + "k" + ], + "start_line": 66, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 92, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "matrix_base.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 96, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 66, + "complexity": 22, + "token_count": 505, + "diff_parsed": { + "added": [ + "from scipy_base.fastumath import *" + ], + "deleted": [ + "from fastumath import *" + ] + } + }, + { + "old_path": "scipy_base/scimath.py", + "new_path": "scipy_base/scimath.py", + "filename": "scimath.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -7,10 +7,10 @@\n \n from type_check import isreal\n from function_base import any\n-import fastumath\n+import scipy_base.fastumath\n import Numeric\n-from fastumath import *\n-toextend = fastumath.__dict__.keys()\n+from scipy_base.fastumath import *\n+toextend = scipy_base.fastumath.__dict__.keys()\n for key in toextend:\n if key not in __all__ and key[0] != '_':\n __all__.append(key)\n@@ -25,19 +25,19 @@ def sqrt(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n- return fastumath.sqrt(x)\n+ return scipy_base.fastumath.sqrt(x)\n \n def log(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n- return fastumath.log(x)\n+ return scipy_base.fastumath.log(x)\n \n def log10(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n- return fastumath.log10(x) \n+ return scipy_base.fastumath.log10(x) \n \n def logn(n,x):\n \"\"\" Take log base n of x.\n@@ -47,7 +47,7 @@ def logn(n,x):\n x = _tocomplex(x)\n if isreal(n) and (n<0):\n n = _tocomplex(n)\n- return fastumath.log(x)/fastumath.log(n)\n+ return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(n)\n \n def log2(x):\n \"\"\" Take log base 2 of x.\n@@ -55,31 +55,31 @@ def log2(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n- return fastumath.log(x)/fastumath.log(2)\n+ return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(2)\n \n \n def power(x, p):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n- return fastumath.power(x, p)\n+ return scipy_base.fastumath.power(x, p)\n \n def arccos(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n- return fastumath.arccos(x)\n+ return scipy_base.fastumath.arccos(x)\n \n def arcsin(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n- return fastumath.arcsin(x)\n+ return scipy_base.fastumath.arcsin(x)\n \n def arctanh(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n- return fastumath.arctanh(x)\n+ return scipy_base.fastumath.arctanh(x)\n \n \n", + "added_lines": 12, + "deleted_lines": 12, + "source_code": "\"\"\"\nWrapper functions to more user-friendly calling of certain math functions whose output is\ndifferent than the input under certain conditions.\n\"\"\"\n\n__all__ = ['sqrt', 'log', 'log2','logn','log10', 'power', 'arccos', 'arcsin', 'arctanh']\n\nfrom type_check import isreal\nfrom function_base import any\nimport scipy_base.fastumath\nimport Numeric\nfrom scipy_base.fastumath import *\ntoextend = scipy_base.fastumath.__dict__.keys()\nfor key in toextend:\n if key not in __all__ and key[0] != '_':\n __all__.append(key)\n\ndef _tocomplex(arr):\n if arr.typecode() in ['f', 's', 'b', '1']:\n return arr.astype('F')\n else:\n return arr.astype('D')\n\ndef sqrt(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return scipy_base.fastumath.sqrt(x)\n\ndef log(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return scipy_base.fastumath.log(x)\n\ndef log10(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return scipy_base.fastumath.log10(x) \n\ndef logn(n,x):\n \"\"\" Take log base n of x.\n \"\"\"\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n if isreal(n) and (n<0):\n n = _tocomplex(n)\n return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(n)\n\ndef log2(x):\n \"\"\" Take log base 2 of x.\n \"\"\"\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(2)\n\n\ndef power(x, p):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return scipy_base.fastumath.power(x, p)\n \ndef arccos(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return scipy_base.fastumath.arccos(x)\n\ndef arcsin(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return scipy_base.fastumath.arcsin(x)\n\ndef arctanh(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return scipy_base.fastumath.arctanh(x)\n\n\n", + "source_code_before": "\"\"\"\nWrapper functions to more user-friendly calling of certain math functions whose output is\ndifferent than the input under certain conditions.\n\"\"\"\n\n__all__ = ['sqrt', 'log', 'log2','logn','log10', 'power', 'arccos', 'arcsin', 'arctanh']\n\nfrom type_check import isreal\nfrom function_base import any\nimport fastumath\nimport Numeric\nfrom fastumath import *\ntoextend = fastumath.__dict__.keys()\nfor key in toextend:\n if key not in __all__ and key[0] != '_':\n __all__.append(key)\n\ndef _tocomplex(arr):\n if arr.typecode() in ['f', 's', 'b', '1']:\n return arr.astype('F')\n else:\n return arr.astype('D')\n\ndef sqrt(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return fastumath.sqrt(x)\n\ndef log(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return fastumath.log(x)\n\ndef log10(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return fastumath.log10(x) \n\ndef logn(n,x):\n \"\"\" Take log base n of x.\n \"\"\"\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n if isreal(n) and (n<0):\n n = _tocomplex(n)\n return fastumath.log(x)/fastumath.log(n)\n\ndef log2(x):\n \"\"\" Take log base 2 of x.\n \"\"\"\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return fastumath.log(x)/fastumath.log(2)\n\n\ndef power(x, p):\n x = Numeric.asarray(x)\n if isreal(x) and any(x<0):\n x = _tocomplex(x)\n return fastumath.power(x, p)\n \ndef arccos(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return fastumath.arccos(x)\n\ndef arcsin(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return fastumath.arcsin(x)\n\ndef arctanh(x):\n x = Numeric.asarray(x)\n if isreal(x) and any(abs(x)>1):\n x = _tocomplex(x)\n return fastumath.arctanh(x)\n\n\n", + "methods": [ + { + "name": "_tocomplex", + "long_name": "_tocomplex( arr )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "arr" + ], + "start_line": 18, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "sqrt", + "long_name": "sqrt( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log", + "long_name": "log( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log10", + "long_name": "log10( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 36, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "logn", + "long_name": "logn( n , x )", + "filename": "scimath.py", + "nloc": 7, + "complexity": 5, + "token_count": 71, + "parameters": [ + "n", + "x" + ], + "start_line": 42, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "log2", + "long_name": "log2( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( x , p )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "x", + "p" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arccos", + "long_name": "arccos( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arcsin", + "long_name": "arcsin( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arctanh", + "long_name": "arctanh( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 79, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_tocomplex", + "long_name": "_tocomplex( arr )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 2, + "token_count": 38, + "parameters": [ + "arr" + ], + "start_line": 18, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "sqrt", + "long_name": "sqrt( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 39, + "parameters": [ + "x" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log", + "long_name": "log( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 39, + "parameters": [ + "x" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log10", + "long_name": "log10( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 39, + "parameters": [ + "x" + ], + "start_line": 36, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "logn", + "long_name": "logn( n , x )", + "filename": "scimath.py", + "nloc": 7, + "complexity": 5, + "token_count": 67, + "parameters": [ + "n", + "x" + ], + "start_line": 42, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + }, + { + "name": "log2", + "long_name": "log2( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 47, + "parameters": [ + "x" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( x , p )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 43, + "parameters": [ + "x", + "p" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arccos", + "long_name": "arccos( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arcsin", + "long_name": "arcsin( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arctanh", + "long_name": "arctanh( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 42, + "parameters": [ + "x" + ], + "start_line": 79, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "arccos", + "long_name": "arccos( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 67, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "power", + "long_name": "power( x , p )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 45, + "parameters": [ + "x", + "p" + ], + "start_line": 61, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log2", + "long_name": "log2( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 51, + "parameters": [ + "x" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "arcsin", + "long_name": "arcsin( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 73, + "end_line": 77, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "arctanh", + "long_name": "arctanh( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 44, + "parameters": [ + "x" + ], + "start_line": 79, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log10", + "long_name": "log10( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 36, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "log", + "long_name": "log( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 30, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "sqrt", + "long_name": "sqrt( x )", + "filename": "scimath.py", + "nloc": 5, + "complexity": 3, + "token_count": 41, + "parameters": [ + "x" + ], + "start_line": 24, + "end_line": 28, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "logn", + "long_name": "logn( n , x )", + "filename": "scimath.py", + "nloc": 7, + "complexity": 5, + "token_count": 71, + "parameters": [ + "n", + "x" + ], + "start_line": 42, + "end_line": 50, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 0 + } + ], + "nloc": 66, + "complexity": 31, + "token_count": 547, + "diff_parsed": { + "added": [ + "import scipy_base.fastumath", + "from scipy_base.fastumath import *", + "toextend = scipy_base.fastumath.__dict__.keys()", + " return scipy_base.fastumath.sqrt(x)", + " return scipy_base.fastumath.log(x)", + " return scipy_base.fastumath.log10(x)", + " return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(n)", + " return scipy_base.fastumath.log(x)/scipy_base.fastumath.log(2)", + " return scipy_base.fastumath.power(x, p)", + " return scipy_base.fastumath.arccos(x)", + " return scipy_base.fastumath.arcsin(x)", + " return scipy_base.fastumath.arctanh(x)" + ], + "deleted": [ + "import fastumath", + "from fastumath import *", + "toextend = fastumath.__dict__.keys()", + " return fastumath.sqrt(x)", + " return fastumath.log(x)", + " return fastumath.log10(x)", + " return fastumath.log(x)/fastumath.log(n)", + " return fastumath.log(x)/fastumath.log(2)", + " return fastumath.power(x, p)", + " return fastumath.arccos(x)", + " return fastumath.arcsin(x)", + " return fastumath.arctanh(x)" + ] + } + }, + { + "old_path": "scipy_base/setup_scipy_base.py", + "new_path": "scipy_base/setup_scipy_base.py", + "filename": "setup_scipy_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -20,8 +20,8 @@ def configuration(parent_package=''):\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n \n- # fastumath module\n- sources = ['fastumathmodule.c','isnan.c']\n+ # scipy_base.fastumath module\n+ sources = ['scipy_base.fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "#!/usr/bin/env python\n\nimport os, sys\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\nimport shutil\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # scipy_base.fastumath module\n sources = ['scipy_base.fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n\n # Test to see if big or little-endian machine and get correct default\n # mconf.h module.\n if sys.byteorder == \"little\":\n print \"### Little Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n else:\n print \"### Big Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "source_code_before": "#!/usr/bin/env python\n\nimport os, sys\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\nimport shutil\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # fastumath module\n sources = ['fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n\n # Test to see if big or little-endian machine and get correct default\n # mconf.h module.\n if sys.byteorder == \"little\":\n print \"### Little Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n else:\n print \"### Big Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "nloc": 30, + "complexity": 4, + "token_count": 243, + "diff_parsed": { + "added": [ + " # scipy_base.fastumath module", + " sources = ['scipy_base.fastumathmodule.c','isnan.c']" + ], + "deleted": [ + " # fastumath module", + " sources = ['fastumathmodule.c','isnan.c']" + ] + } + }, + { + "old_path": "scipy_base/testing.py", + "new_path": "scipy_base/testing.py", + "filename": "testing.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -289,7 +289,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1):\n try:\n # Numeric specific testss\n from Numeric import *\n- from fastumath import *\n+ from scipy_base.fastumath import *\n \n def assert_array_equal(x,y,err_msg=''):\n msg = '\\nArrays are not equal'\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import os,sys,time\nimport unittest\n\nclass ScipyTestCase (unittest.TestCase):\n\n def measure(self,code_str,times=1):\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n 'ScipyTestCase runner for '+self.__class__.__name__,\n 'exec')\n i = 0\n elapsed = time.time()\n while i 0)\n \ndef isneginf(val):\n return isinf(val) & (val < 0)\n \n##def isinf(val):\n## return Numeric.logical_or(isposinf(val),isneginf(val))\n\n##def isfinite(val):\n## vals = asarray(val)\n## if iscomplexobj(vals):\n## r = isfinite(real(vals))\n## i = isfinite(imag(vals))\n## results = Numeric.logical_and(r,i)\n## else: \n## fin = Numeric.logical_not(isinf(val))\n## an = Numeric.logical_not(isnan(val))\n## results = Numeric.logical_and(fin,an)\n## return results \n\ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "source_code_before": "import types\nimport Numeric\nfrom Numeric import *\nfrom fastumath import *\n\nimport limits\n\n__all__ = ['ScalarType','iscomplexobj','isrealobj','imag','iscomplex',\n 'isscalar','isneginf','isposinf','isnan','isinf','isfinite',\n 'isreal','isscalar','nan_to_num','real','real_if_close',\n 'typename','cast']\n\nScalarType = [types.IntType, types.LongType, types.FloatType, types.ComplexType]\n\ntry:\n Char = Numeric.Character\nexcept AttributeError:\n Char = 'c'\n\ntoChar = lambda x: Numeric.array(x, Char)\ntoInt8 = lambda x: Numeric.array(x, Numeric.Int8)# or use variable names such as Byte\ntoInt16 = lambda x: Numeric.array(x, Numeric.Int16)\ntoInt32 = lambda x: Numeric.array(x, Numeric.Int32)\ntoInt = lambda x: Numeric.array(x, Numeric.Int)\ntoFloat32 = lambda x: Numeric.array(x, Numeric.Float32)\ntoFloat64 = lambda x: Numeric.array(x, Numeric.Float64)\ntoComplex32 = lambda x: Numeric.array(x, Numeric.Complex32)\ntoComplex64 = lambda x: Numeric.array(x, Numeric.Complex64)\n\n# This is for pre Numeric 21.x compatiblity. Adding it is harmless.\nif not hasattr(Numeric,'Character'):\n Numeric.Character = 'c'\n \ncast = {Numeric.Character: toChar,\n Numeric.Int8: toInt8,\n Numeric.Int16: toInt16,\n Numeric.Int32: toInt32,\n Numeric.Int: toInt,\n Numeric.Float32: toFloat32,\n Numeric.Float64: toFloat64,\n Numeric.Complex32: toComplex32,\n Numeric.Complex64: toComplex64}\n\ndef isscalar(num):\n if isinstance(num, ArrayType):\n return len(num.shape) == 0 and num.typecode() != 'O'\n return type(num) in ScalarType\n\ndef real(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.real\n else:\n return aval\n\ndef imag(val):\n aval = asarray(val)\n if aval.typecode() in ['F', 'D']:\n return aval.imag\n else:\n return array(0,aval.typecode())*aval\n\ndef iscomplex(x):\n return imag(x) != Numeric.zeros(asarray(x).shape)\n\ndef isreal(x):\n return imag(x) == Numeric.zeros(asarray(x).shape)\n\ndef iscomplexobj(x):\n return asarray(x).typecode() in ['F', 'D']\n\ndef isrealobj(x):\n return not asarray(x).typecode() in ['F', 'D']\n\n#-----------------------------------------------------------------------------\n\n##def isnan(val):\n## # fast, but apparently not portable (according to notes by Tim Peters)\n## #return val != val\n## # very slow -- should really use cephes methods or *something* different\n## import ieee_754\n## vals = ravel(val)\n## if array_iscomplex(vals):\n## r = array(map(ieee_754.isnan,real(vals))) \n## i = array(map(ieee_754.isnan,imag(vals)))\n## results = Numeric.logical_or(r,i)\n## else: \n## results = array(map(ieee_754.isnan,vals))\n## if isscalar(val):\n## results = results[0]\n## return results\n\ndef isposinf(val):\n return isinf(val) & (val > 0)\n \ndef isneginf(val):\n return isinf(val) & (val < 0)\n \n##def isinf(val):\n## return Numeric.logical_or(isposinf(val),isneginf(val))\n\n##def isfinite(val):\n## vals = asarray(val)\n## if iscomplexobj(vals):\n## r = isfinite(real(vals))\n## i = isfinite(imag(vals))\n## results = Numeric.logical_and(r,i)\n## else: \n## fin = Numeric.logical_not(isinf(val))\n## an = Numeric.logical_not(isnan(val))\n## results = Numeric.logical_and(fin,an)\n## return results \n\ndef nan_to_num(x):\n # mapping:\n # NaN -> 0\n # Inf -> limits.double_max\n # -Inf -> limits.double_min\n # complex not handled currently\n import limits\n try:\n t = x.typecode()\n except AttributeError:\n t = type(x)\n if t in [types.ComplexType,'F','D']: \n y = nan_to_num(x.real) + 1j * nan_to_num(x.imag)\n else: \n x = Numeric.asarray(x)\n are_inf = isposinf(x)\n are_neg_inf = isneginf(x)\n are_nan = isnan(x)\n choose_array = are_neg_inf + are_nan * 2 + are_inf * 3\n y = Numeric.choose(choose_array,\n (x,limits.double_min, 0., limits.double_max))\n return y\n\n#-----------------------------------------------------------------------------\n\ndef real_if_close(a,tol=1e-13):\n a = Numeric.asarray(a)\n if a.typecode() in ['F','D'] and Numeric.allclose(a.imag, 0, atol=tol):\n a = a.real\n return a\n\n\n#-----------------------------------------------------------------------------\n\n_namefromtype = {'c' : 'character',\n '1' : 'signed char',\n 'b' : 'unsigned char',\n 's' : 'short',\n 'i' : 'integer',\n 'l' : 'long integer',\n 'f' : 'float',\n 'd' : 'double',\n 'F' : 'complex float',\n 'D' : 'complex double',\n 'O' : 'object'\n }\n\ndef typename(char):\n \"\"\"Return an english name for the given typecode character.\n \"\"\"\n return _namefromtype[char]\n\n#-----------------------------------------------------------------------------\n\n#determine the \"minimum common type code\" for a group of arrays.\narray_kind = {'i':0, 'l': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1}\narray_precision = {'i': 1, 'l': 1, 'f': 0, 'd': 1, 'F': 0, 'D': 1}\narray_type = [['f', 'd'], ['F', 'D']]\ndef common_type(*arrays):\n kind = 0\n precision = 0\n for a in arrays:\n t = a.typecode()\n kind = max(kind, array_kind[t])\n precision = max(precision, array_precision[t])\n return array_type[kind][precision]\n\n#-----------------------------------------------------------------------------\n# Test Routines\n#-----------------------------------------------------------------------------\n\ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\nif __name__ == '__main__':\n print 'float epsilon:',float_epsilon\n print 'float tiny:',float_tiny\n print 'double epsilon:',double_epsilon\n print 'double tiny:',double_tiny\n", + "methods": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 114, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 139, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 161, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 172, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 189, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "isscalar", + "long_name": "isscalar( num )", + "filename": "type_check.py", + "nloc": 4, + "complexity": 3, + "token_count": 37, + "parameters": [ + "num" + ], + "start_line": 44, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "real", + "long_name": "real( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 32, + "parameters": [ + "val" + ], + "start_line": 49, + "end_line": 54, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "imag", + "long_name": "imag( val )", + "filename": "type_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 43, + "parameters": [ + "val" + ], + "start_line": 56, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "iscomplex", + "long_name": "iscomplex( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 63, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isreal", + "long_name": "isreal( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "x" + ], + "start_line": 66, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "iscomplexobj", + "long_name": "iscomplexobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "x" + ], + "start_line": 69, + "end_line": 70, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isrealobj", + "long_name": "isrealobj( x )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 21, + "parameters": [ + "x" + ], + "start_line": 72, + "end_line": 73, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isposinf", + "long_name": "isposinf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 93, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "isneginf", + "long_name": "isneginf( val )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "val" + ], + "start_line": 96, + "end_line": 97, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "nan_to_num", + "long_name": "nan_to_num( x )", + "filename": "type_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 119, + "parameters": [ + "x" + ], + "start_line": 114, + "end_line": 135, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "real_if_close", + "long_name": "real_if_close( a , tol = 1e - 13 )", + "filename": "type_check.py", + "nloc": 5, + "complexity": 3, + "token_count": 54, + "parameters": [ + "a", + "tol" + ], + "start_line": 139, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "typename", + "long_name": "typename( char )", + "filename": "type_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "char" + ], + "start_line": 161, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "common_type", + "long_name": "common_type( * arrays )", + "filename": "type_check.py", + "nloc": 8, + "complexity": 2, + "token_count": 54, + "parameters": [ + "arrays" + ], + "start_line": 172, + "end_line": 179, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 185, + "end_line": 187, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "type_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 189, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 120, + "complexity": 24, + "token_count": 957, + "diff_parsed": { + "added": [ + "from scipy_base.fastumath import *" + ], + "deleted": [ + "from fastumath import *" + ] + } + }, + { + "old_path": "scipy_test/scipy_test.py", + "new_path": "scipy_test/scipy_test.py", + "filename": "scipy_test.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -290,7 +290,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1):\n try:\n # Numeric specific testss\n from Numeric import *\n- from fastumath import *\n+ from scipy_base.fastumath import *\n \n def assert_array_equal(x,y,err_msg=''):\n msg = '\\nArrays are not equal'\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\nimport os,sys,time\nimport unittest\n\nclass ScipyTestCase (unittest.TestCase):\n\n def measure(self,code_str,times=1):\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n 'ScipyTestCase runner for '+self.__class__.__name__,\n 'exec')\n i = 0\n elapsed = time.time()\n while i Ny:\n return asarray(x), concatenate((front,y))\n elif Ny > Nx:\n return concatenate((front,x)),asarray(y) \n\ndef binary_op_size(xx,yy):\n \"\"\" This returns the resulting size from operating on xx, and yy\n with a binary operator. It accounts for broadcasting, and\n throws errors if the array sizes are incompatible.\n \"\"\"\n x,y = make_same_length(xx,yy)\n res = zeros(len(x))\n for i in range(len(x)):\n if x[i] == y[i]:\n res[i] = x[i]\n elif x[i] == 1:\n res[i] = y[i]\n elif y[i] == 1:\n res[i] = x[i]\n else:\n # offer more information here about which variables.\n raise ValueError, \"frames are not aligned\"\n return res \nclass dummy_array:\n def __init__(self,ary,ary_is_shape = 0,name=None):\n self.name = name\n if ary_is_shape:\n self.shape = ary\n #self.shape = asarray(ary)\n else:\n try:\n self.shape = shape(ary)\n except:\n self.shape = empty\n #self.value = ary \n def binary_op(self,other):\n try: \n x = other.shape\n except AttributeError:\n x = empty \n new_shape = binary_op_size(self.shape,x)\n return dummy_array(new_shape,1)\n def __cmp__(self,other):\n # This isn't an exact compare, but does work for == \n # cluge for Numeric\n if type(other) in [IntType,LongType,FloatType,ComplexType]:\n return 0\n if len(self.shape) == len(other.shape) == 0:\n return 0\n return not alltrue(equal(self.shape,other.shape))\n\n def __add__(self,other): return self.binary_op(other)\n def __radd__(self,other): return self.binary_op(other)\n def __sub__(self,other): return self.binary_op(other)\n def __rsub__(self,other): return self.binary_op(other)\n def __mul__(self,other): return self.binary_op(other)\n def __rmul__(self,other): return self.binary_op(other)\n def __div__(self,other): return self.binary_op(other)\n def __rdiv__(self,other): return self.binary_op(other)\n def __mod__(self,other): return self.binary_op(other)\n def __rmod__(self,other): return self.binary_op(other)\n def __lshift__(self,other): return self.binary_op(other)\n def __rshift__(self,other): return self.binary_op(other)\n # unary ops\n def __neg__(self,other): return self\n def __pos__(self,other): return self\n def __abs__(self,other): return self\n def __invert__(self,other): return self \n # Not sure what to do with coersion ops. Ignore for now.\n #\n # not currently supported by compiler.\n # __divmod__\n # __pow__\n # __rpow__\n # __and__\n # __or__\n # __xor__\n # item access and slicing \n def __setitem__(self,indices,val):\n #ignore for now\n pass\n def __len__(self):\n return self.shape[0]\n def __getslice__(self,i,j):\n # enabling the following would make class compatible with\n # lists. Its current incarnation is compatible with arrays.\n # Both this and Numeric should have this FIXED to correspond\n # to lists.\n #i = max(i, 0); j = max(j, 0)\n return self.__getitem__((slice(i,j),))\n def __getitem__(self,indices):\n # ayeyaya this is a mess\n #print indices, type(indices), indices.shape \n if type(indices) is not TupleType:\n indices = (indices,)\n if Ellipsis in indices:\n raise IndexError, \"Ellipsis not currently supported\"\n new_dims = [] \n dim = 0 \n for index in indices:\n try:\n dim_len = self.shape[dim]\n except IndexError:\n raise IndexError, \"To many indices specified\"\n \n #if (type(index) is SliceType and index.start == index.stop == index.step):\n if (index is empty_slice):\n slc_len = dim_len\n elif type(index) is SliceType:\n beg,end,step = index.start,index.stop,index.step \n # handle if they are dummy arrays\n #if hasattr(beg,'value') and type(beg.value) != ArrayType:\n # beg = beg.value\n #if hasattr(end,'value') and type(end.value) != ArrayType:\n # end = end.value\n #if hasattr(step,'value') and type(step.value) != ArrayType:\n # step = step.value \n if beg is None: beg = 0\n if end == sys.maxint or end is None:\n end = dim_len\n if step is None: \n step = 1\n \n if beg < 0: beg += dim_len\n if end < 0: end += dim_len\n # the following is list like behavior,\n # which isn't adhered to by arrays. \n # FIX THIS ANOMOLY IN NUMERIC!\n if beg < 0: beg = 0\n if beg > dim_len: beg = dim_len\n if end < 0: end = 0\n if end > dim_len: end = dim_len\n # This is rubbish. \n if beg == end:\n beg,end,step = 0,0,1\n elif beg >= dim_len and step > 0:\n beg,end,step = 0,0,1\n #elif index.step > 0 and beg <= end:\n elif step > 0 and beg <= end:\n pass #slc_len = abs(divide(end-beg-1,step)+1) \n # handle [::-1] and [-1::-1] correctly \n #elif index.step > 0 and beg > end:\n elif step > 0 and beg > end:\n beg,end,step = 0,0,1\n elif(step < 0 and index.start is None and index.stop is None):\n beg,end,step = 0,dim_len,-step\n elif(step < 0 and index.start is None):\n # +1 because negative stepping is inclusive\n beg,end,step = end+1,dim_len,-step \n elif(step < 0 and index.stop is None):\n beg,end,step = 0,beg+1,-step\n elif(step < 0 and beg > end): \n beg,end,step = end,beg,-step\n elif(step < 0 and beg < end): \n beg,end,step = 0,0,-step\n slc_len = abs(divide(end-beg-1,step)+1)\n new_dims.append(slc_len)\n else:\n if index < 0: index += dim_len\n if index >=0 and index < dim_len:\n #this reduces the array dimensions by one\n pass\n else:\n raise IndexError, \"Index out of range\" \n dim += 1 \n new_dims.extend(self.shape[dim:])\n if 0 in new_dims:\n raise IndexError, \"Zero length slices not currently supported\"\n return dummy_array(new_dims,1)\n def __repr__(self):\n val = str((self.name, str(self.shape)))\n return val \n\ndef unary(ary):\n return ary\n\ndef not_implemented(ary):\n return ary\n \n#all imported from Numeric and need to be reassigned.\nunary_op = [arccos, arcsin, arctan, cos, cosh, sin, sinh, \n exp,ceil,floor,fabs,log,log10,sqrt]\n\nunsupported = [argmin,argmax, argsort,around, absolute,sign,negative,floor]\n\nfor func in unary_op:\n func = unary\n \nfor func in unsupported:\n func = not_implemented\n \ndef reduction(ary,axis=0):\n if axis < 0:\n axis += len(ary.shape) \n if axis < 0 or axis >= len(ary.shape):\n raise ValueError, \"Dimension not in array\" \n new_dims = list(ary.shape[:axis]) + list(ary.shape[axis+1:])\n return dummy_array(new_dims,1) \n\n# functions currently not supported by compiler\n# reductions are gonna take some array reordering for the general case,\n# so this is gonna take some thought (probably some tree manipulation).\ndef take(ary,axis=0): raise NotImplemented\n# and all the rest\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "source_code_before": "from Numeric import *\n\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom ast_tools import *\nfrom types import *\nimport sys\n\ndef time_it():\n import time\n \n expr = \"ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,1:])\" \\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n ex = ones((10,10,10),typecode=Float32)\n ca_x = ones((10,10,10),typecode=Float32)\n cb_y_x = ones((10,10,10),typecode=Float32)\n cb_z_x = ones((10,10,10),typecode=Float32)\n hz = ones((10,10,10),typecode=Float32)\n hy = ones((10,10,10),typecode=Float32)\n \n N = 1\n t1 = time.time()\n for i in range(N):\n passed = check_expr(expr,locals())\n t2 = time.time()\n print 'time per call:', (t2 - t1)/N\n print 'passed:', passed\n \ndef check_expr(expr,local_vars,global_vars={}):\n \"\"\" Currently only checks expressions (not suites).\n Doesn't check that lhs = rhs. checked by compiled func though\n \"\"\"\n values ={}\n \n #first handle the globals\n for var,val in global_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n #now handle the locals \n for var,val in local_vars.items():\n if type(val) in [ArrayType]: \n values[var] = dummy_array(val,name=var)\n elif type(val) in [IntType,LongType,FloatType,ComplexType]: \n values[var] = val\n exec(expr,values)\n try:\n exec(expr,values)\n except:\n try:\n eval(expr,values)\n except:\n return 0 \n return 1 \n \nempty = array(())\nempty_slice = slice(None)\n\ndef make_same_length(x,y):\n try:\n Nx = len(x)\n except:\n Nx = 0\n try:\n Ny = len(y)\n except:\n Ny = 0\n if Nx == Ny == 0:\n return empty,empty\n elif Nx == Ny:\n return asarray(x),asarray(y)\n else: \n diff = abs(Nx - Ny)\n front = ones(diff,Int)\n if Nx > Ny:\n return asarray(x), concatenate((front,y))\n elif Ny > Nx:\n return concatenate((front,x)),asarray(y) \n\ndef binary_op_size(xx,yy):\n \"\"\" This returns the resulting size from operating on xx, and yy\n with a binary operator. It accounts for broadcasting, and\n throws errors if the array sizes are incompatible.\n \"\"\"\n x,y = make_same_length(xx,yy)\n res = zeros(len(x))\n for i in range(len(x)):\n if x[i] == y[i]:\n res[i] = x[i]\n elif x[i] == 1:\n res[i] = y[i]\n elif y[i] == 1:\n res[i] = x[i]\n else:\n # offer more information here about which variables.\n raise ValueError, \"frames are not aligned\"\n return res \nclass dummy_array:\n def __init__(self,ary,ary_is_shape = 0,name=None):\n self.name = name\n if ary_is_shape:\n self.shape = ary\n #self.shape = asarray(ary)\n else:\n try:\n self.shape = shape(ary)\n except:\n self.shape = empty\n #self.value = ary \n def binary_op(self,other):\n try: \n x = other.shape\n except AttributeError:\n x = empty \n new_shape = binary_op_size(self.shape,x)\n return dummy_array(new_shape,1)\n def __cmp__(self,other):\n # This isn't an exact compare, but does work for == \n # cluge for Numeric\n if type(other) in [IntType,LongType,FloatType,ComplexType]:\n return 0\n if len(self.shape) == len(other.shape) == 0:\n return 0\n return not alltrue(equal(self.shape,other.shape))\n\n def __add__(self,other): return self.binary_op(other)\n def __radd__(self,other): return self.binary_op(other)\n def __sub__(self,other): return self.binary_op(other)\n def __rsub__(self,other): return self.binary_op(other)\n def __mul__(self,other): return self.binary_op(other)\n def __rmul__(self,other): return self.binary_op(other)\n def __div__(self,other): return self.binary_op(other)\n def __rdiv__(self,other): return self.binary_op(other)\n def __mod__(self,other): return self.binary_op(other)\n def __rmod__(self,other): return self.binary_op(other)\n def __lshift__(self,other): return self.binary_op(other)\n def __rshift__(self,other): return self.binary_op(other)\n # unary ops\n def __neg__(self,other): return self\n def __pos__(self,other): return self\n def __abs__(self,other): return self\n def __invert__(self,other): return self \n # Not sure what to do with coersion ops. Ignore for now.\n #\n # not currently supported by compiler.\n # __divmod__\n # __pow__\n # __rpow__\n # __and__\n # __or__\n # __xor__\n # item access and slicing \n def __setitem__(self,indices,val):\n #ignore for now\n pass\n def __len__(self):\n return self.shape[0]\n def __getslice__(self,i,j):\n # enabling the following would make class compatible with\n # lists. Its current incarnation is compatible with arrays.\n # Both this and Numeric should have this FIXED to correspond\n # to lists.\n #i = max(i, 0); j = max(j, 0)\n return self.__getitem__((slice(i,j),))\n def __getitem__(self,indices):\n # ayeyaya this is a mess\n #print indices, type(indices), indices.shape \n if type(indices) is not TupleType:\n indices = (indices,)\n if Ellipsis in indices:\n raise IndexError, \"Ellipsis not currently supported\"\n new_dims = [] \n dim = 0 \n for index in indices:\n try:\n dim_len = self.shape[dim]\n except IndexError:\n raise IndexError, \"To many indices specified\"\n \n #if (type(index) is SliceType and index.start == index.stop == index.step):\n if (index is empty_slice):\n slc_len = dim_len\n elif type(index) is SliceType:\n beg,end,step = index.start,index.stop,index.step \n # handle if they are dummy arrays\n #if hasattr(beg,'value') and type(beg.value) != ArrayType:\n # beg = beg.value\n #if hasattr(end,'value') and type(end.value) != ArrayType:\n # end = end.value\n #if hasattr(step,'value') and type(step.value) != ArrayType:\n # step = step.value \n if beg is None: beg = 0\n if end == sys.maxint or end is None:\n end = dim_len\n if step is None: \n step = 1\n \n if beg < 0: beg += dim_len\n if end < 0: end += dim_len\n # the following is list like behavior,\n # which isn't adhered to by arrays. \n # FIX THIS ANOMOLY IN NUMERIC!\n if beg < 0: beg = 0\n if beg > dim_len: beg = dim_len\n if end < 0: end = 0\n if end > dim_len: end = dim_len\n # This is rubbish. \n if beg == end:\n beg,end,step = 0,0,1\n elif beg >= dim_len and step > 0:\n beg,end,step = 0,0,1\n #elif index.step > 0 and beg <= end:\n elif step > 0 and beg <= end:\n pass #slc_len = abs(divide(end-beg-1,step)+1) \n # handle [::-1] and [-1::-1] correctly \n #elif index.step > 0 and beg > end:\n elif step > 0 and beg > end:\n beg,end,step = 0,0,1\n elif(step < 0 and index.start is None and index.stop is None):\n beg,end,step = 0,dim_len,-step\n elif(step < 0 and index.start is None):\n # +1 because negative stepping is inclusive\n beg,end,step = end+1,dim_len,-step \n elif(step < 0 and index.stop is None):\n beg,end,step = 0,beg+1,-step\n elif(step < 0 and beg > end): \n beg,end,step = end,beg,-step\n elif(step < 0 and beg < end): \n beg,end,step = 0,0,-step\n slc_len = abs(divide(end-beg-1,step)+1)\n new_dims.append(slc_len)\n else:\n if index < 0: index += dim_len\n if index >=0 and index < dim_len:\n #this reduces the array dimensions by one\n pass\n else:\n raise IndexError, \"Index out of range\" \n dim += 1 \n new_dims.extend(self.shape[dim:])\n if 0 in new_dims:\n raise IndexError, \"Zero length slices not currently supported\"\n return dummy_array(new_dims,1)\n def __repr__(self):\n val = str((self.name, str(self.shape)))\n return val \n\ndef unary(ary):\n return ary\n\ndef not_implemented(ary):\n return ary\n \n#all imported from Numeric and need to be reassigned.\nunary_op = [arccos, arcsin, arctan, cos, cosh, sin, sinh, \n exp,ceil,floor,fabs,log,log10,sqrt]\n\nunsupported = [argmin,argmax, argsort,around, absolute,sign,negative,floor]\n\nfor func in unary_op:\n func = unary\n \nfor func in unsupported:\n func = not_implemented\n \ndef reduction(ary,axis=0):\n if axis < 0:\n axis += len(ary.shape) \n if axis < 0 or axis >= len(ary.shape):\n raise ValueError, \"Dimension not in array\" \n new_dims = list(ary.shape[:axis]) + list(ary.shape[axis+1:])\n return dummy_array(new_dims,1) \n\n# functions currently not supported by compiler\n# reductions are gonna take some array reordering for the general case,\n# so this is gonna take some thought (probably some tree manipulation).\ndef take(ary,axis=0): raise NotImplemented\n# and all the rest\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n \n", + "methods": [ + { + "name": "time_it", + "long_name": "time_it( )", + "filename": "size_check.py", + "nloc": 18, + "complexity": 2, + "token_count": 158, + "parameters": [], + "start_line": 13, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "check_expr", + "long_name": "check_expr( expr , local_vars , global_vars = { } )", + "filename": "size_check.py", + "nloc": 21, + "complexity": 9, + "token_count": 159, + "parameters": [ + "expr", + "local_vars", + "global_vars" + ], + "start_line": 34, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "make_same_length", + "long_name": "make_same_length( x , y )", + "filename": "size_check.py", + "nloc": 20, + "complexity": 7, + "token_count": 115, + "parameters": [ + "x", + "y" + ], + "start_line": 65, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "binary_op_size", + "long_name": "binary_op_size( xx , yy )", + "filename": "size_check.py", + "nloc": 13, + "complexity": 5, + "token_count": 100, + "parameters": [ + "xx", + "yy" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , ary , ary_is_shape = 0 , name = None )", + "filename": "size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 47, + "parameters": [ + "self", + "ary", + "ary_is_shape", + "name" + ], + "start_line": 105, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "binary_op", + "long_name": "binary_op( self , other )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 116, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "size_check.py", + "nloc": 6, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "other" + ], + "start_line": 123, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , indices , val )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "indices", + "val" + ], + "start_line": 159, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 162, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 164, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , indices )", + "filename": "size_check.py", + "nloc": 58, + "complexity": 39, + "token_count": 450, + "parameters": [ + "self", + "indices" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unary", + "long_name": "unary( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "not_implemented", + "long_name": "not_implemented( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 257, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "reduction", + "long_name": "reduction( ary , axis = 0 )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 4, + "token_count": 72, + "parameters": [ + "ary", + "axis" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 286, + "end_line": 288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 290, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "time_it", + "long_name": "time_it( )", + "filename": "size_check.py", + "nloc": 18, + "complexity": 2, + "token_count": 158, + "parameters": [], + "start_line": 13, + "end_line": 32, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "check_expr", + "long_name": "check_expr( expr , local_vars , global_vars = { } )", + "filename": "size_check.py", + "nloc": 21, + "complexity": 9, + "token_count": 159, + "parameters": [ + "expr", + "local_vars", + "global_vars" + ], + "start_line": 34, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 0 + }, + { + "name": "make_same_length", + "long_name": "make_same_length( x , y )", + "filename": "size_check.py", + "nloc": 20, + "complexity": 7, + "token_count": 115, + "parameters": [ + "x", + "y" + ], + "start_line": 65, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "binary_op_size", + "long_name": "binary_op_size( xx , yy )", + "filename": "size_check.py", + "nloc": 13, + "complexity": 5, + "token_count": 100, + "parameters": [ + "xx", + "yy" + ], + "start_line": 86, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , ary , ary_is_shape = 0 , name = None )", + "filename": "size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 47, + "parameters": [ + "self", + "ary", + "ary_is_shape", + "name" + ], + "start_line": 105, + "end_line": 114, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "binary_op", + "long_name": "binary_op( self , other )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 2, + "token_count": 37, + "parameters": [ + "self", + "other" + ], + "start_line": 116, + "end_line": 122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__cmp__", + "long_name": "__cmp__( self , other )", + "filename": "size_check.py", + "nloc": 6, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "other" + ], + "start_line": 123, + "end_line": 130, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__setitem__", + "long_name": "__setitem__( self , indices , val )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "indices", + "val" + ], + "start_line": 159, + "end_line": 161, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__len__", + "long_name": "__len__( self )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self" + ], + "start_line": 162, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__getslice__", + "long_name": "__getslice__( self , i , j )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self", + "i", + "j" + ], + "start_line": 164, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "__getitem__", + "long_name": "__getitem__( self , indices )", + "filename": "size_check.py", + "nloc": 58, + "complexity": 39, + "token_count": 450, + "parameters": [ + "self", + "indices" + ], + "start_line": 171, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 79, + "top_nesting_level": 1 + }, + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 252, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "unary", + "long_name": "unary( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "not_implemented", + "long_name": "not_implemented( ary )", + "filename": "size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 7, + "parameters": [ + "ary" + ], + "start_line": 257, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "reduction", + "long_name": "reduction( ary , axis = 0 )", + "filename": "size_check.py", + "nloc": 7, + "complexity": 4, + "token_count": 72, + "parameters": [ + "ary", + "axis" + ], + "start_line": 272, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 286, + "end_line": 288, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 290, + "end_line": 292, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 213, + "complexity": 82, + "token_count": 1684, + "diff_parsed": { + "added": [ + " pass # scipy_base.fastumath not available" + ], + "deleted": [ + " pass # fastumath not available" + ] + } + }, + { + "old_path": "weave/tests/test_ast_tools.py", + "new_path": "weave/tests/test_ast_tools.py", + "filename": "test_ast_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,7 +4,7 @@\n try:\n from scipy_base.fastumath import *\n except:\n- pass # fastumath not available \n+ pass # scipy_base.fastumath not available \n import RandomArray\n import time\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # scipy_base.fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport ast_tools\nrestore_path()\n\nadd_local_to_path(__name__)\nfrom weave_test_utils import *\nrestore_path()\n\nclass test_harvest_variables(unittest.TestCase):\n \"\"\" Not much testing going on here, but \n at least it is a flame test.\n \"\"\" \n def generic_test(self,expr,desired):\n import parser\n ast_list = parser.suite(expr).tolist()\n actual = ast_tools.harvest_variables(ast_list)\n print_assert_equal(expr,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"convert simple expr to blitz\n \n a[:1:2] = b[:1+i+2:]\n \"\"\"\n expr = \"a[:1:2] = b[:1+i+2:]\" \n desired = ['a','b','i'] \n self.generic_test(expr,desired)\n\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_harvest_variables,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport ast_tools\nrestore_path()\n\nadd_local_to_path(__name__)\nfrom weave_test_utils import *\nrestore_path()\n\nclass test_harvest_variables(unittest.TestCase):\n \"\"\" Not much testing going on here, but \n at least it is a flame test.\n \"\"\" \n def generic_test(self,expr,desired):\n import parser\n ast_list = parser.suite(expr).tolist()\n actual = ast_tools.harvest_variables(ast_list)\n print_assert_equal(expr,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"convert simple expr to blitz\n \n a[:1:2] = b[:1+i+2:]\n \"\"\"\n expr = \"a[:1:2] = b[:1+i+2:]\" \n desired = ['a','b','i'] \n self.generic_test(expr,desired)\n\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_harvest_variables,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired )", + "filename": "test_ast_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "expr", + "desired" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_ast_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 42, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_ast_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 49, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired )", + "filename": "test_ast_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self", + "expr", + "desired" + ], + "start_line": 26, + "end_line": 30, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_ast_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 32, + "end_line": 39, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_ast_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 42, + "end_line": 47, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_ast_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 49, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 42, + "complexity": 5, + "token_count": 208, + "diff_parsed": { + "added": [ + " pass # scipy_base.fastumath not available" + ], + "deleted": [ + " pass # fastumath not available" + ] + } + }, + { + "old_path": "weave/tests/test_blitz_tools.py", + "new_path": "weave/tests/test_blitz_tools.py", + "filename": "test_blitz_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,7 +4,7 @@\n try:\n from scipy_base.fastumath import *\n except:\n- pass # fastumath not available \n+ pass # scipy_base.fastumath not available \n import RandomArray\n import os\n import time\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # scipy_base.fastumath not available \nimport RandomArray\nimport os\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path,restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport blitz_tools\nfrom ast_tools import *\nfrom weave_test_utils import *\nrestore_path()\n\nadd_local_to_path(__name__)\nimport test_scalar_spec\nrestore_path()\n\nclass test_ast_to_blitz_expr(unittest.TestCase):\n\n def generic_test(self,expr,desired):\n import parser\n ast = parser.suite(expr)\n ast_list = ast.tolist()\n actual = blitz_tools.ast_to_blitz_expr(ast_list)\n actual = remove_whitespace(actual)\n desired = remove_whitespace(desired)\n print_assert_equal(expr,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"convert simple expr to blitz\n \n a[:1:2] = b[:1+i+2:]\n \"\"\"\n expr = \"a[:1:2] = b[:1+i+2:]\" \n desired = \"a(blitz::Range(_beg,1-1,2))=\"\\\n \"b(blitz::Range(_beg,1+i+2-1));\"\n self.generic_test(expr,desired)\n\n def check_fdtd_expr(self):\n \"\"\" convert fdtd equation to blitz.\n ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:] \n + cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,:])\n - cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1]);\n Note: This really should have \"\\\" at the end of each line\n to indicate continuation. \n \"\"\"\n expr = \"ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,:])\"\\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n desired = 'ex(_all,blitz::Range(1,_end),blitz::Range(1,_end))='\\\n ' ca_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n ' *ex(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '+cb_y_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '*(hz(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n ' -hz(_all,blitz::Range(_beg,_Nhz(1)-1-1),_all))'\\\n ' -cb_z_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '*(hy(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '-hy(_all,blitz::Range(1,_end),blitz::Range(_beg,_Nhy(2)-1-1)));'\n self.generic_test(expr,desired)\n\nclass test_blitz(unittest.TestCase):\n \"\"\"* These are long running tests...\n \n I'd like to benchmark these things somehow.\n *\"\"\"\n def generic_test(self,expr,arg_dict,type,size,mod_location):\n clean_result = array(arg_dict['result'],copy=1)\n t1 = time.time()\n exec expr in globals(),arg_dict\n t2 = time.time()\n standard = t2 - t1\n desired = arg_dict['result']\n arg_dict['result'] = clean_result\n t1 = time.time()\n old_env = os.environ.get('PYTHONCOMPILED','')\n os.environ['PYTHONCOMPILED'] = mod_location\n blitz_tools.blitz(expr,arg_dict,{},verbose=0) #,\n #extra_compile_args = ['-O3','-malign-double','-funroll-loops'])\n os.environ['PYTHONCOMPILED'] = old_env\n t2 = time.time()\n compiled = t2 - t1\n actual = arg_dict['result']\n # this really should give more info...\n try:\n # this isn't very stringent. Need to tighten this up and\n # learn where failures are occuring.\n assert(allclose(abs(actual.flat),abs(desired.flat),1e-4,1e-6))\n except:\n diff = actual-desired\n print diff[:4,:4]\n print diff[:4,-4:]\n print diff[-4:,:4]\n print diff[-4:,-4:]\n print sum(abs(diff.flat)) \n raise AssertionError \n return standard,compiled\n \n def generic_2d(self,expr):\n \"\"\" The complex testing is pretty lame...\n \"\"\"\n mod_location = empty_temp_dir()\n import parser\n ast = parser.suite(expr)\n arg_list = harvest_variables(ast.tolist())\n #print arg_list\n all_types = [Float32,Float64,Complex32,Complex64]\n all_sizes = [(10,10), (50,50), (100,100), (500,500), (1000,1000)]\n print '\\nExpression:', expr\n for typ in all_types:\n for size in all_sizes:\n result = zeros(size,typ)\n arg_dict = {}\n for arg in arg_list:\n arg_dict[arg] = RandomArray.normal(0,1,size).astype(typ)\n arg_dict[arg].savespace(1)\n # set imag part of complex values to non-zero value\n try: arg_dict[arg].imag = arg_dict[arg].real\n except: pass \n print 'Run:', size,typ\n standard,compiled = self.generic_test(expr,arg_dict,type,size,\n mod_location)\n try:\n speed_up = standard/compiled\n except:\n speed_up = -1.\n print \"1st run(Numeric,compiled,speed up): %3.4f, %3.4f, \" \\\n \"%3.4f\" % (standard,compiled,speed_up) \n standard,compiled = self.generic_test(expr,arg_dict,type,size,\n mod_location)\n try:\n speed_up = standard/compiled\n except:\n speed_up = -1. \n print \"2nd run(Numeric,compiled,speed up): %3.4f, %3.4f, \" \\\n \"%3.4f\" % (standard,compiled,speed_up)\n cleanup_temp_dir(mod_location) \n #def check_simple_2d(self):\n # \"\"\" result = a + b\"\"\" \n # expr = \"result = a + b\"\n # self.generic_2d(expr)\n def check_5point_avg_2d(self):\n \"\"\" result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]\n + b[1:-1,2:] + b[1:-1,:-2]) / 5.\n \"\"\" \n expr = \"result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]\" \\\n \"+ b[1:-1,2:] + b[1:-1,:-2]) / 5.\"\n self.generic_2d(expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_ast_to_blitz_expr,'check_') )\n if level >= 10:\n suites.append( unittest.makeSuite(test_blitz,'check_') ) \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \nimport RandomArray\nimport os\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path,restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport blitz_tools\nfrom ast_tools import *\nfrom weave_test_utils import *\nrestore_path()\n\nadd_local_to_path(__name__)\nimport test_scalar_spec\nrestore_path()\n\nclass test_ast_to_blitz_expr(unittest.TestCase):\n\n def generic_test(self,expr,desired):\n import parser\n ast = parser.suite(expr)\n ast_list = ast.tolist()\n actual = blitz_tools.ast_to_blitz_expr(ast_list)\n actual = remove_whitespace(actual)\n desired = remove_whitespace(desired)\n print_assert_equal(expr,actual,desired)\n\n def check_simple_expr(self):\n \"\"\"convert simple expr to blitz\n \n a[:1:2] = b[:1+i+2:]\n \"\"\"\n expr = \"a[:1:2] = b[:1+i+2:]\" \n desired = \"a(blitz::Range(_beg,1-1,2))=\"\\\n \"b(blitz::Range(_beg,1+i+2-1));\"\n self.generic_test(expr,desired)\n\n def check_fdtd_expr(self):\n \"\"\" convert fdtd equation to blitz.\n ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:] \n + cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,:])\n - cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1]);\n Note: This really should have \"\\\" at the end of each line\n to indicate continuation. \n \"\"\"\n expr = \"ex[:,1:,1:] = ca_x[:,1:,1:] * ex[:,1:,1:]\" \\\n \"+ cb_y_x[:,1:,1:] * (hz[:,1:,1:] - hz[:,:-1,:])\"\\\n \"- cb_z_x[:,1:,1:] * (hy[:,1:,1:] - hy[:,1:,:-1])\" \n desired = 'ex(_all,blitz::Range(1,_end),blitz::Range(1,_end))='\\\n ' ca_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n ' *ex(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '+cb_y_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '*(hz(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n ' -hz(_all,blitz::Range(_beg,_Nhz(1)-1-1),_all))'\\\n ' -cb_z_x(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '*(hy(_all,blitz::Range(1,_end),blitz::Range(1,_end))'\\\n '-hy(_all,blitz::Range(1,_end),blitz::Range(_beg,_Nhy(2)-1-1)));'\n self.generic_test(expr,desired)\n\nclass test_blitz(unittest.TestCase):\n \"\"\"* These are long running tests...\n \n I'd like to benchmark these things somehow.\n *\"\"\"\n def generic_test(self,expr,arg_dict,type,size,mod_location):\n clean_result = array(arg_dict['result'],copy=1)\n t1 = time.time()\n exec expr in globals(),arg_dict\n t2 = time.time()\n standard = t2 - t1\n desired = arg_dict['result']\n arg_dict['result'] = clean_result\n t1 = time.time()\n old_env = os.environ.get('PYTHONCOMPILED','')\n os.environ['PYTHONCOMPILED'] = mod_location\n blitz_tools.blitz(expr,arg_dict,{},verbose=0) #,\n #extra_compile_args = ['-O3','-malign-double','-funroll-loops'])\n os.environ['PYTHONCOMPILED'] = old_env\n t2 = time.time()\n compiled = t2 - t1\n actual = arg_dict['result']\n # this really should give more info...\n try:\n # this isn't very stringent. Need to tighten this up and\n # learn where failures are occuring.\n assert(allclose(abs(actual.flat),abs(desired.flat),1e-4,1e-6))\n except:\n diff = actual-desired\n print diff[:4,:4]\n print diff[:4,-4:]\n print diff[-4:,:4]\n print diff[-4:,-4:]\n print sum(abs(diff.flat)) \n raise AssertionError \n return standard,compiled\n \n def generic_2d(self,expr):\n \"\"\" The complex testing is pretty lame...\n \"\"\"\n mod_location = empty_temp_dir()\n import parser\n ast = parser.suite(expr)\n arg_list = harvest_variables(ast.tolist())\n #print arg_list\n all_types = [Float32,Float64,Complex32,Complex64]\n all_sizes = [(10,10), (50,50), (100,100), (500,500), (1000,1000)]\n print '\\nExpression:', expr\n for typ in all_types:\n for size in all_sizes:\n result = zeros(size,typ)\n arg_dict = {}\n for arg in arg_list:\n arg_dict[arg] = RandomArray.normal(0,1,size).astype(typ)\n arg_dict[arg].savespace(1)\n # set imag part of complex values to non-zero value\n try: arg_dict[arg].imag = arg_dict[arg].real\n except: pass \n print 'Run:', size,typ\n standard,compiled = self.generic_test(expr,arg_dict,type,size,\n mod_location)\n try:\n speed_up = standard/compiled\n except:\n speed_up = -1.\n print \"1st run(Numeric,compiled,speed up): %3.4f, %3.4f, \" \\\n \"%3.4f\" % (standard,compiled,speed_up) \n standard,compiled = self.generic_test(expr,arg_dict,type,size,\n mod_location)\n try:\n speed_up = standard/compiled\n except:\n speed_up = -1. \n print \"2nd run(Numeric,compiled,speed up): %3.4f, %3.4f, \" \\\n \"%3.4f\" % (standard,compiled,speed_up)\n cleanup_temp_dir(mod_location) \n #def check_simple_2d(self):\n # \"\"\" result = a + b\"\"\" \n # expr = \"result = a + b\"\n # self.generic_2d(expr)\n def check_5point_avg_2d(self):\n \"\"\" result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]\n + b[1:-1,2:] + b[1:-1,:-2]) / 5.\n \"\"\" \n expr = \"result[1:-1,1:-1] = (b[1:-1,1:-1] + b[2:,1:-1] + b[:-2,1:-1]\" \\\n \"+ b[1:-1,2:] + b[1:-1,:-2]) / 5.\"\n self.generic_2d(expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_ast_to_blitz_expr,'check_') )\n if level >= 10:\n suites.append( unittest.makeSuite(test_blitz,'check_') ) \n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired )", + "filename": "test_blitz_tools.py", + "nloc": 8, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self", + "expr", + "desired" + ], + "start_line": 27, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_blitz_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_fdtd_expr", + "long_name": "check_fdtd_expr( self )", + "filename": "test_blitz_tools.py", + "nloc": 14, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , arg_dict , type , size , mod_location )", + "filename": "test_blitz_tools.py", + "nloc": 27, + "complexity": 2, + "token_count": 227, + "parameters": [ + "self", + "expr", + "arg_dict", + "type", + "size", + "mod_location" + ], + "start_line": 73, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_blitz_tools.py", + "nloc": 35, + "complexity": 7, + "token_count": 253, + "parameters": [ + "self", + "expr" + ], + "start_line": 105, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "check_5point_avg_2d", + "long_name": "check_5point_avg_2d( self )", + "filename": "test_blitz_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 154, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_blitz_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 57, + "parameters": [ + "level" + ], + "start_line": 156, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_blitz_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired )", + "filename": "test_blitz_tools.py", + "nloc": 8, + "complexity": 1, + "token_count": 54, + "parameters": [ + "self", + "expr", + "desired" + ], + "start_line": 27, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_simple_expr", + "long_name": "check_simple_expr( self )", + "filename": "test_blitz_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 36, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_fdtd_expr", + "long_name": "check_fdtd_expr( self )", + "filename": "test_blitz_tools.py", + "nloc": 14, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 66, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , arg_dict , type , size , mod_location )", + "filename": "test_blitz_tools.py", + "nloc": 27, + "complexity": 2, + "token_count": 227, + "parameters": [ + "self", + "expr", + "arg_dict", + "type", + "size", + "mod_location" + ], + "start_line": 73, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 31, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_blitz_tools.py", + "nloc": 35, + "complexity": 7, + "token_count": 253, + "parameters": [ + "self", + "expr" + ], + "start_line": 105, + "end_line": 143, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 39, + "top_nesting_level": 1 + }, + { + "name": "check_5point_avg_2d", + "long_name": "check_5point_avg_2d( self )", + "filename": "test_blitz_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 154, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_blitz_tools.py", + "nloc": 8, + "complexity": 3, + "token_count": 57, + "parameters": [ + "level" + ], + "start_line": 156, + "end_line": 163, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_blitz_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 165, + "end_line": 169, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 133, + "complexity": 17, + "token_count": 794, + "diff_parsed": { + "added": [ + " pass # scipy_base.fastumath not available" + ], + "deleted": [ + " pass # fastumath not available" + ] + } + }, + { + "old_path": "weave/tests/test_size_check.py", + "new_path": "weave/tests/test_size_check.py", + "filename": "test_size_check.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,7 +4,7 @@\n try:\n from scipy_base.fastumath import *\n except:\n- pass # fastumath not available \n+ pass # scipy_base.fastumath not available \n \n from scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest, os\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # scipy_base.fastumath not available \n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport size_check\nfrom ast_tools import *\nrestore_path()\n\nempty = array(())\n \ndef array_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired)))\n except AssertionError:\n try:\n # kluge for bug in Numeric\n assert (len(actual[0]) == len(actual[1]) == \n len(desired[0]) == len(desired[1]) == 0)\n except: \n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_make_same_length(unittest.TestCase):\n\n def generic_test(self,x,y,desired):\n actual = size_check.make_same_length(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n\n def check_scalar(self):\n x,y = (),()\n desired = empty,empty \n self.generic_test(x,y,desired)\n def check_x_scalar(self):\n x,y = (),(1,2)\n desired = array((1,1)),array((1,2))\n self.generic_test(x,y,desired)\n def check_y_scalar(self):\n x,y = (1,2),()\n desired = array((1,2)),array((1,1))\n self.generic_test(x,y,desired)\n def check_x_short(self):\n x,y = (1,2),(1,2,3)\n desired = array((1,1,2)),array((1,2,3))\n self.generic_test(x,y,desired)\n def check_y_short(self):\n x,y = (1,2,3),(1,2)\n desired = array((1,2,3)),array((1,1,2))\n self.generic_test(x,y,desired)\n\nclass test_binary_op_size(unittest.TestCase):\n def generic_test(self,x,y,desired):\n actual = size_check.binary_op_size(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n actual = size_check.binary_op_size(x,y)\n #print actual\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return array(val) \n def check_scalar(self):\n x,y = (),()\n desired = self.desired_type(())\n self.generic_test(x,y,desired)\n def check_x1(self):\n x,y = (1,),()\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_y1(self):\n x,y = (),(1,)\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_x_y(self):\n x,y = (5,),(5,)\n desired = self.desired_type((5,))\n self.generic_test(x,y,desired)\n def check_x_y2(self):\n x,y = (5,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y3(self):\n x,y = (5,10),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y4(self):\n x,y = (1,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y5(self):\n x,y = (5,1),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y6(self):\n x,y = (1,10),(5,1)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y7(self):\n x,y = (5,4,3,2,1),(3,2,1)\n desired = self.desired_type((5,4,3,2,1))\n self.generic_test(x,y,desired)\n \n def check_error1(self):\n x,y = (5,),(4,)\n self.generic_error_test(x,y)\n def check_error2(self):\n x,y = (5,5),(4,5)\n self.generic_error_test(x,y)\n\nclass test_dummy_array(test_binary_op_size):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue() \n def generic_test(self,x,y,desired):\n if type(x) is type(()):\n x = ones(x)\n if type(y) is type(()):\n y = ones(y)\n xx = size_check.dummy_array(x)\n yy = size_check.dummy_array(y)\n ops = ['+', '-', '/', '*', '<<', '>>']\n for op in ops:\n actual = eval('xx' + op + 'yy')\n desired = desired\n self.array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n self.generic_test('',x,y)\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return size_check.dummy_array(array(val),1)\n\nclass test_dummy_array_indexing(unittest.TestCase):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,ary,expr,desired):\n a = size_check.dummy_array(ary)\n actual = eval(expr).shape \n #print desired, actual\n self.array_assert_equal(expr,actual,desired)\n def generic_wrap(self,a,expr):\n #print expr ,eval(expr)\n desired = array(eval(expr).shape)\n try:\n self.generic_test(a,expr,desired)\n except IndexError:\n if 0 not in desired:\n msg = '%s raised IndexError in dummy_array, but forms\\n' \\\n 'valid array shape -> %s' % (expr, str(desired))\n raise AttributeError, msg \n def generic_1d(self,expr):\n a = arange(10)\n self.generic_wrap(a,expr)\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \n def generic_1d_index(self,expr):\n a = arange(10)\n #print expr ,eval(expr)\n desired = array(())\n self.generic_test(a,expr,desired)\n def check_1d_index_0(self):\n self.generic_1d_index('a[0]')\n def check_1d_index_1(self):\n self.generic_1d_index('a[4]')\n def check_1d_index_2(self):\n self.generic_1d_index('a[-4]')\n def check_1d_index_3(self):\n try: self.generic_1d('a[12]')\n except IndexError: pass \n def check_1d_index_calculated(self):\n self.generic_1d_index('a[0+1]')\n def check_1d_0(self):\n self.generic_1d('a[:]')\n def check_1d_1(self): \n self.generic_1d('a[1:]')\n def check_1d_2(self): \n self.generic_1d('a[-1:]')\n def check_1d_3(self):\n # dummy_array is \"bug for bug\" equiv to Numeric.array\n # on wrapping of indices.\n self.generic_1d('a[-11:]')\n def check_1d_4(self): \n self.generic_1d('a[:1]')\n def check_1d_5(self): \n self.generic_1d('a[:-1]')\n def check_1d_6(self): \n self.generic_1d('a[:-11]')\n def check_1d_7(self): \n self.generic_1d('a[1:5]')\n def check_1d_8(self): \n self.generic_1d('a[1:-5]')\n def check_1d_9(self):\n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[-1:-5]')\n except IndexError: pass \n def check_1d_10(self): \n self.generic_1d('a[-5:-1]')\n \n def check_1d_stride_0(self): \n self.generic_1d('a[::1]') \n def check_1d_stride_1(self): \n self.generic_1d('a[::-1]') \n def check_1d_stride_2(self): \n self.generic_1d('a[1::1]') \n def check_1d_stride_3(self): \n self.generic_1d('a[1::-1]') \n def check_1d_stride_4(self): \n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[1:5:-1]') \n except IndexError: pass \n def check_1d_stride_5(self): \n self.generic_1d('a[5:1:-1]') \n def check_1d_stride_6(self): \n self.generic_1d('a[:4:1]') \n def check_1d_stride_7(self): \n self.generic_1d('a[:4:-1]') \n def check_1d_stride_8(self): \n self.generic_1d('a[:-4:1]') \n def check_1d_stride_9(self): \n self.generic_1d('a[:-4:-1]') \n def check_1d_stride_10(self): \n self.generic_1d('a[:-3:2]') \n def check_1d_stride_11(self): \n self.generic_1d('a[:-3:-2]') \n def check_1d_stride_12(self): \n self.generic_1d('a[:-3:-7]') \n def check_1d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50\n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n self.generic_1d('a[%s:%s:%s]' %(beg,end,step)) \n except IndexError:\n pass\n\n def check_2d_0(self):\n self.generic_2d('a[:]')\n def check_2d_1(self):\n self.generic_2d('a[:2]')\n def check_2d_2(self):\n self.generic_2d('a[:,:]')\n def check_2d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n beg2 = whrandom.choice(choices)\n end2 = whrandom.choice(choices)\n step2 = whrandom.choice(choices) \n expr = 'a[%s:%s:%s,%s:%s:%s]' %(beg,end,step,beg2,end2,step2)\n self.generic_2d(expr) \n except IndexError:\n pass\n def check_3d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n idx = []\n for i in range(9):\n idx.append(whrandom.choice(choices))\n expr = 'a[%s:%s:%s,%s:%s:%s,%s:%s:%s]' % tuple(idx)\n self.generic_3d(expr) \n except IndexError:\n pass\n\nclass test_reduction(unittest.TestCase):\n def check_1d_0(self):\n a = ones((5,))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_0(self):\n a = ones((5,10))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((10,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_1(self):\n a = ones((5,10))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_3d_0(self):\n a = ones((5,6,7))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,7),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_error0(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,-2)\n except ValueError:\n pass \n def check_error1(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,1)\n except ValueError:\n pass \n\nclass test_expressions(unittest.TestCase): \n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,expr,desired,**kw):\n import parser\n ast_list = parser.expr(expr).tolist()\n args = harvest_variables(ast_list)\n loc = locals().update(kw)\n for var in args:\n s='%s = size_check.dummy_array(%s)'% (var,var)\n exec(s,loc)\n try: \n actual = eval(expr,locals()).shape \n except:\n actual = 'failed' \n if actual is 'failed' and desired is 'failed':\n return\n try: \n self.array_assert_equal(expr,actual,desired)\n except:\n print 'EXPR:',expr\n print 'ACTUAL:',actual\n print 'DEISRED:',desired\n def generic_wrap(self,expr,**kw):\n try:\n x = array(eval(expr,kw))\n try:\n desired = x.shape\n except:\n desired = zeros(())\n except:\n desired = 'failed'\n self.generic_test(expr,desired,**kw)\n def check_generic_1d(self):\n a = arange(10) \n expr = 'a[:]' \n self.generic_wrap(expr,a=a)\n expr = 'a[:] + a' \n self.generic_wrap(expr,a=a)\n bad_expr = 'a[4:] + a' \n self.generic_wrap(bad_expr,a=a)\n a = arange(10) \n b = ones((1,10))\n expr = 'a + b' \n self.generic_wrap(expr,a=a,b=b)\n bad_expr = 'a[:5] + b' \n self.generic_wrap(bad_expr,a=a,b=b)\n def check_single_index(self): \n a = arange(10) \n expr = 'a[5] + a[3]' \n self.generic_wrap(expr,a=a)\n \n def check_calculated_index(self): \n a = arange(10) \n nx = 0\n expr = 'a[5] + a[nx+3]' \n size_check.check_expr(expr,locals())\n def check_calculated_index2(self): \n a = arange(10) \n nx = 0\n expr = 'a[1:5] + a[nx+1:5+nx]' \n size_check.check_expr(expr,locals())\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_make_same_length,'check_') )\n suites.append( unittest.makeSuite(test_binary_op_size,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array_indexing,'check_') )\n suites.append( unittest.makeSuite(test_reduction,'check_') )\n suites.append( unittest.makeSuite(test_expressions,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest, os\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport size_check\nfrom ast_tools import *\nrestore_path()\n\nempty = array(())\n \ndef array_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired)))\n except AssertionError:\n try:\n # kluge for bug in Numeric\n assert (len(actual[0]) == len(actual[1]) == \n len(desired[0]) == len(desired[1]) == 0)\n except: \n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_make_same_length(unittest.TestCase):\n\n def generic_test(self,x,y,desired):\n actual = size_check.make_same_length(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n\n def check_scalar(self):\n x,y = (),()\n desired = empty,empty \n self.generic_test(x,y,desired)\n def check_x_scalar(self):\n x,y = (),(1,2)\n desired = array((1,1)),array((1,2))\n self.generic_test(x,y,desired)\n def check_y_scalar(self):\n x,y = (1,2),()\n desired = array((1,2)),array((1,1))\n self.generic_test(x,y,desired)\n def check_x_short(self):\n x,y = (1,2),(1,2,3)\n desired = array((1,1,2)),array((1,2,3))\n self.generic_test(x,y,desired)\n def check_y_short(self):\n x,y = (1,2,3),(1,2)\n desired = array((1,2,3)),array((1,1,2))\n self.generic_test(x,y,desired)\n\nclass test_binary_op_size(unittest.TestCase):\n def generic_test(self,x,y,desired):\n actual = size_check.binary_op_size(x,y)\n desired = desired\n array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n actual = size_check.binary_op_size(x,y)\n #print actual\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return array(val) \n def check_scalar(self):\n x,y = (),()\n desired = self.desired_type(())\n self.generic_test(x,y,desired)\n def check_x1(self):\n x,y = (1,),()\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_y1(self):\n x,y = (),(1,)\n desired = self.desired_type((1,))\n self.generic_test(x,y,desired)\n def check_x_y(self):\n x,y = (5,),(5,)\n desired = self.desired_type((5,))\n self.generic_test(x,y,desired)\n def check_x_y2(self):\n x,y = (5,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y3(self):\n x,y = (5,10),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y4(self):\n x,y = (1,10),(5,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y5(self):\n x,y = (5,1),(1,10)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y6(self):\n x,y = (1,10),(5,1)\n desired = self.desired_type((5,10))\n self.generic_test(x,y,desired)\n def check_x_y7(self):\n x,y = (5,4,3,2,1),(3,2,1)\n desired = self.desired_type((5,4,3,2,1))\n self.generic_test(x,y,desired)\n \n def check_error1(self):\n x,y = (5,),(4,)\n self.generic_error_test(x,y)\n def check_error2(self):\n x,y = (5,5),(4,5)\n self.generic_error_test(x,y)\n\nclass test_dummy_array(test_binary_op_size):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue() \n def generic_test(self,x,y,desired):\n if type(x) is type(()):\n x = ones(x)\n if type(y) is type(()):\n y = ones(y)\n xx = size_check.dummy_array(x)\n yy = size_check.dummy_array(y)\n ops = ['+', '-', '/', '*', '<<', '>>']\n for op in ops:\n actual = eval('xx' + op + 'yy')\n desired = desired\n self.array_assert_equal('',actual,desired)\n def generic_error_test(self,x,y):\n try:\n self.generic_test('',x,y)\n raise AttributeError, \"Should have raised ValueError\"\n except ValueError:\n pass \n def desired_type(self,val):\n return size_check.dummy_array(array(val),1)\n\nclass test_dummy_array_indexing(unittest.TestCase):\n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,ary,expr,desired):\n a = size_check.dummy_array(ary)\n actual = eval(expr).shape \n #print desired, actual\n self.array_assert_equal(expr,actual,desired)\n def generic_wrap(self,a,expr):\n #print expr ,eval(expr)\n desired = array(eval(expr).shape)\n try:\n self.generic_test(a,expr,desired)\n except IndexError:\n if 0 not in desired:\n msg = '%s raised IndexError in dummy_array, but forms\\n' \\\n 'valid array shape -> %s' % (expr, str(desired))\n raise AttributeError, msg \n def generic_1d(self,expr):\n a = arange(10)\n self.generic_wrap(a,expr)\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \n def generic_1d_index(self,expr):\n a = arange(10)\n #print expr ,eval(expr)\n desired = array(())\n self.generic_test(a,expr,desired)\n def check_1d_index_0(self):\n self.generic_1d_index('a[0]')\n def check_1d_index_1(self):\n self.generic_1d_index('a[4]')\n def check_1d_index_2(self):\n self.generic_1d_index('a[-4]')\n def check_1d_index_3(self):\n try: self.generic_1d('a[12]')\n except IndexError: pass \n def check_1d_index_calculated(self):\n self.generic_1d_index('a[0+1]')\n def check_1d_0(self):\n self.generic_1d('a[:]')\n def check_1d_1(self): \n self.generic_1d('a[1:]')\n def check_1d_2(self): \n self.generic_1d('a[-1:]')\n def check_1d_3(self):\n # dummy_array is \"bug for bug\" equiv to Numeric.array\n # on wrapping of indices.\n self.generic_1d('a[-11:]')\n def check_1d_4(self): \n self.generic_1d('a[:1]')\n def check_1d_5(self): \n self.generic_1d('a[:-1]')\n def check_1d_6(self): \n self.generic_1d('a[:-11]')\n def check_1d_7(self): \n self.generic_1d('a[1:5]')\n def check_1d_8(self): \n self.generic_1d('a[1:-5]')\n def check_1d_9(self):\n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[-1:-5]')\n except IndexError: pass \n def check_1d_10(self): \n self.generic_1d('a[-5:-1]')\n \n def check_1d_stride_0(self): \n self.generic_1d('a[::1]') \n def check_1d_stride_1(self): \n self.generic_1d('a[::-1]') \n def check_1d_stride_2(self): \n self.generic_1d('a[1::1]') \n def check_1d_stride_3(self): \n self.generic_1d('a[1::-1]') \n def check_1d_stride_4(self): \n # don't support zero length slicing at the moment.\n try: self.generic_1d('a[1:5:-1]') \n except IndexError: pass \n def check_1d_stride_5(self): \n self.generic_1d('a[5:1:-1]') \n def check_1d_stride_6(self): \n self.generic_1d('a[:4:1]') \n def check_1d_stride_7(self): \n self.generic_1d('a[:4:-1]') \n def check_1d_stride_8(self): \n self.generic_1d('a[:-4:1]') \n def check_1d_stride_9(self): \n self.generic_1d('a[:-4:-1]') \n def check_1d_stride_10(self): \n self.generic_1d('a[:-3:2]') \n def check_1d_stride_11(self): \n self.generic_1d('a[:-3:-2]') \n def check_1d_stride_12(self): \n self.generic_1d('a[:-3:-7]') \n def check_1d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50\n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n self.generic_1d('a[%s:%s:%s]' %(beg,end,step)) \n except IndexError:\n pass\n\n def check_2d_0(self):\n self.generic_2d('a[:]')\n def check_2d_1(self):\n self.generic_2d('a[:2]')\n def check_2d_2(self):\n self.generic_2d('a[:,:]')\n def check_2d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n beg = whrandom.choice(choices)\n end = whrandom.choice(choices)\n step = whrandom.choice(choices) \n beg2 = whrandom.choice(choices)\n end2 = whrandom.choice(choices)\n step2 = whrandom.choice(choices) \n expr = 'a[%s:%s:%s,%s:%s:%s]' %(beg,end,step,beg2,end2,step2)\n self.generic_2d(expr) \n except IndexError:\n pass\n def check_3d_random(self):\n \"\"\" through a bunch of different indexes at it for good measure.\n \"\"\"\n import whrandom\n choices = map(lambda x: `x`,range(50)) + range(50) + ['']*50 \n for i in range(100):\n try:\n idx = []\n for i in range(9):\n idx.append(whrandom.choice(choices))\n expr = 'a[%s:%s:%s,%s:%s:%s,%s:%s:%s]' % tuple(idx)\n self.generic_3d(expr) \n except IndexError:\n pass\n\nclass test_reduction(unittest.TestCase):\n def check_1d_0(self):\n a = ones((5,))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_0(self):\n a = ones((5,10))\n actual = size_check.reduction(a,0)\n desired = size_check.dummy_array((10,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_2d_1(self):\n a = ones((5,10))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_3d_0(self):\n a = ones((5,6,7))\n actual = size_check.reduction(a,1)\n desired = size_check.dummy_array((5,7),1)\n array_assert_equal('',actual.shape,desired.shape) \n def check_error0(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,-2)\n except ValueError:\n pass \n def check_error1(self):\n a = ones((5,))\n try:\n actual = size_check.reduction(a,1)\n except ValueError:\n pass \n\nclass test_expressions(unittest.TestCase): \n def array_assert_equal(self,test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint \n try:\n assert(alltrue(equal(actual,desired))) \n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n def generic_test(self,expr,desired,**kw):\n import parser\n ast_list = parser.expr(expr).tolist()\n args = harvest_variables(ast_list)\n loc = locals().update(kw)\n for var in args:\n s='%s = size_check.dummy_array(%s)'% (var,var)\n exec(s,loc)\n try: \n actual = eval(expr,locals()).shape \n except:\n actual = 'failed' \n if actual is 'failed' and desired is 'failed':\n return\n try: \n self.array_assert_equal(expr,actual,desired)\n except:\n print 'EXPR:',expr\n print 'ACTUAL:',actual\n print 'DEISRED:',desired\n def generic_wrap(self,expr,**kw):\n try:\n x = array(eval(expr,kw))\n try:\n desired = x.shape\n except:\n desired = zeros(())\n except:\n desired = 'failed'\n self.generic_test(expr,desired,**kw)\n def check_generic_1d(self):\n a = arange(10) \n expr = 'a[:]' \n self.generic_wrap(expr,a=a)\n expr = 'a[:] + a' \n self.generic_wrap(expr,a=a)\n bad_expr = 'a[4:] + a' \n self.generic_wrap(bad_expr,a=a)\n a = arange(10) \n b = ones((1,10))\n expr = 'a + b' \n self.generic_wrap(expr,a=a,b=b)\n bad_expr = 'a[:5] + b' \n self.generic_wrap(bad_expr,a=a,b=b)\n def check_single_index(self): \n a = arange(10) \n expr = 'a[5] + a[3]' \n self.generic_wrap(expr,a=a)\n \n def check_calculated_index(self): \n a = arange(10) \n nx = 0\n expr = 'a[5] + a[nx+3]' \n size_check.check_expr(expr,locals())\n def check_calculated_index2(self): \n a = arange(10) \n nx = 0\n expr = 'a[1:5] + a[nx+1:5+nx]' \n size_check.check_expr(expr,locals())\n def generic_2d(self,expr):\n a = ones((10,20))\n self.generic_wrap(a,expr)\n def generic_3d(self,expr):\n a = ones((10,20,1))\n self.generic_wrap(a,expr)\n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_make_same_length,'check_') )\n suites.append( unittest.makeSuite(test_binary_op_size,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array,'check_') )\n suites.append( unittest.makeSuite(test_dummy_array_indexing,'check_') )\n suites.append( unittest.makeSuite(test_reduction,'check_') )\n suites.append( unittest.makeSuite(test_expressions,'check_') )\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 120, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 18, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_scalar", + "long_name": "check_x_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_scalar", + "long_name": "check_y_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 54, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_short", + "long_name": "check_x_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 58, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_short", + "long_name": "check_y_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 68, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 72, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "val" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x1", + "long_name": "check_x1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 85, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y1", + "long_name": "check_y1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y", + "long_name": "check_x_y( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y2", + "long_name": "check_x_y2( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y3", + "long_name": "check_x_y3( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y4", + "long_name": "check_x_y4( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 105, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y5", + "long_name": "check_x_y5( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y6", + "long_name": "check_x_y6( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y7", + "long_name": "check_x_y7( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_error2", + "long_name": "check_error2( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 76, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 130, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 106, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 145, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 157, + "end_line": 162, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "val" + ], + "start_line": 163, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 167, + "end_line": 181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , ary , expr , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "ary", + "expr", + "desired" + ], + "start_line": 182, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , a , expr )", + "filename": "test_size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "a", + "expr" + ], + "start_line": 187, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "generic_1d", + "long_name": "generic_1d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "expr" + ], + "start_line": 197, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_1d_index", + "long_name": "generic_1d_index( self , expr )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self", + "expr" + ], + "start_line": 207, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_0", + "long_name": "check_1d_index_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 212, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_1", + "long_name": "check_1d_index_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 214, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_2", + "long_name": "check_1d_index_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 216, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_3", + "long_name": "check_1d_index_3( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_calculated", + "long_name": "check_1d_index_calculated( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 221, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 223, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_1", + "long_name": "check_1d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 225, + "end_line": 226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_2", + "long_name": "check_1d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_3", + "long_name": "check_1d_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 229, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_4", + "long_name": "check_1d_4( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_5", + "long_name": "check_1d_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_6", + "long_name": "check_1d_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_7", + "long_name": "check_1d_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 239, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_8", + "long_name": "check_1d_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 242, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_9", + "long_name": "check_1d_9( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_10", + "long_name": "check_1d_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_0", + "long_name": "check_1d_stride_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_1", + "long_name": "check_1d_stride_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_2", + "long_name": "check_1d_stride_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_3", + "long_name": "check_1d_stride_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_4", + "long_name": "check_1d_stride_4( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 258, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_5", + "long_name": "check_1d_stride_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 262, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_6", + "long_name": "check_1d_stride_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_7", + "long_name": "check_1d_stride_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 266, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_8", + "long_name": "check_1d_stride_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_9", + "long_name": "check_1d_stride_9( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 270, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_10", + "long_name": "check_1d_stride_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 272, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_11", + "long_name": "check_1d_stride_11( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 274, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_12", + "long_name": "check_1d_stride_12( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 276, + "end_line": 277, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_random", + "long_name": "check_1d_random( self )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 3, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 278, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 294, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_2", + "long_name": "check_2d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_random", + "long_name": "check_2d_random( self )", + "filename": "test_size_check.py", + "nloc": 15, + "complexity": 3, + "token_count": 120, + "parameters": [ + "self" + ], + "start_line": 298, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_3d_random", + "long_name": "check_3d_random( self )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 315, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 336, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3d_0", + "long_name": "check_3d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_error0", + "long_name": "check_error0( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 357, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 365, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired , ** kw )", + "filename": "test_size_check.py", + "nloc": 20, + "complexity": 6, + "token_count": 117, + "parameters": [ + "self", + "expr", + "desired", + "kw" + ], + "start_line": 380, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , expr , ** kw )", + "filename": "test_size_check.py", + "nloc": 10, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "expr", + "kw" + ], + "start_line": 400, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_generic_1d", + "long_name": "check_generic_1d( self )", + "filename": "test_size_check.py", + "nloc": 14, + "complexity": 1, + "token_count": 100, + "parameters": [ + "self" + ], + "start_line": 410, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 424, + "end_line": 427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index", + "long_name": "check_calculated_index( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index2", + "long_name": "check_calculated_index2( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 434, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 439, + "end_line": 441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 104, + "parameters": [ + "level" + ], + "start_line": 446, + "end_line": 456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 458, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 17, + "complexity": 3, + "token_count": 120, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 18, + "end_line": 37, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 41, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 46, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_scalar", + "long_name": "check_x_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 50, + "end_line": 53, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_scalar", + "long_name": "check_y_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 46, + "parameters": [ + "self" + ], + "start_line": 54, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_short", + "long_name": "check_x_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 58, + "end_line": 61, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y_short", + "long_name": "check_y_short( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self" + ], + "start_line": 62, + "end_line": 65, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 32, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 68, + "end_line": 71, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 72, + "end_line": 78, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "val" + ], + "start_line": 79, + "end_line": 80, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_scalar", + "long_name": "check_scalar( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 33, + "parameters": [ + "self" + ], + "start_line": 81, + "end_line": 84, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x1", + "long_name": "check_x1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 85, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_y1", + "long_name": "check_y1( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 89, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y", + "long_name": "check_x_y( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 93, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y2", + "long_name": "check_x_y2( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 97, + "end_line": 100, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y3", + "long_name": "check_x_y3( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 101, + "end_line": 104, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y4", + "long_name": "check_x_y4( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 105, + "end_line": 108, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y5", + "long_name": "check_x_y5( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 109, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y6", + "long_name": "check_x_y6( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 42, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_x_y7", + "long_name": "check_x_y7( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 124, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_error2", + "long_name": "check_error2( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 28, + "parameters": [ + "self" + ], + "start_line": 125, + "end_line": 127, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 76, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 130, + "end_line": 144, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , x , y , desired )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 106, + "parameters": [ + "self", + "x", + "y", + "desired" + ], + "start_line": 145, + "end_line": 156, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "generic_error_test", + "long_name": "generic_error_test( self , x , y )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 29, + "parameters": [ + "self", + "x", + "y" + ], + "start_line": 157, + "end_line": 162, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "desired_type", + "long_name": "desired_type( self , val )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "val" + ], + "start_line": 163, + "end_line": 164, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 167, + "end_line": 181, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , ary , expr , desired )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "ary", + "expr", + "desired" + ], + "start_line": 182, + "end_line": 186, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , a , expr )", + "filename": "test_size_check.py", + "nloc": 9, + "complexity": 3, + "token_count": 59, + "parameters": [ + "self", + "a", + "expr" + ], + "start_line": 187, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "generic_1d", + "long_name": "generic_1d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 21, + "parameters": [ + "self", + "expr" + ], + "start_line": 197, + "end_line": 199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 200, + "end_line": 202, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 203, + "end_line": 205, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_1d_index", + "long_name": "generic_1d_index( self , expr )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 30, + "parameters": [ + "self", + "expr" + ], + "start_line": 207, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_0", + "long_name": "check_1d_index_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 212, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_1", + "long_name": "check_1d_index_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 214, + "end_line": 215, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_2", + "long_name": "check_1d_index_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 216, + "end_line": 217, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_3", + "long_name": "check_1d_index_3( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 218, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_1d_index_calculated", + "long_name": "check_1d_index_calculated( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 221, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 223, + "end_line": 224, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_1", + "long_name": "check_1d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 225, + "end_line": 226, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_2", + "long_name": "check_1d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_3", + "long_name": "check_1d_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 229, + "end_line": 232, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_4", + "long_name": "check_1d_4( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 233, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_5", + "long_name": "check_1d_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_6", + "long_name": "check_1d_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 237, + "end_line": 238, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_7", + "long_name": "check_1d_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 239, + "end_line": 240, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_8", + "long_name": "check_1d_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 241, + "end_line": 242, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_9", + "long_name": "check_1d_9( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 243, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_10", + "long_name": "check_1d_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 248, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_0", + "long_name": "check_1d_stride_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 250, + "end_line": 251, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_1", + "long_name": "check_1d_stride_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 252, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_2", + "long_name": "check_1d_stride_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 254, + "end_line": 255, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_3", + "long_name": "check_1d_stride_3( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 256, + "end_line": 257, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_4", + "long_name": "check_1d_stride_4( self )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 2, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 258, + "end_line": 261, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_5", + "long_name": "check_1d_stride_5( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 262, + "end_line": 263, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_6", + "long_name": "check_1d_stride_6( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 264, + "end_line": 265, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_7", + "long_name": "check_1d_stride_7( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 266, + "end_line": 267, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_8", + "long_name": "check_1d_stride_8( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 268, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_9", + "long_name": "check_1d_stride_9( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 270, + "end_line": 271, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_10", + "long_name": "check_1d_stride_10( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 272, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_11", + "long_name": "check_1d_stride_11( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 274, + "end_line": 275, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_stride_12", + "long_name": "check_1d_stride_12( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 276, + "end_line": 277, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_1d_random", + "long_name": "check_1d_random( self )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 3, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 278, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 292, + "end_line": 293, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 294, + "end_line": 295, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_2", + "long_name": "check_2d_2( self )", + "filename": "test_size_check.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 296, + "end_line": 297, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_2d_random", + "long_name": "check_2d_random( self )", + "filename": "test_size_check.py", + "nloc": 15, + "complexity": 3, + "token_count": 120, + "parameters": [ + "self" + ], + "start_line": 298, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "check_3d_random", + "long_name": "check_3d_random( self )", + "filename": "test_size_check.py", + "nloc": 12, + "complexity": 4, + "token_count": 86, + "parameters": [ + "self" + ], + "start_line": 315, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_1d_0", + "long_name": "check_1d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 331, + "end_line": 335, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_0", + "long_name": "check_2d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 336, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_2d_1", + "long_name": "check_2d_1( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 50, + "parameters": [ + "self" + ], + "start_line": 341, + "end_line": 345, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_3d_0", + "long_name": "check_3d_0( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 346, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_error0", + "long_name": "check_error0( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 351, + "end_line": 356, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_error1", + "long_name": "check_error1( self )", + "filename": "test_size_check.py", + "nloc": 6, + "complexity": 2, + "token_count": 30, + "parameters": [ + "self" + ], + "start_line": 357, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "array_assert_equal", + "long_name": "array_assert_equal( self , test_string , actual , desired )", + "filename": "test_size_check.py", + "nloc": 13, + "complexity": 2, + "token_count": 82, + "parameters": [ + "self", + "test_string", + "actual", + "desired" + ], + "start_line": 365, + "end_line": 379, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "generic_test", + "long_name": "generic_test( self , expr , desired , ** kw )", + "filename": "test_size_check.py", + "nloc": 20, + "complexity": 6, + "token_count": 117, + "parameters": [ + "self", + "expr", + "desired", + "kw" + ], + "start_line": 380, + "end_line": 399, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "generic_wrap", + "long_name": "generic_wrap( self , expr , ** kw )", + "filename": "test_size_check.py", + "nloc": 10, + "complexity": 3, + "token_count": 55, + "parameters": [ + "self", + "expr", + "kw" + ], + "start_line": 400, + "end_line": 409, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_generic_1d", + "long_name": "check_generic_1d( self )", + "filename": "test_size_check.py", + "nloc": 14, + "complexity": 1, + "token_count": 100, + "parameters": [ + "self" + ], + "start_line": 410, + "end_line": 423, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "check_single_index", + "long_name": "check_single_index( self )", + "filename": "test_size_check.py", + "nloc": 4, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 424, + "end_line": 427, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index", + "long_name": "check_calculated_index( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 429, + "end_line": 433, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_calculated_index2", + "long_name": "check_calculated_index2( self )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self" + ], + "start_line": 434, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "generic_2d", + "long_name": "generic_2d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "expr" + ], + "start_line": 439, + "end_line": 441, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "generic_3d", + "long_name": "generic_3d( self , expr )", + "filename": "test_size_check.py", + "nloc": 3, + "complexity": 1, + "token_count": 27, + "parameters": [ + "self", + "expr" + ], + "start_line": 442, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_size_check.py", + "nloc": 11, + "complexity": 2, + "token_count": 104, + "parameters": [ + "level" + ], + "start_line": 446, + "end_line": 456, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_size_check.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 458, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 421, + "complexity": 117, + "token_count": 3159, + "diff_parsed": { + "added": [ + " pass # scipy_base.fastumath not available" + ], + "deleted": [ + " pass # fastumath not available" + ] + } + }, + { + "old_path": "weave/tests/test_standard_array_spec.py", + "new_path": "weave/tests/test_standard_array_spec.py", + "filename": "test_standard_array_spec.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,7 +4,7 @@\n try:\n from scipy_base.fastumath import *\n except:\n- pass # fastumath not available \n+ pass # scipy_base.fastumath not available \n import RandomArray\n import time\n \n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # scipy_base.fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport standard_array_spec\nrestore_path()\n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_array_converter(unittest.TestCase): \n def check_type_match_string(self):\n s = standard_array_spec.array_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = standard_array_spec.array_converter() \n assert(not s.type_match(5))\n def check_type_match_array(self):\n s = standard_array_spec.array_converter() \n assert(s.type_match(arange(4)))\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_array_converter,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "source_code_before": "import unittest\nfrom Numeric import *\n# The following try/except so that non-SciPy users can still use blitz\ntry:\n from scipy_base.fastumath import *\nexcept:\n pass # fastumath not available \nimport RandomArray\nimport time\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\n\nadd_grandparent_to_path(__name__)\nimport standard_array_spec\nrestore_path()\n\ndef remove_whitespace(in_str):\n import string\n out = string.replace(in_str,\" \",\"\")\n out = string.replace(out,\"\\t\",\"\")\n out = string.replace(out,\"\\n\",\"\")\n return out\n \ndef print_assert_equal(test_string,actual,desired):\n \"\"\"this should probably be in scipy_base.testing\n \"\"\"\n import pprint\n try:\n assert(actual == desired)\n except AssertionError:\n import cStringIO\n msg = cStringIO.StringIO()\n msg.write(test_string)\n msg.write(' failed\\nACTUAL: \\n')\n pprint.pprint(actual,msg)\n msg.write('DESIRED: \\n')\n pprint.pprint(desired,msg)\n raise AssertionError, msg.getvalue()\n\nclass test_array_converter(unittest.TestCase): \n def check_type_match_string(self):\n s = standard_array_spec.array_converter()\n assert( not s.type_match('string') )\n def check_type_match_int(self):\n s = standard_array_spec.array_converter() \n assert(not s.type_match(5))\n def check_type_match_array(self):\n s = standard_array_spec.array_converter() \n assert(s.type_match(arange(4)))\n\ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_array_converter,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\nif __name__ == \"__main__\":\n test()\n", + "methods": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 17, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_standard_array_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 24, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_array", + "long_name": "check_type_match_array( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_standard_array_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 59, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "remove_whitespace", + "long_name": "remove_whitespace( in_str )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 1, + "token_count": 45, + "parameters": [ + "in_str" + ], + "start_line": 17, + "end_line": 22, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "print_assert_equal", + "long_name": "print_assert_equal( test_string , actual , desired )", + "filename": "test_standard_array_spec.py", + "nloc": 13, + "complexity": 2, + "token_count": 74, + "parameters": [ + "test_string", + "actual", + "desired" + ], + "start_line": 24, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "check_type_match_string", + "long_name": "check_type_match_string( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 41, + "end_line": 43, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_int", + "long_name": "check_type_match_int( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 44, + "end_line": 46, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_type_match_array", + "long_name": "check_type_match_array( self )", + "filename": "test_standard_array_spec.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "self" + ], + "start_line": 47, + "end_line": 49, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_standard_array_spec.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "level" + ], + "start_line": 51, + "end_line": 57, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_standard_array_spec.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 59, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 54, + "complexity": 9, + "token_count": 315, + "diff_parsed": { + "added": [ + " pass # scipy_base.fastumath not available" + ], + "deleted": [ + " pass # fastumath not available" + ] + } + } + ] + }, + { + "hash": "17ea2ead1f794accc763cda67045fb1b7697ccc9", + "msg": "Changed == None to is None", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-05T17:04:48+00:00", + "author_timezone": 0, + "committer_date": "2002-04-05T17:04:48+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "ad8ff90e28c2798e23d4edc0ea8d424569b7b8c3" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 14, + "insertions": 14, + "lines": 28, + "files": 6, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_distutils/mingw32_support.py", + "new_path": "scipy_distutils/mingw32_support.py", + "filename": "mingw32_support.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -41,7 +41,7 @@ def build_import_library():\n \n import lib2def\n #libfile, deffile = parse_cmd()\n- #if deffile == None:\n+ #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\"\nSupport code for building Python extensions on Windows.\n\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n\n\"\"\"\n\nimport os, sys\nimport distutils.ccompiler\n\n# I'd really like to pull this out of scipy and make it part of distutils...\nimport scipy_distutils.command.build_flib as build_flib\n\n\nif sys.platform == 'win32':\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n \n # 1. Build libpython from .lib and .dll if they don't exist. \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if sys.platform == 'win32':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n #print full_path\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n # lib2def lives in weave\n sys.path.append(os.path.join('.','weave'))\n\n import lib2def\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n print cmd\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print \"WARNING: failed to build import library for gcc. \"\\\n \"Linking will fail.\"\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \n def set_windows_compiler(compiler):\n distutils.ccompiler._default_compilers = (\n \n # Platform string mappings\n \n # on a cygwin built python we can use gcc like an ordinary UNIXish\n # compiler\n ('cygwin.*', 'unix'),\n \n # OS name mappings\n ('posix', 'unix'),\n ('nt', compiler),\n ('mac', 'mwerks'),\n \n ) \n def use_msvc():\n set_windows_compiler('msvc')\n \n def use_gcc(): \n set_windows_compiler('mingw32') \n \n standard_compiler_list = build_flib.all_compilers[:]\n def use_g77():\n build_flib.all_compilers = [build_flib.gnu_fortran_compiler] \n \n def use_standard_fortran_compiler():\n build_flib.all_compilers = standard_compiler_list\n \n # 2. force the use of gcc on windows platform\n use_gcc()\n # 3. force the use of g77 on windows platform\n use_g77()\n if not import_library_exists():\n build_import_library()\n\n \n", + "source_code_before": "\"\"\"\nSupport code for building Python extensions on Windows.\n\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n\n\"\"\"\n\nimport os, sys\nimport distutils.ccompiler\n\n# I'd really like to pull this out of scipy and make it part of distutils...\nimport scipy_distutils.command.build_flib as build_flib\n\n\nif sys.platform == 'win32':\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n \n # 1. Build libpython from .lib and .dll if they don't exist. \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if sys.platform == 'win32':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n #print full_path\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n # lib2def lives in weave\n sys.path.append(os.path.join('.','weave'))\n\n import lib2def\n #libfile, deffile = parse_cmd()\n #if deffile == None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n print cmd\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print \"WARNING: failed to build import library for gcc. \"\\\n \"Linking will fail.\"\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \n def set_windows_compiler(compiler):\n distutils.ccompiler._default_compilers = (\n \n # Platform string mappings\n \n # on a cygwin built python we can use gcc like an ordinary UNIXish\n # compiler\n ('cygwin.*', 'unix'),\n \n # OS name mappings\n ('posix', 'unix'),\n ('nt', compiler),\n ('mac', 'mwerks'),\n \n ) \n def use_msvc():\n set_windows_compiler('msvc')\n \n def use_gcc(): \n set_windows_compiler('mingw32') \n \n standard_compiler_list = build_flib.all_compilers[:]\n def use_g77():\n build_flib.all_compilers = [build_flib.gnu_fortran_compiler] \n \n def use_standard_fortran_compiler():\n build_flib.all_compilers = standard_compiler_list\n \n # 2. force the use of gcc on windows platform\n use_gcc()\n # 3. force the use of g77 on windows platform\n use_g77()\n if not import_library_exists():\n build_import_library()\n\n \n", + "methods": [ + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 25, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 21, + "complexity": 2, + "token_count": 209, + "parameters": [], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + }, + { + "name": "set_windows_compiler", + "long_name": "set_windows_compiler( compiler )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 1, + "token_count": 37, + "parameters": [ + "compiler" + ], + "start_line": 72, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "use_msvc", + "long_name": "use_msvc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_gcc", + "long_name": "use_gcc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 90, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_g77", + "long_name": "use_g77( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_standard_fortran_compiler", + "long_name": "use_standard_fortran_compiler( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 97, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 25, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 21, + "complexity": 2, + "token_count": 209, + "parameters": [], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + }, + { + "name": "set_windows_compiler", + "long_name": "set_windows_compiler( compiler )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 1, + "token_count": 37, + "parameters": [ + "compiler" + ], + "start_line": 72, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "use_msvc", + "long_name": "use_msvc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_gcc", + "long_name": "use_gcc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 90, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_g77", + "long_name": "use_g77( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_standard_fortran_compiler", + "long_name": "use_standard_fortran_compiler( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 97, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 21, + "complexity": 2, + "token_count": 209, + "parameters": [], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + } + ], + "nloc": 61, + "complexity": 10, + "token_count": 395, + "diff_parsed": { + "added": [ + " #if deffile is None:" + ], + "deleted": [ + " #if deffile == None:" + ] + } + }, + { + "old_path": "weave/accelerate_tools.py", + "new_path": "weave/accelerate_tools.py", + "filename": "accelerate_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -17,7 +17,7 @@\n \n def CStr(s):\n \"Hacky way to get legal C string from Python string\"\n- if s == None: return '\"\"'\n+ if s is None: return '\"\"'\n assert type(s) == StringType,\"Only None and string allowed\"\n r = repr('\"'+s) # Better for embedded quotes\n return '\"'+r[2:-1]+'\"'\n@@ -198,7 +198,7 @@ def __init__(self, function, *args, **kw):\n assert type(function) == FunctionType\n self.function = function\n self.module = inspect.getmodule(function)\n- if self.module == None:\n+ if self.module is None:\n import __main__\n self.module = __main__\n self.__call_map = {}\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "#**************************************************************************#\n#* FILE ************** accelerate_tools.py ************************#\n#**************************************************************************#\n#* Author: Patrick Miller February 9 2002 *#\n#**************************************************************************#\n\"\"\"\naccelerate_tools contains the interface for on-the-fly building of\nC++ equivalents to Python functions.\n\"\"\"\n#**************************************************************************#\n\nfrom types import FunctionType,IntType,FloatType,StringType,TypeType,XRangeType\nimport inspect\nimport md5\nimport weave\nfrom bytecodecompiler import CXXCoder,Type_Descriptor,Function_Descriptor\n\ndef CStr(s):\n \"Hacky way to get legal C string from Python string\"\n if s is None: return '\"\"'\n assert type(s) == StringType,\"Only None and string allowed\"\n r = repr('\"'+s) # Better for embedded quotes\n return '\"'+r[2:-1]+'\"'\n\nclass Basic(Type_Descriptor):\n def check(self,s):\n return \"%s(%s)\"%(self.checker,s)\n def inbound(self,s):\n return \"%s(%s)\"%(self.inbounder,s)\n def outbound(self,s):\n return \"%s(%s)\"%(self.outbounder,s)\n\nclass Basic_Number(Basic):\n def literalizer(self,s):\n return str(s)\n def binop(self,symbol,a,b):\n assert symbol in ['+','-','*','/'],symbol\n return '%s %s %s'%(a,symbol,b),self\n\nclass Integer(Basic_Number):\n cxxtype = \"long\"\n checker = \"PyInt_Check\"\n inbounder = \"PyInt_AsLong\"\n outbounder = \"PyInt_FromLong\"\n\nclass Double(Basic_Number):\n cxxtype = \"double\"\n checker = \"PyFloat_Check\"\n inbounder = \"PyFloat_AsDouble\"\n outbounder = \"PyFloat_FromDouble\"\n\nclass String(Basic):\n cxxtype = \"char*\"\n checker = \"PyString_Check\"\n inbounder = \"PyString_AsString\"\n outbounder = \"PyString_FromString\"\n\n def literalizer(self,s):\n return CStr(s)\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nInteger = Integer()\nDouble = Double()\nString = String()\n\nimport Numeric\n\nclass Vector(Type_Descriptor):\n cxxtype = 'PyArrayObject*'\n refcount = 1\n dims = 1\n module_init_code = 'import_array();'\n\n prerequisites = Type_Descriptor.prerequisites+\\\n ['#include \"Numeric/arrayobject.h\"']\n dims = 1\n def check(self,s):\n return \"PyArray_Check(%s) && ((PyArrayObject*)%s)->nd == %d && ((PyArrayObject*)%s)->descr->type_num == %s\"%(\n s,s,self.dims,s,self.typecode)\n def inbound(self,s):\n return \"(PyArrayObject*)(%s)\"%s\n def outbound(self,s):\n return \"(PyObject*)(%s)\"%s\n def getitem(self,A,v,t):\n assert self.dims == len(v),'Expect dimension %d'%self.dims\n code = '*((%s*)(%s->data'%(self.cxxbase,A)\n for i in range(self.dims):\n # assert that ''t[i]'' is an integer\n code += '+%s*%s->strides[%d]'%(v[i],A,i)\n code += '))'\n return code,self.pybase\n def setitem(self,A,v,t):\n return self.getitem(A,v,t)\n\nclass matrix(Vector):\n dims = 2\n\nclass IntegerVector(Vector):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass Integermatrix(matrix):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass LongVector(Vector):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass Longmatrix(matrix):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass DoubleVector(Vector):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass Doublematrix(matrix):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass XRange(Type_Descriptor):\n cxxtype = 'XRange'\n prerequisites = ['''\n class XRange {\n public:\n XRange(long aLow, long aHigh, long aStep=1)\n : low(aLow),high(aHigh),step(aStep)\n {\n }\n long low;\n long high;\n long step;\n };''']\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nIntegerVector = IntegerVector()\nIntegermatrix = Integermatrix()\nLongVector = LongVector()\nLongmatrix = Longmatrix()\nDoubleVector = DoubleVector()\nDoublematrix = Doublematrix()\nXRange = XRange()\n\ntypedefs = {\n IntType: Integer,\n FloatType: Double,\n StringType: String,\n (Numeric.ArrayType,1,'i'): IntegerVector,\n (Numeric.ArrayType,2,'i'): Integermatrix,\n (Numeric.ArrayType,1,'l'): LongVector,\n (Numeric.ArrayType,2,'l'): Longmatrix,\n (Numeric.ArrayType,1,'d'): DoubleVector,\n (Numeric.ArrayType,2,'d'): Doublematrix,\n XRangeType : XRange,\n }\n\nimport math\nfunctiondefs = {\n (range,(Integer,Integer)):\n Function_Descriptor(code='XRange(%s)',return_type=XRange),\n\n (math.sin,(Double,)):\n Function_Descriptor(code='sin(%s)',return_type=Double),\n\n (math.sqrt,(Double,)):\n Function_Descriptor(code='sqrt(%s)',return_type=Double),\n }\n \n\n\n##################################################################\n# FUNCTION LOOKUP_TYPE #\n##################################################################\ndef lookup_type(x):\n T = type(x)\n try:\n return typedefs[T]\n except:\n return typedefs[(T,len(x.shape),x.typecode())]\n\n##################################################################\n# class ACCELERATE #\n##################################################################\nclass accelerate:\n \n def __init__(self, function, *args, **kw):\n assert type(function) == FunctionType\n self.function = function\n self.module = inspect.getmodule(function)\n if self.module is None:\n import __main__\n self.module = __main__\n self.__call_map = {}\n\n def __cache(self,*args):\n raise TypeError\n\n def __call__(self,*args):\n try:\n return self.__cache(*args)\n except TypeError:\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n \n # If we know the function, call it\n try:\n fast = self.__call_map[signature]\n except:\n fast = self.singleton(signature)\n self.__cache = fast\n self.__call_map[signature] = fast\n return fast(*args)\n\n def signature(self,*args):\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n return self.singleton(signature)\n\n\n def singleton(self,signature):\n identifier = self.identifier(signature)\n \n # Generate a new function, then call it\n f = self.function\n\n # See if we have an accelerated version of module\n try:\n accelerated_module = __import__(self.module.__name__+'_weave')\n fast = getattr(accelerated_module,identifier)\n return fast\n except:\n accelerated_module = None\n\n P = self.accelerate(signature,identifier)\n\n E = weave.ext_tools.ext_module(self.module.__name__+'_weave')\n E.add_function(P)\n E.generate_file()\n weave.build_tools.build_extension(self.module.__name__+'_weave.cpp',verbose=2)\n\n if accelerated_module:\n accelerated_module = reload(accelerated_module)\n else:\n accelerated_module = __import__(self.module.__name__+'_weave')\n\n fast = getattr(accelerated_module,identifier)\n return fast\n\n def identifier(self,signature):\n # Build an MD5 checksum\n f = self.function\n co = f.func_code\n identifier = str(signature)+\\\n str(co.co_argcount)+\\\n str(co.co_consts)+\\\n str(co.co_varnames)+\\\n co.co_code\n return 'F'+md5.md5(identifier).hexdigest()\n \n def accelerate(self,signature,identifier):\n P = Python2CXX(self.function,signature,name=identifier)\n return P\n\n def code(self,*args):\n if len(args) != self.function.func_code.co_argcount:\n raise TypeError,'%s() takes exactly %d arguments (%d given)'%(\n self.function.__name__,\n self.function.func_code.co_argcount,\n len(args))\n signature = tuple( map(lookup_type,args) )\n ident = self.function.__name__\n return self.accelerate(signature,ident).function_code()\n \n\n##################################################################\n# CLASS PYTHON2CXX #\n##################################################################\nclass Python2CXX(CXXCoder):\n def typedef_by_value(self,v):\n T = lookup_type(v)\n if T not in self.used:\n self.used.append(T)\n return T\n\n def function_by_signature(self,signature):\n descriptor = functiondefs[signature]\n if descriptor.return_type not in self.used:\n self.used.append(descriptor.return_type)\n return descriptor\n\n def __init__(self,f,signature,name=None):\n # Make sure function is a function\n import types\n assert type(f) == FunctionType\n # and check the input type signature\n assert reduce(lambda x,y: x and y,\n map(lambda x: isinstance(x,Type_Descriptor),\n signature),\n 1),'%s not all type objects'%signature\n self.arg_specs = []\n self.customize = weave.base_info.custom_info()\n\n CXXCoder.__init__(self,f,signature,name)\n\n return\n\n def function_code(self):\n code = self.wrapped_code()\n for T in self.used:\n if T != None and T.module_init_code:\n self.customize.add_module_init_code(T.module_init_code)\n return code\n\n def python_function_definition_code(self):\n return '{ \"%s\", wrapper_%s, METH_VARARGS, %s },\\n'%(\n self.name,\n self.name,\n CStr(self.function.__doc__))\n", + "source_code_before": "#**************************************************************************#\n#* FILE ************** accelerate_tools.py ************************#\n#**************************************************************************#\n#* Author: Patrick Miller February 9 2002 *#\n#**************************************************************************#\n\"\"\"\naccelerate_tools contains the interface for on-the-fly building of\nC++ equivalents to Python functions.\n\"\"\"\n#**************************************************************************#\n\nfrom types import FunctionType,IntType,FloatType,StringType,TypeType,XRangeType\nimport inspect\nimport md5\nimport weave\nfrom bytecodecompiler import CXXCoder,Type_Descriptor,Function_Descriptor\n\ndef CStr(s):\n \"Hacky way to get legal C string from Python string\"\n if s == None: return '\"\"'\n assert type(s) == StringType,\"Only None and string allowed\"\n r = repr('\"'+s) # Better for embedded quotes\n return '\"'+r[2:-1]+'\"'\n\nclass Basic(Type_Descriptor):\n def check(self,s):\n return \"%s(%s)\"%(self.checker,s)\n def inbound(self,s):\n return \"%s(%s)\"%(self.inbounder,s)\n def outbound(self,s):\n return \"%s(%s)\"%(self.outbounder,s)\n\nclass Basic_Number(Basic):\n def literalizer(self,s):\n return str(s)\n def binop(self,symbol,a,b):\n assert symbol in ['+','-','*','/'],symbol\n return '%s %s %s'%(a,symbol,b),self\n\nclass Integer(Basic_Number):\n cxxtype = \"long\"\n checker = \"PyInt_Check\"\n inbounder = \"PyInt_AsLong\"\n outbounder = \"PyInt_FromLong\"\n\nclass Double(Basic_Number):\n cxxtype = \"double\"\n checker = \"PyFloat_Check\"\n inbounder = \"PyFloat_AsDouble\"\n outbounder = \"PyFloat_FromDouble\"\n\nclass String(Basic):\n cxxtype = \"char*\"\n checker = \"PyString_Check\"\n inbounder = \"PyString_AsString\"\n outbounder = \"PyString_FromString\"\n\n def literalizer(self,s):\n return CStr(s)\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nInteger = Integer()\nDouble = Double()\nString = String()\n\nimport Numeric\n\nclass Vector(Type_Descriptor):\n cxxtype = 'PyArrayObject*'\n refcount = 1\n dims = 1\n module_init_code = 'import_array();'\n\n prerequisites = Type_Descriptor.prerequisites+\\\n ['#include \"Numeric/arrayobject.h\"']\n dims = 1\n def check(self,s):\n return \"PyArray_Check(%s) && ((PyArrayObject*)%s)->nd == %d && ((PyArrayObject*)%s)->descr->type_num == %s\"%(\n s,s,self.dims,s,self.typecode)\n def inbound(self,s):\n return \"(PyArrayObject*)(%s)\"%s\n def outbound(self,s):\n return \"(PyObject*)(%s)\"%s\n def getitem(self,A,v,t):\n assert self.dims == len(v),'Expect dimension %d'%self.dims\n code = '*((%s*)(%s->data'%(self.cxxbase,A)\n for i in range(self.dims):\n # assert that ''t[i]'' is an integer\n code += '+%s*%s->strides[%d]'%(v[i],A,i)\n code += '))'\n return code,self.pybase\n def setitem(self,A,v,t):\n return self.getitem(A,v,t)\n\nclass matrix(Vector):\n dims = 2\n\nclass IntegerVector(Vector):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass Integermatrix(matrix):\n typecode = 'PyArray_INT'\n cxxbase = 'int'\n pybase = Integer\n\nclass LongVector(Vector):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass Longmatrix(matrix):\n typecode = 'PyArray_LONG'\n cxxbase = 'long'\n pybase = Integer\n\nclass DoubleVector(Vector):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass Doublematrix(matrix):\n typecode = 'PyArray_DOUBLE'\n cxxbase = 'double'\n pybase = Double\n\nclass XRange(Type_Descriptor):\n cxxtype = 'XRange'\n prerequisites = ['''\n class XRange {\n public:\n XRange(long aLow, long aHigh, long aStep=1)\n : low(aLow),high(aHigh),step(aStep)\n {\n }\n long low;\n long high;\n long step;\n };''']\n\n# -----------------------------------------------\n# Singletonize the type names\n# -----------------------------------------------\nIntegerVector = IntegerVector()\nIntegermatrix = Integermatrix()\nLongVector = LongVector()\nLongmatrix = Longmatrix()\nDoubleVector = DoubleVector()\nDoublematrix = Doublematrix()\nXRange = XRange()\n\ntypedefs = {\n IntType: Integer,\n FloatType: Double,\n StringType: String,\n (Numeric.ArrayType,1,'i'): IntegerVector,\n (Numeric.ArrayType,2,'i'): Integermatrix,\n (Numeric.ArrayType,1,'l'): LongVector,\n (Numeric.ArrayType,2,'l'): Longmatrix,\n (Numeric.ArrayType,1,'d'): DoubleVector,\n (Numeric.ArrayType,2,'d'): Doublematrix,\n XRangeType : XRange,\n }\n\nimport math\nfunctiondefs = {\n (range,(Integer,Integer)):\n Function_Descriptor(code='XRange(%s)',return_type=XRange),\n\n (math.sin,(Double,)):\n Function_Descriptor(code='sin(%s)',return_type=Double),\n\n (math.sqrt,(Double,)):\n Function_Descriptor(code='sqrt(%s)',return_type=Double),\n }\n \n\n\n##################################################################\n# FUNCTION LOOKUP_TYPE #\n##################################################################\ndef lookup_type(x):\n T = type(x)\n try:\n return typedefs[T]\n except:\n return typedefs[(T,len(x.shape),x.typecode())]\n\n##################################################################\n# class ACCELERATE #\n##################################################################\nclass accelerate:\n \n def __init__(self, function, *args, **kw):\n assert type(function) == FunctionType\n self.function = function\n self.module = inspect.getmodule(function)\n if self.module == None:\n import __main__\n self.module = __main__\n self.__call_map = {}\n\n def __cache(self,*args):\n raise TypeError\n\n def __call__(self,*args):\n try:\n return self.__cache(*args)\n except TypeError:\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n \n # If we know the function, call it\n try:\n fast = self.__call_map[signature]\n except:\n fast = self.singleton(signature)\n self.__cache = fast\n self.__call_map[signature] = fast\n return fast(*args)\n\n def signature(self,*args):\n # Figure out type info -- Do as tuple so its hashable\n signature = tuple( map(lookup_type,args) )\n return self.singleton(signature)\n\n\n def singleton(self,signature):\n identifier = self.identifier(signature)\n \n # Generate a new function, then call it\n f = self.function\n\n # See if we have an accelerated version of module\n try:\n accelerated_module = __import__(self.module.__name__+'_weave')\n fast = getattr(accelerated_module,identifier)\n return fast\n except:\n accelerated_module = None\n\n P = self.accelerate(signature,identifier)\n\n E = weave.ext_tools.ext_module(self.module.__name__+'_weave')\n E.add_function(P)\n E.generate_file()\n weave.build_tools.build_extension(self.module.__name__+'_weave.cpp',verbose=2)\n\n if accelerated_module:\n accelerated_module = reload(accelerated_module)\n else:\n accelerated_module = __import__(self.module.__name__+'_weave')\n\n fast = getattr(accelerated_module,identifier)\n return fast\n\n def identifier(self,signature):\n # Build an MD5 checksum\n f = self.function\n co = f.func_code\n identifier = str(signature)+\\\n str(co.co_argcount)+\\\n str(co.co_consts)+\\\n str(co.co_varnames)+\\\n co.co_code\n return 'F'+md5.md5(identifier).hexdigest()\n \n def accelerate(self,signature,identifier):\n P = Python2CXX(self.function,signature,name=identifier)\n return P\n\n def code(self,*args):\n if len(args) != self.function.func_code.co_argcount:\n raise TypeError,'%s() takes exactly %d arguments (%d given)'%(\n self.function.__name__,\n self.function.func_code.co_argcount,\n len(args))\n signature = tuple( map(lookup_type,args) )\n ident = self.function.__name__\n return self.accelerate(signature,ident).function_code()\n \n\n##################################################################\n# CLASS PYTHON2CXX #\n##################################################################\nclass Python2CXX(CXXCoder):\n def typedef_by_value(self,v):\n T = lookup_type(v)\n if T not in self.used:\n self.used.append(T)\n return T\n\n def function_by_signature(self,signature):\n descriptor = functiondefs[signature]\n if descriptor.return_type not in self.used:\n self.used.append(descriptor.return_type)\n return descriptor\n\n def __init__(self,f,signature,name=None):\n # Make sure function is a function\n import types\n assert type(f) == FunctionType\n # and check the input type signature\n assert reduce(lambda x,y: x and y,\n map(lambda x: isinstance(x,Type_Descriptor),\n signature),\n 1),'%s not all type objects'%signature\n self.arg_specs = []\n self.customize = weave.base_info.custom_info()\n\n CXXCoder.__init__(self,f,signature,name)\n\n return\n\n def function_code(self):\n code = self.wrapped_code()\n for T in self.used:\n if T != None and T.module_init_code:\n self.customize.add_module_init_code(T.module_init_code)\n return code\n\n def python_function_definition_code(self):\n return '{ \"%s\", wrapper_%s, METH_VARARGS, %s },\\n'%(\n self.name,\n self.name,\n CStr(self.function.__doc__))\n", + "methods": [ + { + "name": "CStr", + "long_name": "CStr( s )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 42, + "parameters": [ + "s" + ], + "start_line": 18, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 28, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 30, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 34, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , symbol , a , b )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "symbol", + "a", + "b" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 58, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "s" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 82, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getitem", + "long_name": "getitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 7, + "complexity": 2, + "token_count": 70, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 86, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "setitem", + "long_name": "setitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "lookup_type", + "long_name": "lookup_type( x )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 40, + "parameters": [ + "x" + ], + "start_line": 185, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , * args , ** kw )", + "filename": "accelerate_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 55, + "parameters": [ + "self", + "function", + "args", + "kw" + ], + "start_line": 197, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__cache", + "long_name": "__cache( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "args" + ], + "start_line": 206, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 71, + "parameters": [ + "self", + "args" + ], + "start_line": 209, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "signature", + "long_name": "signature( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "args" + ], + "start_line": 225, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "singleton", + "long_name": "singleton( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 20, + "complexity": 3, + "token_count": 137, + "parameters": [ + "self", + "signature" + ], + "start_line": 231, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 1 + }, + { + "name": "identifier", + "long_name": "identifier( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self", + "signature" + ], + "start_line": 260, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "accelerate", + "long_name": "accelerate( self , signature , identifier )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "signature", + "identifier" + ], + "start_line": 271, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "code", + "long_name": "code( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "args" + ], + "start_line": 275, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self", + "v" + ], + "start_line": 290, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "function_by_signature", + "long_name": "function_by_signature( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "signature" + ], + "start_line": 296, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , f , signature , name = None )", + "filename": "accelerate_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 85, + "parameters": [ + "self", + "f", + "signature", + "name" + ], + "start_line": 302, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 4, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 318, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "CStr", + "long_name": "CStr( s )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 42, + "parameters": [ + "s" + ], + "start_line": 18, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 26, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 28, + "end_line": 29, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "s" + ], + "start_line": 30, + "end_line": 31, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 34, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , symbol , a , b )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self", + "symbol", + "a", + "b" + ], + "start_line": 36, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "literalizer", + "long_name": "literalizer( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "s" + ], + "start_line": 58, + "end_line": 59, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check", + "long_name": "check( self , s )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "s" + ], + "start_line": 79, + "end_line": 81, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "inbound", + "long_name": "inbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 82, + "end_line": 83, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "outbound", + "long_name": "outbound( self , s )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "s" + ], + "start_line": 84, + "end_line": 85, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "getitem", + "long_name": "getitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 7, + "complexity": 2, + "token_count": 70, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 86, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "setitem", + "long_name": "setitem( self , A , v , t )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self", + "A", + "v", + "t" + ], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "lookup_type", + "long_name": "lookup_type( x )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 40, + "parameters": [ + "x" + ], + "start_line": 185, + "end_line": 190, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , * args , ** kw )", + "filename": "accelerate_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 55, + "parameters": [ + "self", + "function", + "args", + "kw" + ], + "start_line": 197, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "__cache", + "long_name": "__cache( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "args" + ], + "start_line": 206, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__call__", + "long_name": "__call__( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 71, + "parameters": [ + "self", + "args" + ], + "start_line": 209, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "signature", + "long_name": "signature( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "args" + ], + "start_line": 225, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "singleton", + "long_name": "singleton( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 20, + "complexity": 3, + "token_count": 137, + "parameters": [ + "self", + "signature" + ], + "start_line": 231, + "end_line": 258, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 28, + "top_nesting_level": 1 + }, + { + "name": "identifier", + "long_name": "identifier( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 1, + "token_count": 65, + "parameters": [ + "self", + "signature" + ], + "start_line": 260, + "end_line": 269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "accelerate", + "long_name": "accelerate( self , signature , identifier )", + "filename": "accelerate_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 25, + "parameters": [ + "self", + "signature", + "identifier" + ], + "start_line": 271, + "end_line": 273, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "code", + "long_name": "code( self , * args )", + "filename": "accelerate_tools.py", + "nloc": 9, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "args" + ], + "start_line": 275, + "end_line": 283, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 31, + "parameters": [ + "self", + "v" + ], + "start_line": 290, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "function_by_signature", + "long_name": "function_by_signature( self , signature )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 2, + "token_count": 35, + "parameters": [ + "self", + "signature" + ], + "start_line": 296, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , f , signature , name = None )", + "filename": "accelerate_tools.py", + "nloc": 11, + "complexity": 2, + "token_count": 85, + "parameters": [ + "self", + "f", + "signature", + "name" + ], + "start_line": 302, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "function_code", + "long_name": "function_code( self )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 4, + "token_count": 40, + "parameters": [ + "self" + ], + "start_line": 318, + "end_line": 323, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "python_function_definition_code", + "long_name": "python_function_definition_code( self )", + "filename": "accelerate_tools.py", + "nloc": 5, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self" + ], + "start_line": 325, + "end_line": 329, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "__init__", + "long_name": "__init__( self , function , * args , ** kw )", + "filename": "accelerate_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 55, + "parameters": [ + "self", + "function", + "args", + "kw" + ], + "start_line": 197, + "end_line": 204, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "CStr", + "long_name": "CStr( s )", + "filename": "accelerate_tools.py", + "nloc": 6, + "complexity": 2, + "token_count": 42, + "parameters": [ + "s" + ], + "start_line": 18, + "end_line": 23, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + } + ], + "nloc": 246, + "complexity": 41, + "token_count": 1506, + "diff_parsed": { + "added": [ + " if s is None: return '\"\"'", + " if self.module is None:" + ], + "deleted": [ + " if s == None: return '\"\"'", + " if self.module == None:" + ] + } + }, + { + "old_path": "weave/build_tools.py", + "new_path": "weave/build_tools.py", + "filename": "build_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -420,7 +420,7 @@ def build_import_library():\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n- #if deffile == None:\n+ #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists():\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('gcc -v')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system('gcc -v')\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "source_code_before": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists():\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('gcc -v')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system('gcc -v')\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile == None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "methods": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 30, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 42, + "end_line": 212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 215, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 230, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 238, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 282, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 317, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 354, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 408, + "end_line": 416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 30, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 42, + "end_line": 212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 215, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 230, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 238, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 282, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 317, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 354, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 408, + "end_line": 416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + } + ], + "nloc": 225, + "complexity": 55, + "token_count": 1409, + "diff_parsed": { + "added": [ + " #if deffile is None:" + ], + "deleted": [ + " #if deffile == None:" + ] + } + }, + { + "old_path": "weave/bytecodecompiler.py", + "new_path": "weave/bytecodecompiler.py", + "filename": "bytecodecompiler.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -200,7 +200,7 @@ def listing(f):\n lastLine = arg\n else:\n source = ''\n- if arg == None: arg = ''\n+ if arg is None: arg = ''\n s += '%3d] %20s %5s : %s\\n'%(pc,name,arg,source)\n if op >= haveArgument:\n pc += 3\n@@ -225,7 +225,7 @@ def fetch(self, pc,code):\n def execute(self,pc,opcode,argument):\n name = byOpcode[opcode]\n method = getattr(self,name)\n- if argument == None:\n+ if argument is None:\n return apply(method,(pc,))\n else:\n return apply(method,(pc,argument,))\n@@ -235,7 +235,7 @@ def evaluate(self, pc,code):\n goto = self.execute(next,opcode,argument)\n if goto == -1:\n return None # Must be done\n- elif goto == None:\n+ elif goto is None:\n return next # Normal\n else:\n raise 'xx'\n@@ -690,7 +690,7 @@ def typedef_by_value(self,v):\n def __init__(self,function,signature,name=None):\n assert type(function) == FunctionType,\"Arg must be a user function\"\n assert not function.func_defaults ,\"Function cannot have default args (yet)\"\n- if name == None: name = function.func_name\n+ if name is None: name = function.func_name\n self.name = name\n self.function = function\n self.signature = signature\n@@ -765,7 +765,7 @@ def generate(self):\n # -----------------------------------------------\n code += '#include \"Python.h\"\\n'\n for T in self.used:\n- if T == None: continue\n+ if T is None: continue\n for pre in T.prerequisites:\n code += pre\n code += '\\n'\n@@ -1147,7 +1147,7 @@ def LOAD_FAST(self,pc,var_num):\n print 'LOADFAST',var_num,v,t\n for VV,TT in map(None, self.stack, self.types):\n print VV,':',TT\n- if t == None:\n+ if t is None:\n raise TypeError,'%s used before set?'%v\n print self.__body\n print 'PC',pc\n@@ -1233,7 +1233,7 @@ def STORE_FAST(self,pc,var_num):\n \n # See if type is same....\n # Note that None means no assignment made yet\n- if saveT == None or t == saveT:\n+ if saveT is None or t == saveT:\n if t.refcount:\n self.emit('Py_XINCREF(%s);'%v)\n self.emit('Py_XDECREF(%s);'%save)\n", + "added_lines": 7, + "deleted_lines": 7, + "source_code": "#**************************************************************************#\n#* FILE ************** bytecodecompiler.py ************************#\n#************************************************************************ **#\n#* Author: Patrick Miller February 9 2002 *#\n#* Copyright (C) 2002 Patrick J. Miller *#\n#**************************************************************************#\n#* *#\n#**************************************************************************#\nfrom types import *\nimport string\nimport inspect\n\n##################################################################\n# CLASS __DESCRIPTOR #\n##################################################################\nclass __Descriptor:\n prerequisites = []\n refcount = 0\n def __repr__(self):\n return self.__module__+'.'+self.__class__.__name__\n\n##################################################################\n# CLASS TYPE_DESCRIPTOR #\n##################################################################\nclass Type_Descriptor(__Descriptor):\n module_init_code = ''\n\n##################################################################\n# CLASS FUNCTION_DESCRIPTOR #\n##################################################################\nclass Function_Descriptor(__Descriptor):\n def __init__(self,code,return_type,support=''):\n\tself.code\t= code\n\tself.return_type\t= return_type\n self.support = support\n\treturn\n\n \n \n\nhaveArgument = 90 # Opcodes greater-equal to this have argument\nbyName = {\n 'STOP_CODE': 0,\n 'POP_TOP': 1,\n 'ROT_TWO': 2,\n 'ROT_THREE': 3,\n 'DUP_TOP': 4,\n 'ROT_FOUR': 5,\n 'UNARY_POSITIVE': 10,\n 'UNARY_NEGATIVE': 11,\n 'UNARY_NOT': 12,\n 'UNARY_CONVERT': 13,\n 'UNARY_INVERT': 15,\n 'BINARY_POWER': 19,\n 'BINARY_MULTIPLY': 20,\n 'BINARY_DIVIDE': 21,\n 'BINARY_MODULO': 22,\n 'BINARY_ADD': 23,\n 'BINARY_SUBTRACT': 24,\n 'BINARY_SUBSCR': 25,\n 'BINARY_FLOOR_DIVIDE': 26,\n 'BINARY_TRUE_DIVIDE': 27,\n 'INPLACE_FLOOR_DIVIDE': 28,\n 'INPLACE_TRUE_DIVIDE': 29,\n 'SLICE': 30,\n 'STORE_SLICE': 40,\n 'DELETE_SLICE': 50,\n 'INPLACE_ADD': 55,\n 'INPLACE_SUBTRACT': 56,\n 'INPLACE_MULTIPLY': 57,\n 'INPLACE_DIVIDE': 58,\n 'INPLACE_MODULO': 59,\n 'STORE_SUBSCR': 60,\n 'DELETE_SUBSCR': 61,\n 'BINARY_LSHIFT': 62,\n 'BINARY_RSHIFT': 63,\n 'BINARY_AND': 64,\n 'BINARY_XOR': 65,\n 'BINARY_OR': 66,\n 'INPLACE_POWER': 67,\n 'GET_ITER': 68,\n 'PRINT_EXPR': 70,\n 'PRINT_ITEM': 71,\n 'PRINT_NEWLINE': 72,\n 'PRINT_ITEM_TO': 73,\n 'PRINT_NEWLINE_TO': 74,\n 'INPLACE_LSHIFT': 75,\n 'INPLACE_RSHIFT': 76,\n 'INPLACE_AND': 77,\n 'INPLACE_XOR': 78,\n 'INPLACE_OR': 79,\n 'BREAK_LOOP': 80,\n 'LOAD_LOCALS': 82,\n 'RETURN_VALUE': 83,\n 'IMPORT_STAR': 84,\n 'EXEC_STMT': 85,\n 'YIELD_VALUE': 86,\n 'POP_BLOCK': 87,\n 'END_FINALLY': 88,\n 'BUILD_CLASS': 89,\n 'STORE_NAME': 90,\n 'DELETE_NAME': 91,\n 'UNPACK_SEQUENCE': 92,\n 'FOR_ITER': 93,\n 'STORE_ATTR': 95,\n 'DELETE_ATTR': 96,\n 'STORE_GLOBAL': 97,\n 'DELETE_GLOBAL': 98,\n 'DUP_TOPX': 99,\n 'LOAD_CONST': 100,\n 'LOAD_NAME': 101,\n 'BUILD_TUPLE': 102,\n 'BUILD_LIST': 103,\n 'BUILD_MAP': 104,\n 'LOAD_ATTR': 105,\n 'COMPARE_OP': 106,\n 'IMPORT_NAME': 107,\n 'IMPORT_FROM': 108,\n 'JUMP_FORWARD': 110,\n 'JUMP_IF_FALSE': 111,\n 'JUMP_IF_TRUE': 112,\n 'JUMP_ABSOLUTE': 113,\n 'FOR_LOOP': 114,\n 'LOAD_GLOBAL': 116,\n 'CONTINUE_LOOP': 119,\n 'SETUP_LOOP': 120,\n 'SETUP_EXCEPT': 121,\n 'SETUP_FINALLY': 122,\n 'LOAD_FAST': 124,\n 'STORE_FAST': 125,\n 'DELETE_FAST': 126,\n 'SET_LINENO': 127,\n 'RAISE_VARARGS': 130,\n 'CALL_FUNCTION': 131,\n 'MAKE_FUNCTION': 132,\n 'BUILD_SLICE': 133,\n 'MAKE_CLOSURE': 134,\n 'LOAD_CLOSURE': 135,\n 'LOAD_DEREF': 136,\n 'STORE_DEREF': 137,\n 'CALL_FUNCTION_VAR': 140,\n 'CALL_FUNCTION_KW': 141,\n 'CALL_FUNCTION_VAR_KW': 142,\n }\n\n# -----------------------------------------------\n# Build one in the reverse sense\n# -----------------------------------------------\nbyOpcode = {}\nfor name,op in map(None, byName.keys(), byName.values()):\n byOpcode[op] = name\n del name\n del op\n \n\n##################################################################\n# FUNCTION OPCODIZE #\n##################################################################\ndef opcodize(s):\n \"Slightly more readable form\"\n length = len(s)\n i = 0\n answer = []\n while i < length:\n bytecode = ord(s[i])\n name = byOpcode[bytecode]\n if bytecode >= haveArgument:\n argument = 256*ord(s[i+2])+ord(s[i+1])\n i += 3\n else:\n argument = None\n i += 1\n answer.append((bytecode,argument,name))\n return answer\n\n\n\n##################################################################\n# FUNCTION LIST #\n##################################################################\ndef listing(f):\n \"Pretty print the internals of your function\"\n assert type(f) == FunctionType,\"Arg %r must be a function\"%f\n filename = f.func_code.co_filename\n try:\n lines = open(filename).readlines()\n except:\n lines = None\n pc = 0\n s = ''\n lastLine = None\n for op,arg,name in opcodize(f.func_code.co_code):\n if lines and name == 'SET_LINENO':\n source = lines[arg-1][:-1]\n while lastLine and lastLine < arg-1:\n nonEmittingSource = lines[lastLine][:-1]\n lastLine += 1\n s += '%3s %20s %5s : %s\\n'%(\n '','','',nonEmittingSource)\n lastLine = arg\n else:\n source = ''\n if arg is None: arg = ''\n s += '%3d] %20s %5s : %s\\n'%(pc,name,arg,source)\n if op >= haveArgument:\n pc += 3\n else:\n pc += 1\n return s\n\n##################################################################\n# CLASS BYTECODEMEANING #\n##################################################################\nclass ByteCodeMeaning:\n def fetch(self, pc,code):\n opcode = ord(code[pc])\n if opcode >= haveArgument:\n argument = 256*ord(code[pc+2])+ord(code[pc+1])\n next = pc+3\n else:\n argument = None\n next = pc+1\n return next,opcode,argument\n \n def execute(self,pc,opcode,argument):\n name = byOpcode[opcode]\n method = getattr(self,name)\n if argument is None:\n return apply(method,(pc,))\n else:\n return apply(method,(pc,argument,))\n\n def evaluate(self, pc,code):\n next, opcode,argument = self.fetch(pc,code)\n goto = self.execute(next,opcode,argument)\n if goto == -1:\n return None # Must be done\n elif goto is None:\n return next # Normal\n else:\n raise 'xx'\n\n symbols = { 0: 'less', 1: 'lesseq', 2: 'equal', 3: 'notequal',\n 4: 'greater', 5: 'greatereq', 6: 'in', 7: 'not in',\n 8: 'is', 9: 'is not', 10: 'exe match',\n 11 : 'bad',\n }\n def cmp_op(self,opname):\n return self.symbols[opname]\n \n def STOP_CODE(self,pc):\n \"Indicates end-of-code to the compiler, not used by the interpreter.\"\n raise NotImplementedError\n def POP_TOP(self,pc):\n \"Removes the top-of-stack (TOS) item.\"\n raise NotImplementedError\n\n def ROT_TWO(self,pc):\n \"Swaps the two top-most stack items.\"\n raise NotImplementedError\n\n def ROT_THREE(self,pc):\n \"Lifts second and third stack item one position up, moves top down to position three.\"\n raise NotImplementedError\n\n def ROT_FOUR(self,pc):\n \"Lifts second, third and forth stack item one position up, moves top down to position four.\"\n raise NotImplementedError\n\n def DUP_TOP(self,pc):\n \"Duplicates the reference on top of the stack.\"\n raise NotImplementedError\n\n # Unary Operations take the top of the stack, apply the operation, and push the result back on the stack.\n\n def UNARY_POSITIVE(self,pc):\n \"Implements TOS = +TOS.\"\n raise NotImplementedError\n\n def UNARY_NEGATIVE(self,pc):\n \"Implements TOS = -TOS.\"\n raise NotImplementedError\n\n def UNARY_NOT(self,pc):\n \"Implements TOS = not TOS.\"\n raise NotImplementedError\n\n def UNARY_CONVERT(self,pc):\n \"Implements TOS = `TOS`.\"\n raise NotImplementedError\n\n def UNARY_INVERT(self,pc):\n \"Implements TOS = ~TOS.\"\n raise NotImplementedError\n\n #Binary operations remove the top of the stack (TOS) and the second top-most stack item (TOS1) from the stack. They perform the operation, and put the result back on the stack.\n\n def BINARY_POWER(self,pc):\n \"Implements TOS = TOS1 ** TOS.\"\n raise NotImplementedError\n\n def BINARY_MULTIPLY(self,pc):\n \"Implements TOS = TOS1 * TOS.\"\n raise NotImplementedError\n\n def BINARY_DIVIDE(self,pc):\n \"Implements TOS = TOS1 / TOS.\"\n raise NotImplementedError\n\n def BINARY_MODULO(self,pc):\n \"Implements TOS = TOS1 % TOS.\"\n raise NotImplementedError\n\n def BINARY_ADD(self,pc):\n \"Implements TOS = TOS1 + TOS.\"\n raise NotImplementedError\n\n def BINARY_SUBTRACT(self,pc):\n \"Implements TOS = TOS1 - TOS.\"\n raise NotImplementedError\n\n def BINARY_SUBSCR(self,pc):\n \"Implements TOS = TOS1[TOS].\"\n raise NotImplementedError\n\n def BINARY_LSHIFT(self,pc):\n \"Implements TOS = TOS1 << TOS.\"\n raise NotImplementedError\n\n def BINARY_RSHIFT(self,pc):\n \"Implements TOS = TOS1 >> TOS.\"\n raise NotImplementedError\n\n def BINARY_AND(self,pc):\n \"Implements TOS = TOS1 & TOS.\"\n raise NotImplementedError\n\n def BINARY_XOR(self,pc):\n \"Implements TOS = TOS1 ^ TOS.\"\n raise NotImplementedError\n\n def BINARY_OR(self,pc):\n \"Implements TOS = TOS1 | TOS.\"\n raise NotImplementedError\n\n #In-place operations are like binary operations, in that they remove TOS and TOS1, and push the result back on the stack, but the operation is done in-place when TOS1 supports it, and the resulting TOS may be (but does not have to be) the original TOS1.\n\n def INPLACE_POWER(self,pc):\n \"Implements in-place TOS = TOS1 ** TOS.\"\n raise NotImplementedError\n\n def INPLACE_MULTIPLY(self,pc):\n \"Implements in-place TOS = TOS1 * TOS.\"\n raise NotImplementedError\n\n def INPLACE_DIVIDE(self,pc):\n \"Implements in-place TOS = TOS1 / TOS.\"\n raise NotImplementedError\n\n def INPLACE_MODULO(self,pc):\n \"Implements in-place TOS = TOS1 % TOS.\"\n raise NotImplementedError\n\n def INPLACE_ADD(self,pc):\n \"Implements in-place TOS = TOS1 + TOS.\"\n raise NotImplementedError\n\n def INPLACE_SUBTRACT(self,pc):\n \"Implements in-place TOS = TOS1 - TOS.\"\n raise NotImplementedError\n\n def INPLACE_LSHIFT(self,pc):\n \"Implements in-place TOS = TOS1 << TOS.\"\n raise NotImplementedError\n\n def INPLACE_RSHIFT(self,pc):\n \"Implements in-place TOS = TOS1 >> TOS.\"\n raise NotImplementedError\n\n def INPLACE_AND(self,pc):\n \"Implements in-place TOS = TOS1 & TOS.\"\n raise NotImplementedError\n\n def INPLACE_XOR(self,pc):\n \"Implements in-place TOS = TOS1 ^ TOS.\"\n raise NotImplementedError\n\n def INPLACE_OR(self,pc):\n \"Implements in-place TOS = TOS1 | TOS.\"\n raise NotImplementedError\n\n #The slice opcodes take up to three parameters.\n\n def SLICE_0(self,pc):\n \"Implements TOS = TOS[:].\"\n raise NotImplementedError\n\n def SLICE_1(self,pc):\n \"Implements TOS = TOS1[TOS:].\"\n raise NotImplementedError\n\n def SLICE_2(self,pc):\n \"Implements TOS = TOS1[:TOS1].\"\n raise NotImplementedError\n\n def SLICE_3(self,pc):\n \"Implements TOS = TOS2[TOS1:TOS].\"\n raise NotImplementedError\n\n #Slice assignment needs even an additional parameter. As any statement, they put nothing on the stack.\n\n def STORE_SLICE_0(self,pc):\n \"Implements TOS[:] = TOS1.\"\n raise NotImplementedError\n\n def STORE_SLICE_1(self,pc):\n \"Implements TOS1[TOS:] = TOS2.\"\n raise NotImplementedError\n\n def STORE_SLICE_2(self,pc):\n \"Implements TOS1[:TOS] = TOS2.\"\n raise NotImplementedError\n\n def STORE_SLICE_3(self,pc):\n \"Implements TOS2[TOS1:TOS] = TOS3.\"\n raise NotImplementedError\n\n def DELETE_SLICE_0(self,pc):\n \"Implements del TOS[:].\"\n raise NotImplementedError\n\n def DELETE_SLICE_1(self,pc):\n \"Implements del TOS1[TOS:].\"\n raise NotImplementedError\n\n def DELETE_SLICE_2(self,pc):\n \"Implements del TOS1[:TOS].\"\n raise NotImplementedError\n\n def DELETE_SLICE_3(self,pc):\n \"Implements del TOS2[TOS1:TOS].\"\n raise NotImplementedError\n\n def STORE_SUBSCR(self,pc):\n \"Implements TOS1[TOS] = TOS2.\"\n raise NotImplementedError\n\n def DELETE_SUBSCR(self,pc):\n \"Implements del TOS1[TOS].\"\n raise NotImplementedError\n\n def PRINT_EXPR(self,pc):\n \"Implements the expression statement for the interactive mode. TOS is removed from the stack and printed. In non-interactive mode, an expression statement is terminated with POP_STACK.\"\n raise NotImplementedError\n\n def PRINT_ITEM(self,pc):\n \"Prints TOS to the file-like object bound to sys.stdout. There is one such instruction for each item in the print statement.\"\n raise NotImplementedError\n\n def PRINT_ITEM_TO(self,pc):\n \"Like PRINT_ITEM, but prints the item second from TOS to the file-like object at TOS. This is used by the extended print statement.\"\n raise NotImplementedError\n\n def PRINT_NEWLINE(self,pc):\n \"Prints a new line on sys.stdout. This is generated as the last operation of a print statement, unless the statement ends with a comma.\"\n raise NotImplementedError\n\n def PRINT_NEWLINE_TO(self,pc):\n \"Like PRINT_NEWLINE, but prints the new line on the file-like object on the TOS. This is used by the extended print statement.\"\n raise NotImplementedError\n\n def BREAK_LOOP(self,pc):\n \"Terminates a loop due to a break statement.\"\n raise NotImplementedError\n\n def LOAD_LOCALS(self,pc):\n \"Pushes a reference to the locals of the current scope on the stack. This is used in the code for a class definition: After the class body is evaluated, the locals are passed to the class definition.\"\n raise NotImplementedError\n\n def RETURN_VALUE(self,pc):\n \"Returns with TOS to the caller of the function.\"\n raise NotImplementedError\n\n def IMPORT_STAR(self,pc):\n \"Loads all symbols not starting with _ directly from the module TOS to the local namespace. The module is popped after loading all names. This opcode implements from module import *.\"\n raise NotImplementedError\n\n def EXEC_STMT(self,pc):\n \"Implements exec TOS2,TOS1,TOS. The compiler fills missing optional parameters with None.\"\n raise NotImplementedError\n\n def POP_BLOCK(self,pc):\n \"Removes one block from the block stack. Per frame, there is a stack of blocks, denoting nested loops, try statements, and such.\"\n raise NotImplementedError\n\n def END_FINALLY(self,pc):\n \"Terminates a finally clause. The interpreter recalls whether the exception has to be re-raised, or whether the function returns, and continues with the outer-next block.\"\n raise NotImplementedError\n\n def BUILD_CLASS(self,pc):\n \"Creates a new class object. TOS is the methods dictionary, TOS1 the tuple of the names of the base classes, and TOS2 the class name.\"\n raise NotImplementedError\n\n #All of the following opcodes expect arguments. An argument is two bytes, with the more significant byte last.\n\n def STORE_NAME(self,pc,namei):\n \"Implements name = TOS. namei is the index of name in the attribute co_names of the code object. The compiler tries to use STORE_LOCAL or STORE_GLOBAL if possible.\"\n raise NotImplementedError\n\n def DELETE_NAME(self,pc,namei):\n \"Implements del name, where namei is the index into co_names attribute of the code object.\"\n raise NotImplementedError\n\n def UNPACK_SEQUENCE(self,pc,count):\n \"Unpacks TOS into count individual values, which are put onto the stack right-to-left.\"\n raise NotImplementedError\n\n def DUP_TOPX(self,pc,count):\n \"Duplicate count items, keeping them in the same order. Due to implementation limits, count should be between 1 and 5 inclusive.\"\n raise NotImplementedError\n\n def STORE_ATTR(self,pc,namei):\n \"Implements TOS.name = TOS1, where namei is the index of name in co_names.\"\n raise NotImplementedError\n\n def DELETE_ATTR(self,pc,namei):\n \"Implements del TOS.name, using namei as index into co_names.\"\n raise NotImplementedError\n\n def STORE_GLOBAL(self,pc,namei):\n \"Works as STORE_NAME, but stores the name as a global.\"\n raise NotImplementedError\n\n def DELETE_GLOBAL(self,pc,namei):\n \"Works as DELETE_NAME, but deletes a global name.\"\n raise NotImplementedError\n\n def LOAD_CONST(self,pc,consti):\n \"Pushes co_consts[consti] onto the stack.\"\n raise NotImplementedError\n\n def LOAD_NAME(self,pc,namei):\n \"Pushes the value associated with co_names[namei] onto the stack.\"\n raise NotImplementedError\n\n def BUILD_TUPLE(self,pc,count):\n \"Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack.\"\n raise NotImplementedError\n\n def BUILD_LIST(self,pc,count):\n \"Works as BUILD_TUPLE, but creates a list.\"\n raise NotImplementedError\n\n def BUILD_MAP(self,pc,zero):\n \"Pushes a new empty dictionary object onto the stack. The argument is ignored and set to zero by the compiler.\"\n raise NotImplementedError\n\n def LOAD_ATTR(self,pc,namei):\n \"Replaces TOS with getattr(TOS, co_names[namei].\"\n raise NotImplementedError\n\n def COMPARE_OP(self,pc,opname):\n \"Performs a Boolean operation. The operation name can be found in cmp_op[opname].\"\n raise NotImplementedError\n\n def IMPORT_NAME(self,pc,namei):\n \"Imports the module co_names[namei]. The module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent STORE_FAST instruction modifies the namespace.\"\n raise NotImplementedError\n\n def IMPORT_FROM(self,pc,namei):\n \"Loads the attribute co_names[namei] from the module found in TOS. The resulting object is pushed onto the stack, to be subsequently stored by a STORE_FAST instruction.\"\n raise NotImplementedError\n\n def JUMP_FORWARD(self,pc,delta):\n \"Increments byte code counter by delta.\"\n raise NotImplementedError\n\n def JUMP_IF_TRUE(self,pc,delta):\n \"If TOS is true, increment the byte code counter by delta. TOS is left on the stack.\"\n raise NotImplementedError\n\n def JUMP_IF_FALSE(self,pc,delta):\n \"If TOS is false, increment the byte code counter by delta. TOS is not changed.\"\n raise NotImplementedError\n\n def JUMP_ABSOLUTE(self,pc,target):\n \"Set byte code counter to target.\"\n raise NotImplementedError\n\n def FOR_LOOP(self,pc,delta):\n \"Iterate over a sequence. TOS is the current index, TOS1 the sequence. First, the next element is computed. If the sequence is exhausted, increment byte code counter by delta. Otherwise, push the sequence, the incremented counter, and the current item onto the stack.\"\n raise NotImplementedError\n\n def LOAD_GLOBAL(self,pc,namei):\n \"Loads the global named co_names[namei] onto the stack.\"\n raise NotImplementedError\n\n def SETUP_LOOP(self,pc,delta):\n \"Pushes a block for a loop onto the block stack. The block spans from the current instruction with a size of delta bytes.\"\n raise NotImplementedError\n\n def SETUP_EXCEPT(self,pc,delta):\n \"Pushes a try block from a try-except clause onto the block stack. delta points to the first except block.\"\n raise NotImplementedError\n\n def SETUP_FINALLY(self,pc,delta):\n \"Pushes a try block from a try-except clause onto the block stack. delta points to the finally block.\"\n raise NotImplementedError\n\n def LOAD_FAST(self,pc,var_num):\n \"Pushes a reference to the local co_varnames[var_num] onto the stack.\"\n raise NotImplementedError\n\n def STORE_FAST(self,pc,var_num):\n \"Stores TOS into the local co_varnames[var_num].\"\n raise NotImplementedError\n\n def DELETE_FAST(self,pc,var_num):\n \"Deletes local co_varnames[var_num].\"\n raise NotImplementedError\n\n def LOAD_CLOSURE(self,pc,i):\n \"Pushes a reference to the cell contained in slot i of the cell and free variable storage. The name of the variable is co_cellvars[i] if i is less than the length of co_cellvars. Otherwise it is co_freevars[i - len(co_cellvars)].\"\n raise NotImplementedError\n\n def LOAD_DEREF(self,pc,i):\n \"Loads the cell contained in slot i of the cell and free variable storage. Pushes a reference to the object the cell contains on the stack.\"\n raise NotImplementedError\n\n def STORE_DEREF(self,pc,i):\n \"Stores TOS into the cell contained in slot i of the cell and free variable storage.\"\n raise NotImplementedError\n\n def SET_LINENO(self,pc,lineno):\n \"Sets the current line number to lineno.\"\n raise NotImplementedError\n\n def RAISE_VARARGS(self,pc,argc):\n \"Raises an exception. argc indicates the number of parameters to the raise statement, ranging from 0 to 3. The handler will find the traceback as TOS2, the parameter as TOS1, and the exception as TOS.\"\n raise NotImplementedError\n\n def CALL_FUNCTION(self,pc,argc):\n \"Calls a function. The low byte of argc indicates the number of positional parameters, the high byte the number of keyword parameters. On the stack, the opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, the function object to call is on the stack.\"\n raise NotImplementedError\n\n def MAKE_FUNCTION(self,pc,argc):\n \"Pushes a new function object on the stack. TOS is the code associated with the function. The function object is defined to have argc default parameters, which are found below TOS.\"\n raise NotImplementedError\n\n def MAKE_CLOSURE(self,pc,argc):\n \"Creates a new function object, sets its func_closure slot, and pushes it on the stack. TOS is the code associated with the function. If the code object has N free variables, the next N items on the stack are the cells for these variables. The function also has argc default parameters, where are found before the cells.\"\n raise NotImplementedError\n\n def BUILD_SLICE(self,pc,argc):\n \"Pushes a slice object on the stack. argc must be 2 or 3. If it is 2, slice(TOS1, TOS) is pushed; if it is 3, slice(TOS2, TOS1, TOS) is pushed. See the slice() built-in function for more information.\"\n raise NotImplementedError\n\n def EXTENDED_ARG(self,pc,ext):\n \"Prefixes any opcode which has an argument too big to fit into the default two bytes. ext holds two additional bytes which, taken together with the subsequent opcode's argument, comprise a four-byte argument, ext being the two most-significant bytes.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_VAR(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the variable argument list, followed by keyword and positional arguments.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_KW(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the keyword arguments dictionary, followed by explicit keyword and positional arguments.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_VAR_KW(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the keyword arguments dictionary, followed by the variable-arguments tuple, followed by explicit keyword and positional arguments.\"\n raise NotImplementedError\n\n \n\n##################################################################\n# CLASS CXXCODER #\n##################################################################\nclass CXXCoder(ByteCodeMeaning):\n\n ##################################################################\n # MEMBER TYPEDEF_BY_VALUE #\n ##################################################################\n def typedef_by_value(self,v):\n raise NotImplementedError # VIRTUAL\n \n ##################################################################\n # MEMBER __INIT__ #\n ##################################################################\n def __init__(self,function,signature,name=None):\n assert type(function) == FunctionType,\"Arg must be a user function\"\n assert not function.func_defaults ,\"Function cannot have default args (yet)\"\n if name is None: name = function.func_name\n self.name = name\n self.function = function\n self.signature = signature\n self.codeobject = function.func_code\n self.__uid = 0 # Builds temps\n self.__indent = 1\n return\n\n ##################################################################\n # MEMBER EVALUATE #\n ##################################################################\n def evaluate(self, pc,code):\n # See if we posted any forwards for this offset\n if self.forwards.has_key(pc):\n for f in self.forwards[pc]:\n f()\n self.forwards[pc] = []\n return ByteCodeMeaning.evaluate(self,pc,code)\n \n ##################################################################\n # MEMBER GENERATE #\n ##################################################################\n def generate(self):\n self.forwards = {} # Actions on forward interprets\n self.__body = '' # Body will be built\n self.helpers = [] # headers and stuff\n\n # -----------------------------------------------\n # OK, crack open the function object and build\n # initial stack (not a real frame!)\n # -----------------------------------------------\n arglen = self.codeobject.co_argcount\n nlocals = self.codeobject.co_nlocals\n\n self.consts = self.codeobject.co_consts\n self.stack = list(self.codeobject.co_varnames)\n self.types = list(self.signature)+[None]*(nlocals-arglen)\n self.used = []\n for T in self.types:\n if T not in self.used: self.used.append(T)\n\n # -----------------------------------------------\n # One pass through the byte codes to generate\n # the body\n # -----------------------------------------------\n code = self.codeobject.co_code\n bytes = len(code)\n pc = 0\n while pc != None and pc < bytes:\n pc = self.evaluate(pc,code)\n\n # -----------------------------------------------\n # Return?\n # -----------------------------------------------\n if self.rtype == NoneType:\n rtype = 'void'\n else:\n rtype = self.rtype.cxxtype\n \n # -----------------------------------------------\n # Insert code body if available\n # -----------------------------------------------\n source = inspect.getsource(self.function)\n if not source: source = ''\n comments = inspect.getcomments(self.function)\n if comments: source = comments+source\n code = string.join(map(lambda x: '/////// '+x,string.split(source,'\\n')),\n '\\n')+'\\n'\n\n # -----------------------------------------------\n # Add in the headers\n # -----------------------------------------------\n code += '#include \"Python.h\"\\n'\n for T in self.used:\n if T is None: continue\n for pre in T.prerequisites:\n code += pre\n code += '\\n'\n\n # -----------------------------------------------\n # Real body\n # -----------------------------------------------\n code += '\\n'\n code += '\\nstatic %s %s('%(rtype,self.name)\n for i in range(len(self.signature)):\n if i != 0: code += ', '\n n = self.stack[i]\n t = self.types[i]\n code += '%s %s'%(t.cxxtype,n)\n code += ') {\\n'\n\n # Add in non-argument temporaries\n # Assuming first argcount locals are positional args\n for i in range(self.codeobject.co_argcount,\n self.codeobject.co_nlocals):\n t = self.types[i]\n code += '%s %s;\\n'%(\n t.cxxtype,\n self.codeobject.co_varnames[i],\n )\n\n # Add in the body\n code += self.__body\n code += '}\\n\\n'\n return code\n\n\n ##################################################################\n # MEMBER WRAPPED_CODE #\n ##################################################################\n def wrapped_code(self):\n code = self.generate()\n \n # -----------------------------------------------\n # Wrapper\n # -----------------------------------------------\n code += 'static PyObject* wrapper_%s(PyObject*,PyObject* args) {\\n'%self.name\n\n code += ' // Length check\\n'\n code += ' if ( PyTuple_Size(args) != %d ) {\\n'%len(self.signature)\n code += ' PyErr_SetString(PyExc_TypeError,\"Expected %d arguments\");\\n'%len(self.signature)\n code += ' return 0;\\n'\n code += ' }\\n'\n\n code += '\\n // Load Py versions of args\\n'\n for i in range(len(self.signature)):\n T = self.signature[i]\n code += ' PyObject* py_%s = PyTuple_GET_ITEM(args,%d);\\n'%(\n self.codeobject.co_varnames[i],i\n )\n\n code += ' if ( !(%s) ) {\\n'% \\\n T.check('py_'+self.codeobject.co_varnames[i])\n #code += ' PyObject_Print(py_A,stdout,0); puts(\"\");\\n'\n #code += ' printf(\"nd=%d typecode=%d\\\\n\",((PyArrayObject*)py_A)->nd,((PyArrayObject*)py_A)->descr->type_num);\\n'\n code += ' PyErr_SetString(PyExc_TypeError,\"Bad type for arg %d (expected %s)\");\\n'%(\n i+1,\n T.__class__.__name__)\n code += ' return 0;\\n'\n code += ' }\\n'\n \n code += '\\n // Do conversions\\n'\n argnames = []\n for i in range(len(self.signature)):\n T = self.signature[i]\n\n code += ' %s %s=%s;\\n'%(\n T.cxxtype,\n self.codeobject.co_varnames[i],\n T.inbound('py_'+self.codeobject.co_varnames[i]),\n )\n code += ' if ( PyErr_Occurred() ) return 0;\\n'\n argnames.append(self.codeobject.co_varnames[i])\n\n code += '\\n // Compute result\\n'\n if self.rtype != NoneType:\n code += ' %s _result = '%(\n self.rtype.cxxtype,\n )\n else:\n code += ' '\n code += '%s(%s);\\n'%(\n self.name,\n string.join(argnames,','),\n )\n\n\n code += '\\n // Pack return\\n'\n if ( self.rtype == NoneType ):\n code += ' Py_INCREF(Py_None);\\n'\n code += ' return Py_None;\\n'\n else:\n result = self.rtype.outbound('_result')\n code += ' return %s;\\n'%result\n code += '}\\n'\n return code\n\n def indent(self):\n self.__indent += 1\n return\n\n def dedent(self):\n self.__indent -= 1\n return\n\n ##################################################################\n # MEMBER EMIT #\n ##################################################################\n def emit(self,s):\n self.__body += ' '*(3*self.__indent)\n self.__body += s\n self.__body += '\\n'\n return\n\n ##################################################################\n # MEMBER PUSH #\n ##################################################################\n def push(self,v,t):\n self.stack.append(v)\n self.types.append(t)\n return\n\n ##################################################################\n # MEMBER POP #\n ##################################################################\n def pop(self):\n v = self.stack[-1]\n assert type(v) != TupleType\n del self.stack[-1]\n t = self.types[-1]\n assert type(t) != TupleType\n del self.types[-1]\n return v,t\n\n ##################################################################\n # MEMBER PUSHTUPLE #\n ##################################################################\n def pushTuple(self,V,T):\n assert type(V) == TupleType\n self.stack.append(V)\n assert type(V) == TupleType\n self.types.append(T)\n return\n\n\n ##################################################################\n # MEMBER POPTUPLE #\n ##################################################################\n def popTuple(self):\n v = self.stack[-1]\n assert type(v) == TupleType\n del self.stack[-1]\n t = self.types[-1]\n assert type(t) == TupleType\n del self.types[-1]\n return v,t\n ##################################################################\n # MEMBER MULTIARG #\n ##################################################################\n def multiarg(self):\n return type(self.stack[-1]) == TupleType\n \n ##################################################################\n # MEMBER UNIQUE #\n ##################################################################\n def unique(self):\n self.__uid += 1\n return 't%d'%self.__uid\n\n ##################################################################\n # MEMBER POST #\n ##################################################################\n def post(self,pc,action):\n if not self.forwards.has_key(pc):\n self.forwards[pc] = []\n self.forwards[pc].append(action)\n return\n\n ##################################################################\n # MEMBER EMIT_VALUE #\n ##################################################################\n def emit_value(self, v):\n descriptor = self.typedef_by_value(v)\n \n # Convert representation to CXX rhs\n rhs = descriptor.literalizer(v)\n lhs = self.unique()\n self.emit('%s %s = %s;'%(\n descriptor.cxxtype,\n lhs,\n rhs))\n self.push(lhs,descriptor)\n return \n\n ##################################################################\n # MEMBER GLOBAL_INFO #\n ##################################################################\n def global_info(self,var_num):\n # This is the name value is known by\n var_name = self.codeobject.co_names[var_num]\n\n # First, figure out who owns this global\n import sys\n myHash = id(self.function.func_globals)\n for module_name in sys.modules.keys():\n module = sys.modules[module_name]\n if module and id(module.__dict__) == myHash:\n break\n else:\n raise ValueError,'Cannot locate module owning %s'%varname\n return module_name,var_name\n\n\n ##################################################################\n # MEMBER CODEUP #\n ##################################################################\n def codeup(self, rhs, rhs_type):\n lhs = self.unique()\n self.emit('%s %s = %s;\\n'%(\n rhs_type.cxxtype,\n lhs,\n rhs))\n print self.__body\n self.push(lhs,rhs_type)\n return \n \n\n ##################################################################\n # MEMBER BINOP #\n ##################################################################\n def binop(self,pc,symbol):\n v2,t2 = self.pop()\n v1,t1 = self.pop()\n\n if t1 == t2:\n rhs,rhs_type = t1.binop(symbol,v1,v2)\n else:\n rhs,rhs_type = t1.binopMixed(symbol,v1,v2,t2)\n\n self.codeup(rhs,rhs_type)\n return\n\n ##################################################################\n # MEMBER BINARY_XXX #\n ##################################################################\n def BINARY_ADD(self,pc):\n return self.binop(pc,'+')\n def BINARY_SUBTRACT(self,pc):\n return self.binop(pc,'-')\n def BINARY_MULTIPLY(self,pc):\n print 'MULTIPLY',self.stack[-2],self.types[-2],'*',self.stack[-1],self.types[-1]\n return self.binop(pc,'*')\n def BINARY_DIVIDE(self,pc):\n return self.binop(pc,'/')\n def BINARY_MODULO(self,pc):\n return self.binop(pc,'%')\n def BINARY_SUBSCR(self,pc):\n if self.multiarg():\n v2,t2 = self.popTuple()\n else:\n v2,t2 = self.pop()\n v2 = (v2,)\n t2 = (t2,)\n v1,t1 = self.pop()\n rhs,rhs_type = t1.getitem(v1,v2,t2)\n self.codeup(rhs,rhs_type)\n return\n\n def STORE_SUBSCR(self,pc):\n if self.multiarg():\n v2,t2 = self.popTuple()\n else:\n v2,t2 = self.pop()\n v2 = (v2,)\n t2 = (t2,)\n v1,t1 = self.pop()\n v0,t0 = self.pop()\n \n rhs,rhs_type = t1.setitem(v1,v2,t2)\n assert rhs_type == t0,\"Store the right thing\"\n self.emit('%s = %s;'%(rhs,v0))\n return\n\n def COMPARE_OP(self,pc,opname):\n symbol = self.cmp_op(opname) # convert numeric to name\n return self.binop(pc,symbol)\n\n\n ##################################################################\n # MEMBER PRINT_ITEM #\n ##################################################################\n def PRINT_ITEM(self,pc):\n # Printing correctly is tricky... best to let Python\n # do the real work here\n w = self.unique()\n self.emit('PyObject* %s = PySys_GetObject(\"stdout\");'%w)\n self.emit('if (PyFile_SoftSpace(%s,1)) PyFile_WriteString(\" \",%s);'%(w,w))\n v,t = self.pop()\n\n py = self.unique()\n self.emit('PyObject* %s = %s;'%(py, t.outbound(v)))\n self.emit('PyFile_WriteObject(%s,%s,Py_PRINT_RAW);'%(\n py,w))\n self.emit('Py_XDECREF(%s);'%py)\n return\n\n\n ##################################################################\n # MEMBER PRINT_NEWLINE #\n ##################################################################\n def PRINT_NEWLINE(self,pc):\n # Printing correctly is tricky... best to let Python\n # do the real work here\n w = self.unique()\n self.emit('PyObject* %s = PySys_GetObject(\"stdout\");'%w)\n self.emit('PyFile_WriteString(\"\\\\n\",%s);'%w);\n self.emit('PyFile_SoftSpace(%s,0);'%w);\n return\n \n ##################################################################\n # MEMBER SET_LINENO #\n ##################################################################\n def SET_LINENO(self,pc,lineno):\n self.emit('// %s:%d'%(self.codeobject.co_filename,lineno))\n return\n\n ##################################################################\n # MEMBER POP_TOP #\n ##################################################################\n def POP_TOP(self,pc):\n v,t = self.pop()\n return\n\n ##################################################################\n # MEMBER LOAD_CONST #\n ##################################################################\n def LOAD_CONST(self,pc,consti):\n # Fetch the constant\n k = self.consts[consti]\n t = type(k)\n print 'LOAD_CONST',repr(k),t\n\n # Fetch a None is just skipped\n if t == NoneType:\n self.push('',t) \n return\n\n self.emit_value(k)\n return\n\n\n ##################################################################\n # MEMBER BUILD_TUPLE #\n ##################################################################\n def BUILD_TUPLE(self,pc,count):\n \"Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack.\"\n V = []\n T = []\n for i in range(count):\n v,t = self.pop()\n V.append(v)\n T.append(t)\n V.reverse()\n T.reverse()\n self.pushTuple(tuple(V),tuple(T))\n return\n\n ##################################################################\n # MEMBER LOAD_FAST #\n ##################################################################\n def LOAD_FAST(self,pc,var_num):\n v = self.stack[var_num]\n t = self.types[var_num]\n print 'LOADFAST',var_num,v,t\n for VV,TT in map(None, self.stack, self.types):\n print VV,':',TT\n if t is None:\n raise TypeError,'%s used before set?'%v\n print self.__body\n print 'PC',pc\n self.push(v,t)\n return\n\n ##################################################################\n # MEMBER LOAD_GLOBAL #\n ##################################################################\n def LOAD_GLOBAL(self,pc,var_num):\n # Figure out the name and load it\n try:\n F = self.function.func_globals[self.codeobject.co_names[var_num]]\n except:\n F = __builtins__[self.codeobject.co_names[var_num]]\n\n # For functions, we see if we know about this function\n if callable(F):\n self.push(F,type(F))\n return\n\n # We need the name of the module that matches\n # the global state for the function and\n # the name of the variable\n module_name,var_name = self.global_info(var_num)\n\n # We hope it's type is correct\n t = type(F)\n descriptor = typedefs[t]\n native = self.unique()\n py = self.unique()\n mod = self.unique()\n\n self.emit('')\n self.emit('PyObject* %s = PyImport_ImportModule(\"%s\");'%(\n mod,module_name))\n self.emit('PyObject* %s = PyObject_GetAttrString(%s,\"%s\");'%(\n py,mod,var_name))\n self.emit('%s %s = %s;'%(\n descriptor.cxxtype,\n native,\n descriptor.inbound%py))\n\n self.push(native,t)\n return\n\n def SETUP_LOOP(self,pc,delta):\n \"Pushes a block for a loop onto the block stack. The block spans from the current instruction with a size of delta bytes.\"\n return\n\n def FOR_LOOP(self,pc,delta):\n \"Iterate over a sequence. TOS is the current index, TOS1 the sequence. First, the next element is computed. If the sequence is exhausted, increment byte code counter by delta. Otherwise, push the sequence, the incremented counter, and the current item onto the stack.\"\n # Pull off control variable and range info\n v2,t2 = self.pop()\n v1,t1 = self.pop()\n self.emit('for(%s=%s.low; %s<%s.high; %s += %s.step) {'%(\n v2,v1,v2,v1,v2,v1))\n\n # Put range back on for assignment\n self.push(v2,t2)\n return\n\n def JUMP_ABSOLUTE(self,pc,target):\n \"Set byte code counter to target.\"\n self.emit('}')\n return\n\n def POP_BLOCK(self,pc):\n \"Removes one block from the block stack. Per frame, there is a stack of blocks, denoting nested loops, try statements, and such.\"\n return\n\n\n ##################################################################\n # MEMBER STORE_FAST #\n ##################################################################\n def STORE_FAST(self,pc,var_num):\n\n v,t = self.pop()\n print 'STORE FAST',var_num,v,t\n\n save = self.stack[var_num]\n saveT = self.types[var_num]\n\n # See if type is same....\n # Note that None means no assignment made yet\n if saveT is None or t == saveT:\n if t.refcount:\n self.emit('Py_XINCREF(%s);'%v)\n self.emit('Py_XDECREF(%s);'%save)\n self.emit('%s = %s;\\n'%(save,v))\n self.types[var_num] = t\n return\n\n raise TypeError,(t,saveT)\n\n ##################################################################\n # MEMBER STORE_GLOBAL #\n ##################################################################\n def STORE_GLOBAL(self,pc,var_num):\n\n # We need the name of the module that matches\n # the global state for the function and\n # the name of the variable\n module_name,var_name = self.global_info(var_num)\n\n # Convert the value to Python object\n v,t = self.pop()\n descriptor = typedefs[t]\n py = self.unique()\n self.emit('PyObject* %s = %s;'%(\n py,\n descriptor.outbound%v))\n mod = self.unique()\n self.emit('PyObject* %s = PyImport_ImportModule(\"%s\");'%(\n mod,module_name))\n self.emit('PyObject_SetAttrString(%s,\"%s\",%s);'%(\n mod,var_name,py))\n self.emit('Py_DECREF(%s);'%py)\n return\n\n ##################################################################\n # MEMBER CALL_FUNCTION #\n ##################################################################\n def CALL_FUNCTION(self,pc,argc):\n # Pull args off stack\n args = []\n types = []\n for i in range(argc):\n v,t = self.pop()\n args = [v]+args\n types = [t]+types\n \n # Pull function object off stack and get descriptor\n f,t = self.pop()\n signature = (f,tuple(types))\n descriptor = self.function_by_signature(signature)\n #self.prerequisites += descriptor['prerequisite']+'\\n'\n \n # Build a rhs\n rhs = descriptor.code%string.join(args,',')\n\n # Build a statement\n temp = self.unique()\n self.emit('%s %s = %s;\\n'%(\n descriptor.return_type.cxxtype,\n temp,\n rhs))\n\n self.push(temp,descriptor.return_type)\n return\n\n\n ##################################################################\n # MEMBER JUMP_IF_FALSE #\n ##################################################################\n def JUMP_IF_FALSE(self,pc,delta):\n v,t = self.pop()\n self.push(v,t)\n # We need to do some work when we get to the\n # else part (put the value that's gonna get\n # popped back on the stack, emit } else {,\n # ...)\n action = lambda v=v,t=t,self=self: (\n self.emit('} else {'),\n self.push(v,t),\n )\n self.post(pc+delta,action)\n if t != IntType: raise TypeError, 'Invalid comparison type %s'%t\n self.emit('if (%s) {\\n'%v)\n return\n \n\n ##################################################################\n # MEMBER JUMP_FORWARD #\n ##################################################################\n def JUMP_FORWARD(self,pc,delta):\n # We need to close the if after the delta\n action = lambda self=self: (\n self.emit('}'),\n )\n self.post(pc+delta,action)\n return\n \n ##################################################################\n # MEMBER RETURN_VALUE #\n ##################################################################\n def RETURN_VALUE(self,pc):\n v,t = self.pop()\n if hasattr(self,'rtype'):\n print v,t\n if t == NoneType: return # just the extra return\n raise ValueError,'multiple returns'\n self.rtype = t\n if t == NoneType:\n self.emit('return;')\n else:\n self.emit('return %s;'%v)\n print 'return with',v\n return\n\n", + "source_code_before": "#**************************************************************************#\n#* FILE ************** bytecodecompiler.py ************************#\n#************************************************************************ **#\n#* Author: Patrick Miller February 9 2002 *#\n#* Copyright (C) 2002 Patrick J. Miller *#\n#**************************************************************************#\n#* *#\n#**************************************************************************#\nfrom types import *\nimport string\nimport inspect\n\n##################################################################\n# CLASS __DESCRIPTOR #\n##################################################################\nclass __Descriptor:\n prerequisites = []\n refcount = 0\n def __repr__(self):\n return self.__module__+'.'+self.__class__.__name__\n\n##################################################################\n# CLASS TYPE_DESCRIPTOR #\n##################################################################\nclass Type_Descriptor(__Descriptor):\n module_init_code = ''\n\n##################################################################\n# CLASS FUNCTION_DESCRIPTOR #\n##################################################################\nclass Function_Descriptor(__Descriptor):\n def __init__(self,code,return_type,support=''):\n\tself.code\t= code\n\tself.return_type\t= return_type\n self.support = support\n\treturn\n\n \n \n\nhaveArgument = 90 # Opcodes greater-equal to this have argument\nbyName = {\n 'STOP_CODE': 0,\n 'POP_TOP': 1,\n 'ROT_TWO': 2,\n 'ROT_THREE': 3,\n 'DUP_TOP': 4,\n 'ROT_FOUR': 5,\n 'UNARY_POSITIVE': 10,\n 'UNARY_NEGATIVE': 11,\n 'UNARY_NOT': 12,\n 'UNARY_CONVERT': 13,\n 'UNARY_INVERT': 15,\n 'BINARY_POWER': 19,\n 'BINARY_MULTIPLY': 20,\n 'BINARY_DIVIDE': 21,\n 'BINARY_MODULO': 22,\n 'BINARY_ADD': 23,\n 'BINARY_SUBTRACT': 24,\n 'BINARY_SUBSCR': 25,\n 'BINARY_FLOOR_DIVIDE': 26,\n 'BINARY_TRUE_DIVIDE': 27,\n 'INPLACE_FLOOR_DIVIDE': 28,\n 'INPLACE_TRUE_DIVIDE': 29,\n 'SLICE': 30,\n 'STORE_SLICE': 40,\n 'DELETE_SLICE': 50,\n 'INPLACE_ADD': 55,\n 'INPLACE_SUBTRACT': 56,\n 'INPLACE_MULTIPLY': 57,\n 'INPLACE_DIVIDE': 58,\n 'INPLACE_MODULO': 59,\n 'STORE_SUBSCR': 60,\n 'DELETE_SUBSCR': 61,\n 'BINARY_LSHIFT': 62,\n 'BINARY_RSHIFT': 63,\n 'BINARY_AND': 64,\n 'BINARY_XOR': 65,\n 'BINARY_OR': 66,\n 'INPLACE_POWER': 67,\n 'GET_ITER': 68,\n 'PRINT_EXPR': 70,\n 'PRINT_ITEM': 71,\n 'PRINT_NEWLINE': 72,\n 'PRINT_ITEM_TO': 73,\n 'PRINT_NEWLINE_TO': 74,\n 'INPLACE_LSHIFT': 75,\n 'INPLACE_RSHIFT': 76,\n 'INPLACE_AND': 77,\n 'INPLACE_XOR': 78,\n 'INPLACE_OR': 79,\n 'BREAK_LOOP': 80,\n 'LOAD_LOCALS': 82,\n 'RETURN_VALUE': 83,\n 'IMPORT_STAR': 84,\n 'EXEC_STMT': 85,\n 'YIELD_VALUE': 86,\n 'POP_BLOCK': 87,\n 'END_FINALLY': 88,\n 'BUILD_CLASS': 89,\n 'STORE_NAME': 90,\n 'DELETE_NAME': 91,\n 'UNPACK_SEQUENCE': 92,\n 'FOR_ITER': 93,\n 'STORE_ATTR': 95,\n 'DELETE_ATTR': 96,\n 'STORE_GLOBAL': 97,\n 'DELETE_GLOBAL': 98,\n 'DUP_TOPX': 99,\n 'LOAD_CONST': 100,\n 'LOAD_NAME': 101,\n 'BUILD_TUPLE': 102,\n 'BUILD_LIST': 103,\n 'BUILD_MAP': 104,\n 'LOAD_ATTR': 105,\n 'COMPARE_OP': 106,\n 'IMPORT_NAME': 107,\n 'IMPORT_FROM': 108,\n 'JUMP_FORWARD': 110,\n 'JUMP_IF_FALSE': 111,\n 'JUMP_IF_TRUE': 112,\n 'JUMP_ABSOLUTE': 113,\n 'FOR_LOOP': 114,\n 'LOAD_GLOBAL': 116,\n 'CONTINUE_LOOP': 119,\n 'SETUP_LOOP': 120,\n 'SETUP_EXCEPT': 121,\n 'SETUP_FINALLY': 122,\n 'LOAD_FAST': 124,\n 'STORE_FAST': 125,\n 'DELETE_FAST': 126,\n 'SET_LINENO': 127,\n 'RAISE_VARARGS': 130,\n 'CALL_FUNCTION': 131,\n 'MAKE_FUNCTION': 132,\n 'BUILD_SLICE': 133,\n 'MAKE_CLOSURE': 134,\n 'LOAD_CLOSURE': 135,\n 'LOAD_DEREF': 136,\n 'STORE_DEREF': 137,\n 'CALL_FUNCTION_VAR': 140,\n 'CALL_FUNCTION_KW': 141,\n 'CALL_FUNCTION_VAR_KW': 142,\n }\n\n# -----------------------------------------------\n# Build one in the reverse sense\n# -----------------------------------------------\nbyOpcode = {}\nfor name,op in map(None, byName.keys(), byName.values()):\n byOpcode[op] = name\n del name\n del op\n \n\n##################################################################\n# FUNCTION OPCODIZE #\n##################################################################\ndef opcodize(s):\n \"Slightly more readable form\"\n length = len(s)\n i = 0\n answer = []\n while i < length:\n bytecode = ord(s[i])\n name = byOpcode[bytecode]\n if bytecode >= haveArgument:\n argument = 256*ord(s[i+2])+ord(s[i+1])\n i += 3\n else:\n argument = None\n i += 1\n answer.append((bytecode,argument,name))\n return answer\n\n\n\n##################################################################\n# FUNCTION LIST #\n##################################################################\ndef listing(f):\n \"Pretty print the internals of your function\"\n assert type(f) == FunctionType,\"Arg %r must be a function\"%f\n filename = f.func_code.co_filename\n try:\n lines = open(filename).readlines()\n except:\n lines = None\n pc = 0\n s = ''\n lastLine = None\n for op,arg,name in opcodize(f.func_code.co_code):\n if lines and name == 'SET_LINENO':\n source = lines[arg-1][:-1]\n while lastLine and lastLine < arg-1:\n nonEmittingSource = lines[lastLine][:-1]\n lastLine += 1\n s += '%3s %20s %5s : %s\\n'%(\n '','','',nonEmittingSource)\n lastLine = arg\n else:\n source = ''\n if arg == None: arg = ''\n s += '%3d] %20s %5s : %s\\n'%(pc,name,arg,source)\n if op >= haveArgument:\n pc += 3\n else:\n pc += 1\n return s\n\n##################################################################\n# CLASS BYTECODEMEANING #\n##################################################################\nclass ByteCodeMeaning:\n def fetch(self, pc,code):\n opcode = ord(code[pc])\n if opcode >= haveArgument:\n argument = 256*ord(code[pc+2])+ord(code[pc+1])\n next = pc+3\n else:\n argument = None\n next = pc+1\n return next,opcode,argument\n \n def execute(self,pc,opcode,argument):\n name = byOpcode[opcode]\n method = getattr(self,name)\n if argument == None:\n return apply(method,(pc,))\n else:\n return apply(method,(pc,argument,))\n\n def evaluate(self, pc,code):\n next, opcode,argument = self.fetch(pc,code)\n goto = self.execute(next,opcode,argument)\n if goto == -1:\n return None # Must be done\n elif goto == None:\n return next # Normal\n else:\n raise 'xx'\n\n symbols = { 0: 'less', 1: 'lesseq', 2: 'equal', 3: 'notequal',\n 4: 'greater', 5: 'greatereq', 6: 'in', 7: 'not in',\n 8: 'is', 9: 'is not', 10: 'exe match',\n 11 : 'bad',\n }\n def cmp_op(self,opname):\n return self.symbols[opname]\n \n def STOP_CODE(self,pc):\n \"Indicates end-of-code to the compiler, not used by the interpreter.\"\n raise NotImplementedError\n def POP_TOP(self,pc):\n \"Removes the top-of-stack (TOS) item.\"\n raise NotImplementedError\n\n def ROT_TWO(self,pc):\n \"Swaps the two top-most stack items.\"\n raise NotImplementedError\n\n def ROT_THREE(self,pc):\n \"Lifts second and third stack item one position up, moves top down to position three.\"\n raise NotImplementedError\n\n def ROT_FOUR(self,pc):\n \"Lifts second, third and forth stack item one position up, moves top down to position four.\"\n raise NotImplementedError\n\n def DUP_TOP(self,pc):\n \"Duplicates the reference on top of the stack.\"\n raise NotImplementedError\n\n # Unary Operations take the top of the stack, apply the operation, and push the result back on the stack.\n\n def UNARY_POSITIVE(self,pc):\n \"Implements TOS = +TOS.\"\n raise NotImplementedError\n\n def UNARY_NEGATIVE(self,pc):\n \"Implements TOS = -TOS.\"\n raise NotImplementedError\n\n def UNARY_NOT(self,pc):\n \"Implements TOS = not TOS.\"\n raise NotImplementedError\n\n def UNARY_CONVERT(self,pc):\n \"Implements TOS = `TOS`.\"\n raise NotImplementedError\n\n def UNARY_INVERT(self,pc):\n \"Implements TOS = ~TOS.\"\n raise NotImplementedError\n\n #Binary operations remove the top of the stack (TOS) and the second top-most stack item (TOS1) from the stack. They perform the operation, and put the result back on the stack.\n\n def BINARY_POWER(self,pc):\n \"Implements TOS = TOS1 ** TOS.\"\n raise NotImplementedError\n\n def BINARY_MULTIPLY(self,pc):\n \"Implements TOS = TOS1 * TOS.\"\n raise NotImplementedError\n\n def BINARY_DIVIDE(self,pc):\n \"Implements TOS = TOS1 / TOS.\"\n raise NotImplementedError\n\n def BINARY_MODULO(self,pc):\n \"Implements TOS = TOS1 % TOS.\"\n raise NotImplementedError\n\n def BINARY_ADD(self,pc):\n \"Implements TOS = TOS1 + TOS.\"\n raise NotImplementedError\n\n def BINARY_SUBTRACT(self,pc):\n \"Implements TOS = TOS1 - TOS.\"\n raise NotImplementedError\n\n def BINARY_SUBSCR(self,pc):\n \"Implements TOS = TOS1[TOS].\"\n raise NotImplementedError\n\n def BINARY_LSHIFT(self,pc):\n \"Implements TOS = TOS1 << TOS.\"\n raise NotImplementedError\n\n def BINARY_RSHIFT(self,pc):\n \"Implements TOS = TOS1 >> TOS.\"\n raise NotImplementedError\n\n def BINARY_AND(self,pc):\n \"Implements TOS = TOS1 & TOS.\"\n raise NotImplementedError\n\n def BINARY_XOR(self,pc):\n \"Implements TOS = TOS1 ^ TOS.\"\n raise NotImplementedError\n\n def BINARY_OR(self,pc):\n \"Implements TOS = TOS1 | TOS.\"\n raise NotImplementedError\n\n #In-place operations are like binary operations, in that they remove TOS and TOS1, and push the result back on the stack, but the operation is done in-place when TOS1 supports it, and the resulting TOS may be (but does not have to be) the original TOS1.\n\n def INPLACE_POWER(self,pc):\n \"Implements in-place TOS = TOS1 ** TOS.\"\n raise NotImplementedError\n\n def INPLACE_MULTIPLY(self,pc):\n \"Implements in-place TOS = TOS1 * TOS.\"\n raise NotImplementedError\n\n def INPLACE_DIVIDE(self,pc):\n \"Implements in-place TOS = TOS1 / TOS.\"\n raise NotImplementedError\n\n def INPLACE_MODULO(self,pc):\n \"Implements in-place TOS = TOS1 % TOS.\"\n raise NotImplementedError\n\n def INPLACE_ADD(self,pc):\n \"Implements in-place TOS = TOS1 + TOS.\"\n raise NotImplementedError\n\n def INPLACE_SUBTRACT(self,pc):\n \"Implements in-place TOS = TOS1 - TOS.\"\n raise NotImplementedError\n\n def INPLACE_LSHIFT(self,pc):\n \"Implements in-place TOS = TOS1 << TOS.\"\n raise NotImplementedError\n\n def INPLACE_RSHIFT(self,pc):\n \"Implements in-place TOS = TOS1 >> TOS.\"\n raise NotImplementedError\n\n def INPLACE_AND(self,pc):\n \"Implements in-place TOS = TOS1 & TOS.\"\n raise NotImplementedError\n\n def INPLACE_XOR(self,pc):\n \"Implements in-place TOS = TOS1 ^ TOS.\"\n raise NotImplementedError\n\n def INPLACE_OR(self,pc):\n \"Implements in-place TOS = TOS1 | TOS.\"\n raise NotImplementedError\n\n #The slice opcodes take up to three parameters.\n\n def SLICE_0(self,pc):\n \"Implements TOS = TOS[:].\"\n raise NotImplementedError\n\n def SLICE_1(self,pc):\n \"Implements TOS = TOS1[TOS:].\"\n raise NotImplementedError\n\n def SLICE_2(self,pc):\n \"Implements TOS = TOS1[:TOS1].\"\n raise NotImplementedError\n\n def SLICE_3(self,pc):\n \"Implements TOS = TOS2[TOS1:TOS].\"\n raise NotImplementedError\n\n #Slice assignment needs even an additional parameter. As any statement, they put nothing on the stack.\n\n def STORE_SLICE_0(self,pc):\n \"Implements TOS[:] = TOS1.\"\n raise NotImplementedError\n\n def STORE_SLICE_1(self,pc):\n \"Implements TOS1[TOS:] = TOS2.\"\n raise NotImplementedError\n\n def STORE_SLICE_2(self,pc):\n \"Implements TOS1[:TOS] = TOS2.\"\n raise NotImplementedError\n\n def STORE_SLICE_3(self,pc):\n \"Implements TOS2[TOS1:TOS] = TOS3.\"\n raise NotImplementedError\n\n def DELETE_SLICE_0(self,pc):\n \"Implements del TOS[:].\"\n raise NotImplementedError\n\n def DELETE_SLICE_1(self,pc):\n \"Implements del TOS1[TOS:].\"\n raise NotImplementedError\n\n def DELETE_SLICE_2(self,pc):\n \"Implements del TOS1[:TOS].\"\n raise NotImplementedError\n\n def DELETE_SLICE_3(self,pc):\n \"Implements del TOS2[TOS1:TOS].\"\n raise NotImplementedError\n\n def STORE_SUBSCR(self,pc):\n \"Implements TOS1[TOS] = TOS2.\"\n raise NotImplementedError\n\n def DELETE_SUBSCR(self,pc):\n \"Implements del TOS1[TOS].\"\n raise NotImplementedError\n\n def PRINT_EXPR(self,pc):\n \"Implements the expression statement for the interactive mode. TOS is removed from the stack and printed. In non-interactive mode, an expression statement is terminated with POP_STACK.\"\n raise NotImplementedError\n\n def PRINT_ITEM(self,pc):\n \"Prints TOS to the file-like object bound to sys.stdout. There is one such instruction for each item in the print statement.\"\n raise NotImplementedError\n\n def PRINT_ITEM_TO(self,pc):\n \"Like PRINT_ITEM, but prints the item second from TOS to the file-like object at TOS. This is used by the extended print statement.\"\n raise NotImplementedError\n\n def PRINT_NEWLINE(self,pc):\n \"Prints a new line on sys.stdout. This is generated as the last operation of a print statement, unless the statement ends with a comma.\"\n raise NotImplementedError\n\n def PRINT_NEWLINE_TO(self,pc):\n \"Like PRINT_NEWLINE, but prints the new line on the file-like object on the TOS. This is used by the extended print statement.\"\n raise NotImplementedError\n\n def BREAK_LOOP(self,pc):\n \"Terminates a loop due to a break statement.\"\n raise NotImplementedError\n\n def LOAD_LOCALS(self,pc):\n \"Pushes a reference to the locals of the current scope on the stack. This is used in the code for a class definition: After the class body is evaluated, the locals are passed to the class definition.\"\n raise NotImplementedError\n\n def RETURN_VALUE(self,pc):\n \"Returns with TOS to the caller of the function.\"\n raise NotImplementedError\n\n def IMPORT_STAR(self,pc):\n \"Loads all symbols not starting with _ directly from the module TOS to the local namespace. The module is popped after loading all names. This opcode implements from module import *.\"\n raise NotImplementedError\n\n def EXEC_STMT(self,pc):\n \"Implements exec TOS2,TOS1,TOS. The compiler fills missing optional parameters with None.\"\n raise NotImplementedError\n\n def POP_BLOCK(self,pc):\n \"Removes one block from the block stack. Per frame, there is a stack of blocks, denoting nested loops, try statements, and such.\"\n raise NotImplementedError\n\n def END_FINALLY(self,pc):\n \"Terminates a finally clause. The interpreter recalls whether the exception has to be re-raised, or whether the function returns, and continues with the outer-next block.\"\n raise NotImplementedError\n\n def BUILD_CLASS(self,pc):\n \"Creates a new class object. TOS is the methods dictionary, TOS1 the tuple of the names of the base classes, and TOS2 the class name.\"\n raise NotImplementedError\n\n #All of the following opcodes expect arguments. An argument is two bytes, with the more significant byte last.\n\n def STORE_NAME(self,pc,namei):\n \"Implements name = TOS. namei is the index of name in the attribute co_names of the code object. The compiler tries to use STORE_LOCAL or STORE_GLOBAL if possible.\"\n raise NotImplementedError\n\n def DELETE_NAME(self,pc,namei):\n \"Implements del name, where namei is the index into co_names attribute of the code object.\"\n raise NotImplementedError\n\n def UNPACK_SEQUENCE(self,pc,count):\n \"Unpacks TOS into count individual values, which are put onto the stack right-to-left.\"\n raise NotImplementedError\n\n def DUP_TOPX(self,pc,count):\n \"Duplicate count items, keeping them in the same order. Due to implementation limits, count should be between 1 and 5 inclusive.\"\n raise NotImplementedError\n\n def STORE_ATTR(self,pc,namei):\n \"Implements TOS.name = TOS1, where namei is the index of name in co_names.\"\n raise NotImplementedError\n\n def DELETE_ATTR(self,pc,namei):\n \"Implements del TOS.name, using namei as index into co_names.\"\n raise NotImplementedError\n\n def STORE_GLOBAL(self,pc,namei):\n \"Works as STORE_NAME, but stores the name as a global.\"\n raise NotImplementedError\n\n def DELETE_GLOBAL(self,pc,namei):\n \"Works as DELETE_NAME, but deletes a global name.\"\n raise NotImplementedError\n\n def LOAD_CONST(self,pc,consti):\n \"Pushes co_consts[consti] onto the stack.\"\n raise NotImplementedError\n\n def LOAD_NAME(self,pc,namei):\n \"Pushes the value associated with co_names[namei] onto the stack.\"\n raise NotImplementedError\n\n def BUILD_TUPLE(self,pc,count):\n \"Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack.\"\n raise NotImplementedError\n\n def BUILD_LIST(self,pc,count):\n \"Works as BUILD_TUPLE, but creates a list.\"\n raise NotImplementedError\n\n def BUILD_MAP(self,pc,zero):\n \"Pushes a new empty dictionary object onto the stack. The argument is ignored and set to zero by the compiler.\"\n raise NotImplementedError\n\n def LOAD_ATTR(self,pc,namei):\n \"Replaces TOS with getattr(TOS, co_names[namei].\"\n raise NotImplementedError\n\n def COMPARE_OP(self,pc,opname):\n \"Performs a Boolean operation. The operation name can be found in cmp_op[opname].\"\n raise NotImplementedError\n\n def IMPORT_NAME(self,pc,namei):\n \"Imports the module co_names[namei]. The module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent STORE_FAST instruction modifies the namespace.\"\n raise NotImplementedError\n\n def IMPORT_FROM(self,pc,namei):\n \"Loads the attribute co_names[namei] from the module found in TOS. The resulting object is pushed onto the stack, to be subsequently stored by a STORE_FAST instruction.\"\n raise NotImplementedError\n\n def JUMP_FORWARD(self,pc,delta):\n \"Increments byte code counter by delta.\"\n raise NotImplementedError\n\n def JUMP_IF_TRUE(self,pc,delta):\n \"If TOS is true, increment the byte code counter by delta. TOS is left on the stack.\"\n raise NotImplementedError\n\n def JUMP_IF_FALSE(self,pc,delta):\n \"If TOS is false, increment the byte code counter by delta. TOS is not changed.\"\n raise NotImplementedError\n\n def JUMP_ABSOLUTE(self,pc,target):\n \"Set byte code counter to target.\"\n raise NotImplementedError\n\n def FOR_LOOP(self,pc,delta):\n \"Iterate over a sequence. TOS is the current index, TOS1 the sequence. First, the next element is computed. If the sequence is exhausted, increment byte code counter by delta. Otherwise, push the sequence, the incremented counter, and the current item onto the stack.\"\n raise NotImplementedError\n\n def LOAD_GLOBAL(self,pc,namei):\n \"Loads the global named co_names[namei] onto the stack.\"\n raise NotImplementedError\n\n def SETUP_LOOP(self,pc,delta):\n \"Pushes a block for a loop onto the block stack. The block spans from the current instruction with a size of delta bytes.\"\n raise NotImplementedError\n\n def SETUP_EXCEPT(self,pc,delta):\n \"Pushes a try block from a try-except clause onto the block stack. delta points to the first except block.\"\n raise NotImplementedError\n\n def SETUP_FINALLY(self,pc,delta):\n \"Pushes a try block from a try-except clause onto the block stack. delta points to the finally block.\"\n raise NotImplementedError\n\n def LOAD_FAST(self,pc,var_num):\n \"Pushes a reference to the local co_varnames[var_num] onto the stack.\"\n raise NotImplementedError\n\n def STORE_FAST(self,pc,var_num):\n \"Stores TOS into the local co_varnames[var_num].\"\n raise NotImplementedError\n\n def DELETE_FAST(self,pc,var_num):\n \"Deletes local co_varnames[var_num].\"\n raise NotImplementedError\n\n def LOAD_CLOSURE(self,pc,i):\n \"Pushes a reference to the cell contained in slot i of the cell and free variable storage. The name of the variable is co_cellvars[i] if i is less than the length of co_cellvars. Otherwise it is co_freevars[i - len(co_cellvars)].\"\n raise NotImplementedError\n\n def LOAD_DEREF(self,pc,i):\n \"Loads the cell contained in slot i of the cell and free variable storage. Pushes a reference to the object the cell contains on the stack.\"\n raise NotImplementedError\n\n def STORE_DEREF(self,pc,i):\n \"Stores TOS into the cell contained in slot i of the cell and free variable storage.\"\n raise NotImplementedError\n\n def SET_LINENO(self,pc,lineno):\n \"Sets the current line number to lineno.\"\n raise NotImplementedError\n\n def RAISE_VARARGS(self,pc,argc):\n \"Raises an exception. argc indicates the number of parameters to the raise statement, ranging from 0 to 3. The handler will find the traceback as TOS2, the parameter as TOS1, and the exception as TOS.\"\n raise NotImplementedError\n\n def CALL_FUNCTION(self,pc,argc):\n \"Calls a function. The low byte of argc indicates the number of positional parameters, the high byte the number of keyword parameters. On the stack, the opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, the function object to call is on the stack.\"\n raise NotImplementedError\n\n def MAKE_FUNCTION(self,pc,argc):\n \"Pushes a new function object on the stack. TOS is the code associated with the function. The function object is defined to have argc default parameters, which are found below TOS.\"\n raise NotImplementedError\n\n def MAKE_CLOSURE(self,pc,argc):\n \"Creates a new function object, sets its func_closure slot, and pushes it on the stack. TOS is the code associated with the function. If the code object has N free variables, the next N items on the stack are the cells for these variables. The function also has argc default parameters, where are found before the cells.\"\n raise NotImplementedError\n\n def BUILD_SLICE(self,pc,argc):\n \"Pushes a slice object on the stack. argc must be 2 or 3. If it is 2, slice(TOS1, TOS) is pushed; if it is 3, slice(TOS2, TOS1, TOS) is pushed. See the slice() built-in function for more information.\"\n raise NotImplementedError\n\n def EXTENDED_ARG(self,pc,ext):\n \"Prefixes any opcode which has an argument too big to fit into the default two bytes. ext holds two additional bytes which, taken together with the subsequent opcode's argument, comprise a four-byte argument, ext being the two most-significant bytes.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_VAR(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the variable argument list, followed by keyword and positional arguments.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_KW(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the keyword arguments dictionary, followed by explicit keyword and positional arguments.\"\n raise NotImplementedError\n\n def CALL_FUNCTION_VAR_KW(self,pc,argc):\n \"Calls a function. argc is interpreted as in CALL_FUNCTION. The top element on the stack contains the keyword arguments dictionary, followed by the variable-arguments tuple, followed by explicit keyword and positional arguments.\"\n raise NotImplementedError\n\n \n\n##################################################################\n# CLASS CXXCODER #\n##################################################################\nclass CXXCoder(ByteCodeMeaning):\n\n ##################################################################\n # MEMBER TYPEDEF_BY_VALUE #\n ##################################################################\n def typedef_by_value(self,v):\n raise NotImplementedError # VIRTUAL\n \n ##################################################################\n # MEMBER __INIT__ #\n ##################################################################\n def __init__(self,function,signature,name=None):\n assert type(function) == FunctionType,\"Arg must be a user function\"\n assert not function.func_defaults ,\"Function cannot have default args (yet)\"\n if name == None: name = function.func_name\n self.name = name\n self.function = function\n self.signature = signature\n self.codeobject = function.func_code\n self.__uid = 0 # Builds temps\n self.__indent = 1\n return\n\n ##################################################################\n # MEMBER EVALUATE #\n ##################################################################\n def evaluate(self, pc,code):\n # See if we posted any forwards for this offset\n if self.forwards.has_key(pc):\n for f in self.forwards[pc]:\n f()\n self.forwards[pc] = []\n return ByteCodeMeaning.evaluate(self,pc,code)\n \n ##################################################################\n # MEMBER GENERATE #\n ##################################################################\n def generate(self):\n self.forwards = {} # Actions on forward interprets\n self.__body = '' # Body will be built\n self.helpers = [] # headers and stuff\n\n # -----------------------------------------------\n # OK, crack open the function object and build\n # initial stack (not a real frame!)\n # -----------------------------------------------\n arglen = self.codeobject.co_argcount\n nlocals = self.codeobject.co_nlocals\n\n self.consts = self.codeobject.co_consts\n self.stack = list(self.codeobject.co_varnames)\n self.types = list(self.signature)+[None]*(nlocals-arglen)\n self.used = []\n for T in self.types:\n if T not in self.used: self.used.append(T)\n\n # -----------------------------------------------\n # One pass through the byte codes to generate\n # the body\n # -----------------------------------------------\n code = self.codeobject.co_code\n bytes = len(code)\n pc = 0\n while pc != None and pc < bytes:\n pc = self.evaluate(pc,code)\n\n # -----------------------------------------------\n # Return?\n # -----------------------------------------------\n if self.rtype == NoneType:\n rtype = 'void'\n else:\n rtype = self.rtype.cxxtype\n \n # -----------------------------------------------\n # Insert code body if available\n # -----------------------------------------------\n source = inspect.getsource(self.function)\n if not source: source = ''\n comments = inspect.getcomments(self.function)\n if comments: source = comments+source\n code = string.join(map(lambda x: '/////// '+x,string.split(source,'\\n')),\n '\\n')+'\\n'\n\n # -----------------------------------------------\n # Add in the headers\n # -----------------------------------------------\n code += '#include \"Python.h\"\\n'\n for T in self.used:\n if T == None: continue\n for pre in T.prerequisites:\n code += pre\n code += '\\n'\n\n # -----------------------------------------------\n # Real body\n # -----------------------------------------------\n code += '\\n'\n code += '\\nstatic %s %s('%(rtype,self.name)\n for i in range(len(self.signature)):\n if i != 0: code += ', '\n n = self.stack[i]\n t = self.types[i]\n code += '%s %s'%(t.cxxtype,n)\n code += ') {\\n'\n\n # Add in non-argument temporaries\n # Assuming first argcount locals are positional args\n for i in range(self.codeobject.co_argcount,\n self.codeobject.co_nlocals):\n t = self.types[i]\n code += '%s %s;\\n'%(\n t.cxxtype,\n self.codeobject.co_varnames[i],\n )\n\n # Add in the body\n code += self.__body\n code += '}\\n\\n'\n return code\n\n\n ##################################################################\n # MEMBER WRAPPED_CODE #\n ##################################################################\n def wrapped_code(self):\n code = self.generate()\n \n # -----------------------------------------------\n # Wrapper\n # -----------------------------------------------\n code += 'static PyObject* wrapper_%s(PyObject*,PyObject* args) {\\n'%self.name\n\n code += ' // Length check\\n'\n code += ' if ( PyTuple_Size(args) != %d ) {\\n'%len(self.signature)\n code += ' PyErr_SetString(PyExc_TypeError,\"Expected %d arguments\");\\n'%len(self.signature)\n code += ' return 0;\\n'\n code += ' }\\n'\n\n code += '\\n // Load Py versions of args\\n'\n for i in range(len(self.signature)):\n T = self.signature[i]\n code += ' PyObject* py_%s = PyTuple_GET_ITEM(args,%d);\\n'%(\n self.codeobject.co_varnames[i],i\n )\n\n code += ' if ( !(%s) ) {\\n'% \\\n T.check('py_'+self.codeobject.co_varnames[i])\n #code += ' PyObject_Print(py_A,stdout,0); puts(\"\");\\n'\n #code += ' printf(\"nd=%d typecode=%d\\\\n\",((PyArrayObject*)py_A)->nd,((PyArrayObject*)py_A)->descr->type_num);\\n'\n code += ' PyErr_SetString(PyExc_TypeError,\"Bad type for arg %d (expected %s)\");\\n'%(\n i+1,\n T.__class__.__name__)\n code += ' return 0;\\n'\n code += ' }\\n'\n \n code += '\\n // Do conversions\\n'\n argnames = []\n for i in range(len(self.signature)):\n T = self.signature[i]\n\n code += ' %s %s=%s;\\n'%(\n T.cxxtype,\n self.codeobject.co_varnames[i],\n T.inbound('py_'+self.codeobject.co_varnames[i]),\n )\n code += ' if ( PyErr_Occurred() ) return 0;\\n'\n argnames.append(self.codeobject.co_varnames[i])\n\n code += '\\n // Compute result\\n'\n if self.rtype != NoneType:\n code += ' %s _result = '%(\n self.rtype.cxxtype,\n )\n else:\n code += ' '\n code += '%s(%s);\\n'%(\n self.name,\n string.join(argnames,','),\n )\n\n\n code += '\\n // Pack return\\n'\n if ( self.rtype == NoneType ):\n code += ' Py_INCREF(Py_None);\\n'\n code += ' return Py_None;\\n'\n else:\n result = self.rtype.outbound('_result')\n code += ' return %s;\\n'%result\n code += '}\\n'\n return code\n\n def indent(self):\n self.__indent += 1\n return\n\n def dedent(self):\n self.__indent -= 1\n return\n\n ##################################################################\n # MEMBER EMIT #\n ##################################################################\n def emit(self,s):\n self.__body += ' '*(3*self.__indent)\n self.__body += s\n self.__body += '\\n'\n return\n\n ##################################################################\n # MEMBER PUSH #\n ##################################################################\n def push(self,v,t):\n self.stack.append(v)\n self.types.append(t)\n return\n\n ##################################################################\n # MEMBER POP #\n ##################################################################\n def pop(self):\n v = self.stack[-1]\n assert type(v) != TupleType\n del self.stack[-1]\n t = self.types[-1]\n assert type(t) != TupleType\n del self.types[-1]\n return v,t\n\n ##################################################################\n # MEMBER PUSHTUPLE #\n ##################################################################\n def pushTuple(self,V,T):\n assert type(V) == TupleType\n self.stack.append(V)\n assert type(V) == TupleType\n self.types.append(T)\n return\n\n\n ##################################################################\n # MEMBER POPTUPLE #\n ##################################################################\n def popTuple(self):\n v = self.stack[-1]\n assert type(v) == TupleType\n del self.stack[-1]\n t = self.types[-1]\n assert type(t) == TupleType\n del self.types[-1]\n return v,t\n ##################################################################\n # MEMBER MULTIARG #\n ##################################################################\n def multiarg(self):\n return type(self.stack[-1]) == TupleType\n \n ##################################################################\n # MEMBER UNIQUE #\n ##################################################################\n def unique(self):\n self.__uid += 1\n return 't%d'%self.__uid\n\n ##################################################################\n # MEMBER POST #\n ##################################################################\n def post(self,pc,action):\n if not self.forwards.has_key(pc):\n self.forwards[pc] = []\n self.forwards[pc].append(action)\n return\n\n ##################################################################\n # MEMBER EMIT_VALUE #\n ##################################################################\n def emit_value(self, v):\n descriptor = self.typedef_by_value(v)\n \n # Convert representation to CXX rhs\n rhs = descriptor.literalizer(v)\n lhs = self.unique()\n self.emit('%s %s = %s;'%(\n descriptor.cxxtype,\n lhs,\n rhs))\n self.push(lhs,descriptor)\n return \n\n ##################################################################\n # MEMBER GLOBAL_INFO #\n ##################################################################\n def global_info(self,var_num):\n # This is the name value is known by\n var_name = self.codeobject.co_names[var_num]\n\n # First, figure out who owns this global\n import sys\n myHash = id(self.function.func_globals)\n for module_name in sys.modules.keys():\n module = sys.modules[module_name]\n if module and id(module.__dict__) == myHash:\n break\n else:\n raise ValueError,'Cannot locate module owning %s'%varname\n return module_name,var_name\n\n\n ##################################################################\n # MEMBER CODEUP #\n ##################################################################\n def codeup(self, rhs, rhs_type):\n lhs = self.unique()\n self.emit('%s %s = %s;\\n'%(\n rhs_type.cxxtype,\n lhs,\n rhs))\n print self.__body\n self.push(lhs,rhs_type)\n return \n \n\n ##################################################################\n # MEMBER BINOP #\n ##################################################################\n def binop(self,pc,symbol):\n v2,t2 = self.pop()\n v1,t1 = self.pop()\n\n if t1 == t2:\n rhs,rhs_type = t1.binop(symbol,v1,v2)\n else:\n rhs,rhs_type = t1.binopMixed(symbol,v1,v2,t2)\n\n self.codeup(rhs,rhs_type)\n return\n\n ##################################################################\n # MEMBER BINARY_XXX #\n ##################################################################\n def BINARY_ADD(self,pc):\n return self.binop(pc,'+')\n def BINARY_SUBTRACT(self,pc):\n return self.binop(pc,'-')\n def BINARY_MULTIPLY(self,pc):\n print 'MULTIPLY',self.stack[-2],self.types[-2],'*',self.stack[-1],self.types[-1]\n return self.binop(pc,'*')\n def BINARY_DIVIDE(self,pc):\n return self.binop(pc,'/')\n def BINARY_MODULO(self,pc):\n return self.binop(pc,'%')\n def BINARY_SUBSCR(self,pc):\n if self.multiarg():\n v2,t2 = self.popTuple()\n else:\n v2,t2 = self.pop()\n v2 = (v2,)\n t2 = (t2,)\n v1,t1 = self.pop()\n rhs,rhs_type = t1.getitem(v1,v2,t2)\n self.codeup(rhs,rhs_type)\n return\n\n def STORE_SUBSCR(self,pc):\n if self.multiarg():\n v2,t2 = self.popTuple()\n else:\n v2,t2 = self.pop()\n v2 = (v2,)\n t2 = (t2,)\n v1,t1 = self.pop()\n v0,t0 = self.pop()\n \n rhs,rhs_type = t1.setitem(v1,v2,t2)\n assert rhs_type == t0,\"Store the right thing\"\n self.emit('%s = %s;'%(rhs,v0))\n return\n\n def COMPARE_OP(self,pc,opname):\n symbol = self.cmp_op(opname) # convert numeric to name\n return self.binop(pc,symbol)\n\n\n ##################################################################\n # MEMBER PRINT_ITEM #\n ##################################################################\n def PRINT_ITEM(self,pc):\n # Printing correctly is tricky... best to let Python\n # do the real work here\n w = self.unique()\n self.emit('PyObject* %s = PySys_GetObject(\"stdout\");'%w)\n self.emit('if (PyFile_SoftSpace(%s,1)) PyFile_WriteString(\" \",%s);'%(w,w))\n v,t = self.pop()\n\n py = self.unique()\n self.emit('PyObject* %s = %s;'%(py, t.outbound(v)))\n self.emit('PyFile_WriteObject(%s,%s,Py_PRINT_RAW);'%(\n py,w))\n self.emit('Py_XDECREF(%s);'%py)\n return\n\n\n ##################################################################\n # MEMBER PRINT_NEWLINE #\n ##################################################################\n def PRINT_NEWLINE(self,pc):\n # Printing correctly is tricky... best to let Python\n # do the real work here\n w = self.unique()\n self.emit('PyObject* %s = PySys_GetObject(\"stdout\");'%w)\n self.emit('PyFile_WriteString(\"\\\\n\",%s);'%w);\n self.emit('PyFile_SoftSpace(%s,0);'%w);\n return\n \n ##################################################################\n # MEMBER SET_LINENO #\n ##################################################################\n def SET_LINENO(self,pc,lineno):\n self.emit('// %s:%d'%(self.codeobject.co_filename,lineno))\n return\n\n ##################################################################\n # MEMBER POP_TOP #\n ##################################################################\n def POP_TOP(self,pc):\n v,t = self.pop()\n return\n\n ##################################################################\n # MEMBER LOAD_CONST #\n ##################################################################\n def LOAD_CONST(self,pc,consti):\n # Fetch the constant\n k = self.consts[consti]\n t = type(k)\n print 'LOAD_CONST',repr(k),t\n\n # Fetch a None is just skipped\n if t == NoneType:\n self.push('',t) \n return\n\n self.emit_value(k)\n return\n\n\n ##################################################################\n # MEMBER BUILD_TUPLE #\n ##################################################################\n def BUILD_TUPLE(self,pc,count):\n \"Creates a tuple consuming count items from the stack, and pushes the resulting tuple onto the stack.\"\n V = []\n T = []\n for i in range(count):\n v,t = self.pop()\n V.append(v)\n T.append(t)\n V.reverse()\n T.reverse()\n self.pushTuple(tuple(V),tuple(T))\n return\n\n ##################################################################\n # MEMBER LOAD_FAST #\n ##################################################################\n def LOAD_FAST(self,pc,var_num):\n v = self.stack[var_num]\n t = self.types[var_num]\n print 'LOADFAST',var_num,v,t\n for VV,TT in map(None, self.stack, self.types):\n print VV,':',TT\n if t == None:\n raise TypeError,'%s used before set?'%v\n print self.__body\n print 'PC',pc\n self.push(v,t)\n return\n\n ##################################################################\n # MEMBER LOAD_GLOBAL #\n ##################################################################\n def LOAD_GLOBAL(self,pc,var_num):\n # Figure out the name and load it\n try:\n F = self.function.func_globals[self.codeobject.co_names[var_num]]\n except:\n F = __builtins__[self.codeobject.co_names[var_num]]\n\n # For functions, we see if we know about this function\n if callable(F):\n self.push(F,type(F))\n return\n\n # We need the name of the module that matches\n # the global state for the function and\n # the name of the variable\n module_name,var_name = self.global_info(var_num)\n\n # We hope it's type is correct\n t = type(F)\n descriptor = typedefs[t]\n native = self.unique()\n py = self.unique()\n mod = self.unique()\n\n self.emit('')\n self.emit('PyObject* %s = PyImport_ImportModule(\"%s\");'%(\n mod,module_name))\n self.emit('PyObject* %s = PyObject_GetAttrString(%s,\"%s\");'%(\n py,mod,var_name))\n self.emit('%s %s = %s;'%(\n descriptor.cxxtype,\n native,\n descriptor.inbound%py))\n\n self.push(native,t)\n return\n\n def SETUP_LOOP(self,pc,delta):\n \"Pushes a block for a loop onto the block stack. The block spans from the current instruction with a size of delta bytes.\"\n return\n\n def FOR_LOOP(self,pc,delta):\n \"Iterate over a sequence. TOS is the current index, TOS1 the sequence. First, the next element is computed. If the sequence is exhausted, increment byte code counter by delta. Otherwise, push the sequence, the incremented counter, and the current item onto the stack.\"\n # Pull off control variable and range info\n v2,t2 = self.pop()\n v1,t1 = self.pop()\n self.emit('for(%s=%s.low; %s<%s.high; %s += %s.step) {'%(\n v2,v1,v2,v1,v2,v1))\n\n # Put range back on for assignment\n self.push(v2,t2)\n return\n\n def JUMP_ABSOLUTE(self,pc,target):\n \"Set byte code counter to target.\"\n self.emit('}')\n return\n\n def POP_BLOCK(self,pc):\n \"Removes one block from the block stack. Per frame, there is a stack of blocks, denoting nested loops, try statements, and such.\"\n return\n\n\n ##################################################################\n # MEMBER STORE_FAST #\n ##################################################################\n def STORE_FAST(self,pc,var_num):\n\n v,t = self.pop()\n print 'STORE FAST',var_num,v,t\n\n save = self.stack[var_num]\n saveT = self.types[var_num]\n\n # See if type is same....\n # Note that None means no assignment made yet\n if saveT == None or t == saveT:\n if t.refcount:\n self.emit('Py_XINCREF(%s);'%v)\n self.emit('Py_XDECREF(%s);'%save)\n self.emit('%s = %s;\\n'%(save,v))\n self.types[var_num] = t\n return\n\n raise TypeError,(t,saveT)\n\n ##################################################################\n # MEMBER STORE_GLOBAL #\n ##################################################################\n def STORE_GLOBAL(self,pc,var_num):\n\n # We need the name of the module that matches\n # the global state for the function and\n # the name of the variable\n module_name,var_name = self.global_info(var_num)\n\n # Convert the value to Python object\n v,t = self.pop()\n descriptor = typedefs[t]\n py = self.unique()\n self.emit('PyObject* %s = %s;'%(\n py,\n descriptor.outbound%v))\n mod = self.unique()\n self.emit('PyObject* %s = PyImport_ImportModule(\"%s\");'%(\n mod,module_name))\n self.emit('PyObject_SetAttrString(%s,\"%s\",%s);'%(\n mod,var_name,py))\n self.emit('Py_DECREF(%s);'%py)\n return\n\n ##################################################################\n # MEMBER CALL_FUNCTION #\n ##################################################################\n def CALL_FUNCTION(self,pc,argc):\n # Pull args off stack\n args = []\n types = []\n for i in range(argc):\n v,t = self.pop()\n args = [v]+args\n types = [t]+types\n \n # Pull function object off stack and get descriptor\n f,t = self.pop()\n signature = (f,tuple(types))\n descriptor = self.function_by_signature(signature)\n #self.prerequisites += descriptor['prerequisite']+'\\n'\n \n # Build a rhs\n rhs = descriptor.code%string.join(args,',')\n\n # Build a statement\n temp = self.unique()\n self.emit('%s %s = %s;\\n'%(\n descriptor.return_type.cxxtype,\n temp,\n rhs))\n\n self.push(temp,descriptor.return_type)\n return\n\n\n ##################################################################\n # MEMBER JUMP_IF_FALSE #\n ##################################################################\n def JUMP_IF_FALSE(self,pc,delta):\n v,t = self.pop()\n self.push(v,t)\n # We need to do some work when we get to the\n # else part (put the value that's gonna get\n # popped back on the stack, emit } else {,\n # ...)\n action = lambda v=v,t=t,self=self: (\n self.emit('} else {'),\n self.push(v,t),\n )\n self.post(pc+delta,action)\n if t != IntType: raise TypeError, 'Invalid comparison type %s'%t\n self.emit('if (%s) {\\n'%v)\n return\n \n\n ##################################################################\n # MEMBER JUMP_FORWARD #\n ##################################################################\n def JUMP_FORWARD(self,pc,delta):\n # We need to close the if after the delta\n action = lambda self=self: (\n self.emit('}'),\n )\n self.post(pc+delta,action)\n return\n \n ##################################################################\n # MEMBER RETURN_VALUE #\n ##################################################################\n def RETURN_VALUE(self,pc):\n v,t = self.pop()\n if hasattr(self,'rtype'):\n print v,t\n if t == NoneType: return # just the extra return\n raise ValueError,'multiple returns'\n self.rtype = t\n if t == NoneType:\n self.emit('return;')\n else:\n self.emit('return %s;'%v)\n print 'return with',v\n return\n\n", + "methods": [ + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 20, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , code , return_type , support = '' )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "code", + "return_type", + "support" + ], + "start_line": 32, + "end_line": 36, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "opcodize", + "long_name": "opcodize( s )", + "filename": "bytecodecompiler.py", + "nloc": 16, + "complexity": 3, + "token_count": 92, + "parameters": [ + "s" + ], + "start_line": 159, + "end_line": 174, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "listing", + "long_name": "listing( f )", + "filename": "bytecodecompiler.py", + "nloc": 29, + "complexity": 9, + "token_count": 166, + "parameters": [ + "f" + ], + "start_line": 181, + "end_line": 209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "fetch", + "long_name": "fetch( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 215, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "execute", + "long_name": "execute( self , pc , opcode , argument )", + "filename": "bytecodecompiler.py", + "nloc": 7, + "complexity": 2, + "token_count": 54, + "parameters": [ + "self", + "pc", + "opcode", + "argument" + ], + "start_line": 225, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "evaluate", + "long_name": "evaluate( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 3, + "token_count": 54, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 233, + "end_line": 241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "cmp_op", + "long_name": "cmp_op( self , opname )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "opname" + ], + "start_line": 248, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "STOP_CODE", + "long_name": "STOP_CODE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 251, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_TOP", + "long_name": "POP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 254, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_TWO", + "long_name": "ROT_TWO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 258, + "end_line": 260, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_THREE", + "long_name": "ROT_THREE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 262, + "end_line": 264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_FOUR", + "long_name": "ROT_FOUR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DUP_TOP", + "long_name": "DUP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_POSITIVE", + "long_name": "UNARY_POSITIVE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_NEGATIVE", + "long_name": "UNARY_NEGATIVE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_NOT", + "long_name": "UNARY_NOT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_CONVERT", + "long_name": "UNARY_CONVERT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 288, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_INVERT", + "long_name": "UNARY_INVERT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 292, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_POWER", + "long_name": "BINARY_POWER( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 298, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MULTIPLY", + "long_name": "BINARY_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 302, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_DIVIDE", + "long_name": "BINARY_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 306, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MODULO", + "long_name": "BINARY_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 310, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_ADD", + "long_name": "BINARY_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 314, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBTRACT", + "long_name": "BINARY_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 318, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBSCR", + "long_name": "BINARY_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 322, + "end_line": 324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_LSHIFT", + "long_name": "BINARY_LSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 326, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_RSHIFT", + "long_name": "BINARY_RSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 330, + "end_line": 332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_AND", + "long_name": "BINARY_AND( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 334, + "end_line": 336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_XOR", + "long_name": "BINARY_XOR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 338, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_OR", + "long_name": "BINARY_OR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 342, + "end_line": 344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_POWER", + "long_name": "INPLACE_POWER( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 348, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_MULTIPLY", + "long_name": "INPLACE_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 352, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_DIVIDE", + "long_name": "INPLACE_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 356, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_MODULO", + "long_name": "INPLACE_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 360, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_ADD", + "long_name": "INPLACE_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 364, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_SUBTRACT", + "long_name": "INPLACE_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 368, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_LSHIFT", + "long_name": "INPLACE_LSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 372, + "end_line": 374, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_RSHIFT", + "long_name": "INPLACE_RSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 376, + "end_line": 378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_AND", + "long_name": "INPLACE_AND( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 380, + "end_line": 382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_XOR", + "long_name": "INPLACE_XOR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 384, + "end_line": 386, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_OR", + "long_name": "INPLACE_OR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 388, + "end_line": 390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_0", + "long_name": "SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 394, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_1", + "long_name": "SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 398, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_2", + "long_name": "SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 402, + "end_line": 404, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_3", + "long_name": "SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 406, + "end_line": 408, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_0", + "long_name": "STORE_SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 412, + "end_line": 414, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_1", + "long_name": "STORE_SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 416, + "end_line": 418, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_2", + "long_name": "STORE_SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 420, + "end_line": 422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_3", + "long_name": "STORE_SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 424, + "end_line": 426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_0", + "long_name": "DELETE_SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 428, + "end_line": 430, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_1", + "long_name": "DELETE_SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 432, + "end_line": 434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_2", + "long_name": "DELETE_SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 436, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_3", + "long_name": "DELETE_SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 440, + "end_line": 442, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SUBSCR", + "long_name": "STORE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 444, + "end_line": 446, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SUBSCR", + "long_name": "DELETE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 448, + "end_line": 450, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_EXPR", + "long_name": "PRINT_EXPR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 452, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM", + "long_name": "PRINT_ITEM( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 456, + "end_line": 458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM_TO", + "long_name": "PRINT_ITEM_TO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 460, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE", + "long_name": "PRINT_NEWLINE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 464, + "end_line": 466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE_TO", + "long_name": "PRINT_NEWLINE_TO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 468, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BREAK_LOOP", + "long_name": "BREAK_LOOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 472, + "end_line": 474, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_LOCALS", + "long_name": "LOAD_LOCALS( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 476, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "RETURN_VALUE", + "long_name": "RETURN_VALUE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 480, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_STAR", + "long_name": "IMPORT_STAR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 484, + "end_line": 486, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "EXEC_STMT", + "long_name": "EXEC_STMT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 488, + "end_line": 490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_BLOCK", + "long_name": "POP_BLOCK( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 492, + "end_line": 494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "END_FINALLY", + "long_name": "END_FINALLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 496, + "end_line": 498, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_CLASS", + "long_name": "BUILD_CLASS( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 500, + "end_line": 502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_NAME", + "long_name": "STORE_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 506, + "end_line": 508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_NAME", + "long_name": "DELETE_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 510, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNPACK_SEQUENCE", + "long_name": "UNPACK_SEQUENCE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 514, + "end_line": 516, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DUP_TOPX", + "long_name": "DUP_TOPX( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 518, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_ATTR", + "long_name": "STORE_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 522, + "end_line": 524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_ATTR", + "long_name": "DELETE_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 526, + "end_line": 528, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_GLOBAL", + "long_name": "STORE_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 530, + "end_line": 532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_GLOBAL", + "long_name": "DELETE_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 534, + "end_line": 536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CONST", + "long_name": "LOAD_CONST( self , pc , consti )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "consti" + ], + "start_line": 538, + "end_line": 540, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_NAME", + "long_name": "LOAD_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 542, + "end_line": 544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_TUPLE", + "long_name": "BUILD_TUPLE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 546, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_LIST", + "long_name": "BUILD_LIST( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 550, + "end_line": 552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_MAP", + "long_name": "BUILD_MAP( self , pc , zero )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "zero" + ], + "start_line": 554, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_ATTR", + "long_name": "LOAD_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 558, + "end_line": 560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "COMPARE_OP", + "long_name": "COMPARE_OP( self , pc , opname )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "opname" + ], + "start_line": 562, + "end_line": 564, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_NAME", + "long_name": "IMPORT_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 566, + "end_line": 568, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_FROM", + "long_name": "IMPORT_FROM( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 570, + "end_line": 572, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_FORWARD", + "long_name": "JUMP_FORWARD( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 574, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_TRUE", + "long_name": "JUMP_IF_TRUE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 578, + "end_line": 580, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_FALSE", + "long_name": "JUMP_IF_FALSE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 582, + "end_line": 584, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_ABSOLUTE", + "long_name": "JUMP_ABSOLUTE( self , pc , target )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "target" + ], + "start_line": 586, + "end_line": 588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "FOR_LOOP", + "long_name": "FOR_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 590, + "end_line": 592, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_GLOBAL", + "long_name": "LOAD_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 594, + "end_line": 596, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_LOOP", + "long_name": "SETUP_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 598, + "end_line": 600, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_EXCEPT", + "long_name": "SETUP_EXCEPT( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 602, + "end_line": 604, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_FINALLY", + "long_name": "SETUP_FINALLY( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 606, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_FAST", + "long_name": "LOAD_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 610, + "end_line": 612, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_FAST", + "long_name": "STORE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 614, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_FAST", + "long_name": "DELETE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 618, + "end_line": 620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CLOSURE", + "long_name": "LOAD_CLOSURE( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 622, + "end_line": 624, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_DEREF", + "long_name": "LOAD_DEREF( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 626, + "end_line": 628, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_DEREF", + "long_name": "STORE_DEREF( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 630, + "end_line": 632, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SET_LINENO", + "long_name": "SET_LINENO( self , pc , lineno )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "lineno" + ], + "start_line": 634, + "end_line": 636, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "RAISE_VARARGS", + "long_name": "RAISE_VARARGS( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 638, + "end_line": 640, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION", + "long_name": "CALL_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 642, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "MAKE_FUNCTION", + "long_name": "MAKE_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 646, + "end_line": 648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "MAKE_CLOSURE", + "long_name": "MAKE_CLOSURE( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 650, + "end_line": 652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_SLICE", + "long_name": "BUILD_SLICE( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 654, + "end_line": 656, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "EXTENDED_ARG", + "long_name": "EXTENDED_ARG( self , pc , ext )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "ext" + ], + "start_line": 658, + "end_line": 660, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_VAR", + "long_name": "CALL_FUNCTION_VAR( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 662, + "end_line": 664, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_KW", + "long_name": "CALL_FUNCTION_KW( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 666, + "end_line": 668, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_VAR_KW", + "long_name": "CALL_FUNCTION_VAR_KW( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 670, + "end_line": 672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "v" + ], + "start_line": 684, + "end_line": 685, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , signature , name = None )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 72, + "parameters": [ + "self", + "function", + "signature", + "name" + ], + "start_line": 690, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "evaluate", + "long_name": "evaluate( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 3, + "token_count": 52, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 705, + "end_line": 711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "generate", + "long_name": "generate( self )", + "filename": "bytecodecompiler.py", + "nloc": 51, + "complexity": 14, + "token_count": 373, + "parameters": [ + "self" + ], + "start_line": 716, + "end_line": 798, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 83, + "top_nesting_level": 1 + }, + { + "name": "wrapped_code", + "long_name": "wrapped_code( self )", + "filename": "bytecodecompiler.py", + "nloc": 52, + "complexity": 5, + "token_count": 294, + "parameters": [ + "self" + ], + "start_line": 804, + "end_line": 869, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 1 + }, + { + "name": "indent", + "long_name": "indent( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 871, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "dedent", + "long_name": "dedent( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "emit", + "long_name": "emit( self , s )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self", + "s" + ], + "start_line": 882, + "end_line": 886, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "push", + "long_name": "push( self , v , t )", + "filename": "bytecodecompiler.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "v", + "t" + ], + "start_line": 891, + "end_line": 894, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "pop", + "long_name": "pop( self )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 899, + "end_line": 906, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "pushTuple", + "long_name": "pushTuple( self , V , T )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self", + "V", + "T" + ], + "start_line": 911, + "end_line": 916, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "popTuple", + "long_name": "popTuple( self )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 922, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "multiarg", + "long_name": "multiarg( self )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 933, + "end_line": 934, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "unique", + "long_name": "unique( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 939, + "end_line": 941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "post", + "long_name": "post( self , pc , action )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "pc", + "action" + ], + "start_line": 946, + "end_line": 950, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "emit_value", + "long_name": "emit_value( self , v )", + "filename": "bytecodecompiler.py", + "nloc": 10, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self", + "v" + ], + "start_line": 955, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "global_info", + "long_name": "global_info( self , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 4, + "token_count": 73, + "parameters": [ + "self", + "var_num" + ], + "start_line": 971, + "end_line": 984, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "codeup", + "long_name": "codeup( self , rhs , rhs_type )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self", + "rhs", + "rhs_type" + ], + "start_line": 990, + "end_line": 998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , pc , symbol )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 73, + "parameters": [ + "self", + "pc", + "symbol" + ], + "start_line": 1004, + "end_line": 1014, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "BINARY_ADD", + "long_name": "BINARY_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1019, + "end_line": 1020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBTRACT", + "long_name": "BINARY_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1021, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MULTIPLY", + "long_name": "BINARY_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self", + "pc" + ], + "start_line": 1023, + "end_line": 1025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_DIVIDE", + "long_name": "BINARY_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1026, + "end_line": 1027, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MODULO", + "long_name": "BINARY_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1028, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBSCR", + "long_name": "BINARY_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "pc" + ], + "start_line": 1030, + "end_line": 1040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "STORE_SUBSCR", + "long_name": "STORE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 2, + "token_count": 97, + "parameters": [ + "self", + "pc" + ], + "start_line": 1042, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "COMPARE_OP", + "long_name": "COMPARE_OP( self , pc , opname )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "pc", + "opname" + ], + "start_line": 1057, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM", + "long_name": "PRINT_ITEM( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 1, + "token_count": 88, + "parameters": [ + "self", + "pc" + ], + "start_line": 1065, + "end_line": 1078, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE", + "long_name": "PRINT_NEWLINE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "pc" + ], + "start_line": 1084, + "end_line": 1091, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "SET_LINENO", + "long_name": "SET_LINENO( self , pc , lineno )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "pc", + "lineno" + ], + "start_line": 1096, + "end_line": 1098, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_TOP", + "long_name": "POP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "pc" + ], + "start_line": 1103, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CONST", + "long_name": "LOAD_CONST( self , pc , consti )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self", + "pc", + "consti" + ], + "start_line": 1110, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "BUILD_TUPLE", + "long_name": "BUILD_TUPLE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 12, + "complexity": 2, + "token_count": 72, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 1128, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "LOAD_FAST", + "long_name": "LOAD_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 12, + "complexity": 3, + "token_count": 85, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1144, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "LOAD_GLOBAL", + "long_name": "LOAD_GLOBAL( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 25, + "complexity": 3, + "token_count": 165, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1160, + "end_line": 1195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 1 + }, + { + "name": "SETUP_LOOP", + "long_name": "SETUP_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1197, + "end_line": 1199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "FOR_LOOP", + "long_name": "FOR_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1201, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "JUMP_ABSOLUTE", + "long_name": "JUMP_ABSOLUTE( self , pc , target )", + "filename": "bytecodecompiler.py", + "nloc": 4, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "pc", + "target" + ], + "start_line": 1213, + "end_line": 1216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "POP_BLOCK", + "long_name": "POP_BLOCK( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "pc" + ], + "start_line": 1218, + "end_line": 1220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_FAST", + "long_name": "STORE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 4, + "token_count": 101, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1226, + "end_line": 1244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "STORE_GLOBAL", + "long_name": "STORE_GLOBAL( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 15, + "complexity": 1, + "token_count": 99, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1249, + "end_line": 1269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION", + "long_name": "CALL_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 18, + "complexity": 2, + "token_count": 125, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 1274, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_FALSE", + "long_name": "JUMP_IF_FALSE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1306, + "end_line": 1320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "JUMP_FORWARD", + "long_name": "JUMP_FORWARD( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1326, + "end_line": 1332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "RETURN_VALUE", + "long_name": "RETURN_VALUE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "pc" + ], + "start_line": 1337, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "__repr__", + "long_name": "__repr__( self )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 20, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , code , return_type , support = '' )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self", + "code", + "return_type", + "support" + ], + "start_line": 32, + "end_line": 36, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "opcodize", + "long_name": "opcodize( s )", + "filename": "bytecodecompiler.py", + "nloc": 16, + "complexity": 3, + "token_count": 92, + "parameters": [ + "s" + ], + "start_line": 159, + "end_line": 174, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + }, + { + "name": "listing", + "long_name": "listing( f )", + "filename": "bytecodecompiler.py", + "nloc": 29, + "complexity": 9, + "token_count": 166, + "parameters": [ + "f" + ], + "start_line": 181, + "end_line": 209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "fetch", + "long_name": "fetch( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 67, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 215, + "end_line": 223, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "execute", + "long_name": "execute( self , pc , opcode , argument )", + "filename": "bytecodecompiler.py", + "nloc": 7, + "complexity": 2, + "token_count": 54, + "parameters": [ + "self", + "pc", + "opcode", + "argument" + ], + "start_line": 225, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "evaluate", + "long_name": "evaluate( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 3, + "token_count": 54, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 233, + "end_line": 241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "cmp_op", + "long_name": "cmp_op( self , opname )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 14, + "parameters": [ + "self", + "opname" + ], + "start_line": 248, + "end_line": 249, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "STOP_CODE", + "long_name": "STOP_CODE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 251, + "end_line": 253, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_TOP", + "long_name": "POP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 254, + "end_line": 256, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_TWO", + "long_name": "ROT_TWO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 258, + "end_line": 260, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_THREE", + "long_name": "ROT_THREE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 262, + "end_line": 264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "ROT_FOUR", + "long_name": "ROT_FOUR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 266, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DUP_TOP", + "long_name": "DUP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 270, + "end_line": 272, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_POSITIVE", + "long_name": "UNARY_POSITIVE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 276, + "end_line": 278, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_NEGATIVE", + "long_name": "UNARY_NEGATIVE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 280, + "end_line": 282, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_NOT", + "long_name": "UNARY_NOT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 284, + "end_line": 286, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_CONVERT", + "long_name": "UNARY_CONVERT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 288, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNARY_INVERT", + "long_name": "UNARY_INVERT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 292, + "end_line": 294, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_POWER", + "long_name": "BINARY_POWER( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 298, + "end_line": 300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MULTIPLY", + "long_name": "BINARY_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 302, + "end_line": 304, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_DIVIDE", + "long_name": "BINARY_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 306, + "end_line": 308, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MODULO", + "long_name": "BINARY_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 310, + "end_line": 312, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_ADD", + "long_name": "BINARY_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 314, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBTRACT", + "long_name": "BINARY_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 318, + "end_line": 320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBSCR", + "long_name": "BINARY_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 322, + "end_line": 324, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_LSHIFT", + "long_name": "BINARY_LSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 326, + "end_line": 328, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_RSHIFT", + "long_name": "BINARY_RSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 330, + "end_line": 332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_AND", + "long_name": "BINARY_AND( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 334, + "end_line": 336, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_XOR", + "long_name": "BINARY_XOR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 338, + "end_line": 340, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_OR", + "long_name": "BINARY_OR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 342, + "end_line": 344, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_POWER", + "long_name": "INPLACE_POWER( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 348, + "end_line": 350, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_MULTIPLY", + "long_name": "INPLACE_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 352, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_DIVIDE", + "long_name": "INPLACE_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 356, + "end_line": 358, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_MODULO", + "long_name": "INPLACE_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 360, + "end_line": 362, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_ADD", + "long_name": "INPLACE_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 364, + "end_line": 366, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_SUBTRACT", + "long_name": "INPLACE_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 368, + "end_line": 370, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_LSHIFT", + "long_name": "INPLACE_LSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 372, + "end_line": 374, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_RSHIFT", + "long_name": "INPLACE_RSHIFT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 376, + "end_line": 378, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_AND", + "long_name": "INPLACE_AND( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 380, + "end_line": 382, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_XOR", + "long_name": "INPLACE_XOR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 384, + "end_line": 386, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "INPLACE_OR", + "long_name": "INPLACE_OR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 388, + "end_line": 390, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_0", + "long_name": "SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 394, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_1", + "long_name": "SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 398, + "end_line": 400, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_2", + "long_name": "SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 402, + "end_line": 404, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SLICE_3", + "long_name": "SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 406, + "end_line": 408, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_0", + "long_name": "STORE_SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 412, + "end_line": 414, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_1", + "long_name": "STORE_SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 416, + "end_line": 418, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_2", + "long_name": "STORE_SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 420, + "end_line": 422, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SLICE_3", + "long_name": "STORE_SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 424, + "end_line": 426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_0", + "long_name": "DELETE_SLICE_0( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 428, + "end_line": 430, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_1", + "long_name": "DELETE_SLICE_1( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 432, + "end_line": 434, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_2", + "long_name": "DELETE_SLICE_2( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 436, + "end_line": 438, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SLICE_3", + "long_name": "DELETE_SLICE_3( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 440, + "end_line": 442, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_SUBSCR", + "long_name": "STORE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 444, + "end_line": 446, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_SUBSCR", + "long_name": "DELETE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 448, + "end_line": 450, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_EXPR", + "long_name": "PRINT_EXPR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 452, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM", + "long_name": "PRINT_ITEM( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 456, + "end_line": 458, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM_TO", + "long_name": "PRINT_ITEM_TO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 460, + "end_line": 462, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE", + "long_name": "PRINT_NEWLINE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 464, + "end_line": 466, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE_TO", + "long_name": "PRINT_NEWLINE_TO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 468, + "end_line": 470, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BREAK_LOOP", + "long_name": "BREAK_LOOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 472, + "end_line": 474, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_LOCALS", + "long_name": "LOAD_LOCALS( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 476, + "end_line": 478, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "RETURN_VALUE", + "long_name": "RETURN_VALUE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 480, + "end_line": 482, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_STAR", + "long_name": "IMPORT_STAR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 484, + "end_line": 486, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "EXEC_STMT", + "long_name": "EXEC_STMT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 488, + "end_line": 490, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_BLOCK", + "long_name": "POP_BLOCK( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 492, + "end_line": 494, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "END_FINALLY", + "long_name": "END_FINALLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 496, + "end_line": 498, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_CLASS", + "long_name": "BUILD_CLASS( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self", + "pc" + ], + "start_line": 500, + "end_line": 502, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_NAME", + "long_name": "STORE_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 506, + "end_line": 508, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_NAME", + "long_name": "DELETE_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 510, + "end_line": 512, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "UNPACK_SEQUENCE", + "long_name": "UNPACK_SEQUENCE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 514, + "end_line": 516, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DUP_TOPX", + "long_name": "DUP_TOPX( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 518, + "end_line": 520, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_ATTR", + "long_name": "STORE_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 522, + "end_line": 524, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_ATTR", + "long_name": "DELETE_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 526, + "end_line": 528, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_GLOBAL", + "long_name": "STORE_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 530, + "end_line": 532, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_GLOBAL", + "long_name": "DELETE_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 534, + "end_line": 536, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CONST", + "long_name": "LOAD_CONST( self , pc , consti )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "consti" + ], + "start_line": 538, + "end_line": 540, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_NAME", + "long_name": "LOAD_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 542, + "end_line": 544, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_TUPLE", + "long_name": "BUILD_TUPLE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 546, + "end_line": 548, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_LIST", + "long_name": "BUILD_LIST( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 550, + "end_line": 552, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_MAP", + "long_name": "BUILD_MAP( self , pc , zero )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "zero" + ], + "start_line": 554, + "end_line": 556, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_ATTR", + "long_name": "LOAD_ATTR( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 558, + "end_line": 560, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "COMPARE_OP", + "long_name": "COMPARE_OP( self , pc , opname )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "opname" + ], + "start_line": 562, + "end_line": 564, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_NAME", + "long_name": "IMPORT_NAME( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 566, + "end_line": 568, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "IMPORT_FROM", + "long_name": "IMPORT_FROM( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 570, + "end_line": 572, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_FORWARD", + "long_name": "JUMP_FORWARD( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 574, + "end_line": 576, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_TRUE", + "long_name": "JUMP_IF_TRUE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 578, + "end_line": 580, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_FALSE", + "long_name": "JUMP_IF_FALSE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 582, + "end_line": 584, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "JUMP_ABSOLUTE", + "long_name": "JUMP_ABSOLUTE( self , pc , target )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "target" + ], + "start_line": 586, + "end_line": 588, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "FOR_LOOP", + "long_name": "FOR_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 590, + "end_line": 592, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_GLOBAL", + "long_name": "LOAD_GLOBAL( self , pc , namei )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "namei" + ], + "start_line": 594, + "end_line": 596, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_LOOP", + "long_name": "SETUP_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 598, + "end_line": 600, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_EXCEPT", + "long_name": "SETUP_EXCEPT( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 602, + "end_line": 604, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SETUP_FINALLY", + "long_name": "SETUP_FINALLY( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 606, + "end_line": 608, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_FAST", + "long_name": "LOAD_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 610, + "end_line": 612, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_FAST", + "long_name": "STORE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 614, + "end_line": 616, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "DELETE_FAST", + "long_name": "DELETE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 618, + "end_line": 620, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CLOSURE", + "long_name": "LOAD_CLOSURE( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 622, + "end_line": 624, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_DEREF", + "long_name": "LOAD_DEREF( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 626, + "end_line": 628, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_DEREF", + "long_name": "STORE_DEREF( self , pc , i )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "i" + ], + "start_line": 630, + "end_line": 632, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "SET_LINENO", + "long_name": "SET_LINENO( self , pc , lineno )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "lineno" + ], + "start_line": 634, + "end_line": 636, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "RAISE_VARARGS", + "long_name": "RAISE_VARARGS( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 638, + "end_line": 640, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION", + "long_name": "CALL_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 642, + "end_line": 644, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "MAKE_FUNCTION", + "long_name": "MAKE_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 646, + "end_line": 648, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "MAKE_CLOSURE", + "long_name": "MAKE_CLOSURE( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 650, + "end_line": 652, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BUILD_SLICE", + "long_name": "BUILD_SLICE( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 654, + "end_line": 656, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "EXTENDED_ARG", + "long_name": "EXTENDED_ARG( self , pc , ext )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "ext" + ], + "start_line": 658, + "end_line": 660, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_VAR", + "long_name": "CALL_FUNCTION_VAR( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 662, + "end_line": 664, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_KW", + "long_name": "CALL_FUNCTION_KW( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 666, + "end_line": 668, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION_VAR_KW", + "long_name": "CALL_FUNCTION_VAR_KW( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 12, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 670, + "end_line": 672, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "typedef_by_value", + "long_name": "typedef_by_value( self , v )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "v" + ], + "start_line": 684, + "end_line": 685, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , signature , name = None )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 72, + "parameters": [ + "self", + "function", + "signature", + "name" + ], + "start_line": 690, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "evaluate", + "long_name": "evaluate( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 3, + "token_count": 52, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 705, + "end_line": 711, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "generate", + "long_name": "generate( self )", + "filename": "bytecodecompiler.py", + "nloc": 51, + "complexity": 14, + "token_count": 373, + "parameters": [ + "self" + ], + "start_line": 716, + "end_line": 798, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 83, + "top_nesting_level": 1 + }, + { + "name": "wrapped_code", + "long_name": "wrapped_code( self )", + "filename": "bytecodecompiler.py", + "nloc": 52, + "complexity": 5, + "token_count": 294, + "parameters": [ + "self" + ], + "start_line": 804, + "end_line": 869, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 66, + "top_nesting_level": 1 + }, + { + "name": "indent", + "long_name": "indent( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 871, + "end_line": 873, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "dedent", + "long_name": "dedent( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 875, + "end_line": 877, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "emit", + "long_name": "emit( self , s )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self", + "s" + ], + "start_line": 882, + "end_line": 886, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "push", + "long_name": "push( self , v , t )", + "filename": "bytecodecompiler.py", + "nloc": 4, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "v", + "t" + ], + "start_line": 891, + "end_line": 894, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "pop", + "long_name": "pop( self )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 899, + "end_line": 906, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "pushTuple", + "long_name": "pushTuple( self , V , T )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 40, + "parameters": [ + "self", + "V", + "T" + ], + "start_line": 911, + "end_line": 916, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "popTuple", + "long_name": "popTuple( self )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self" + ], + "start_line": 922, + "end_line": 929, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "multiarg", + "long_name": "multiarg( self )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 933, + "end_line": 934, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "unique", + "long_name": "unique( self )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self" + ], + "start_line": 939, + "end_line": 941, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "post", + "long_name": "post( self , pc , action )", + "filename": "bytecodecompiler.py", + "nloc": 5, + "complexity": 2, + "token_count": 41, + "parameters": [ + "self", + "pc", + "action" + ], + "start_line": 946, + "end_line": 950, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "emit_value", + "long_name": "emit_value( self , v )", + "filename": "bytecodecompiler.py", + "nloc": 10, + "complexity": 1, + "token_count": 55, + "parameters": [ + "self", + "v" + ], + "start_line": 955, + "end_line": 966, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "global_info", + "long_name": "global_info( self , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 4, + "token_count": 73, + "parameters": [ + "self", + "var_num" + ], + "start_line": 971, + "end_line": 984, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "codeup", + "long_name": "codeup( self , rhs , rhs_type )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self", + "rhs", + "rhs_type" + ], + "start_line": 990, + "end_line": 998, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "binop", + "long_name": "binop( self , pc , symbol )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 73, + "parameters": [ + "self", + "pc", + "symbol" + ], + "start_line": 1004, + "end_line": 1014, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "BINARY_ADD", + "long_name": "BINARY_ADD( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1019, + "end_line": 1020, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBTRACT", + "long_name": "BINARY_SUBTRACT( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1021, + "end_line": 1022, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MULTIPLY", + "long_name": "BINARY_MULTIPLY( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 52, + "parameters": [ + "self", + "pc" + ], + "start_line": 1023, + "end_line": 1025, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "BINARY_DIVIDE", + "long_name": "BINARY_DIVIDE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1026, + "end_line": 1027, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_MODULO", + "long_name": "BINARY_MODULO( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 2, + "complexity": 1, + "token_count": 16, + "parameters": [ + "self", + "pc" + ], + "start_line": 1028, + "end_line": 1029, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "BINARY_SUBSCR", + "long_name": "BINARY_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 78, + "parameters": [ + "self", + "pc" + ], + "start_line": 1030, + "end_line": 1040, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "STORE_SUBSCR", + "long_name": "STORE_SUBSCR( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 2, + "token_count": 97, + "parameters": [ + "self", + "pc" + ], + "start_line": 1042, + "end_line": 1055, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "COMPARE_OP", + "long_name": "COMPARE_OP( self , pc , opname )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "pc", + "opname" + ], + "start_line": 1057, + "end_line": 1059, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "PRINT_ITEM", + "long_name": "PRINT_ITEM( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 1, + "token_count": 88, + "parameters": [ + "self", + "pc" + ], + "start_line": 1065, + "end_line": 1078, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 14, + "top_nesting_level": 1 + }, + { + "name": "PRINT_NEWLINE", + "long_name": "PRINT_NEWLINE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 41, + "parameters": [ + "self", + "pc" + ], + "start_line": 1084, + "end_line": 1091, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "SET_LINENO", + "long_name": "SET_LINENO( self , pc , lineno )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 26, + "parameters": [ + "self", + "pc", + "lineno" + ], + "start_line": 1096, + "end_line": 1098, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "POP_TOP", + "long_name": "POP_TOP( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "pc" + ], + "start_line": 1103, + "end_line": 1105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "LOAD_CONST", + "long_name": "LOAD_CONST( self , pc , consti )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self", + "pc", + "consti" + ], + "start_line": 1110, + "end_line": 1122, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "BUILD_TUPLE", + "long_name": "BUILD_TUPLE( self , pc , count )", + "filename": "bytecodecompiler.py", + "nloc": 12, + "complexity": 2, + "token_count": 72, + "parameters": [ + "self", + "pc", + "count" + ], + "start_line": 1128, + "end_line": 1139, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "LOAD_FAST", + "long_name": "LOAD_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 12, + "complexity": 3, + "token_count": 85, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1144, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "LOAD_GLOBAL", + "long_name": "LOAD_GLOBAL( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 25, + "complexity": 3, + "token_count": 165, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1160, + "end_line": 1195, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 36, + "top_nesting_level": 1 + }, + { + "name": "SETUP_LOOP", + "long_name": "SETUP_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1197, + "end_line": 1199, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "FOR_LOOP", + "long_name": "FOR_LOOP( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 8, + "complexity": 1, + "token_count": 57, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1201, + "end_line": 1211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "JUMP_ABSOLUTE", + "long_name": "JUMP_ABSOLUTE( self , pc , target )", + "filename": "bytecodecompiler.py", + "nloc": 4, + "complexity": 1, + "token_count": 17, + "parameters": [ + "self", + "pc", + "target" + ], + "start_line": 1213, + "end_line": 1216, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "POP_BLOCK", + "long_name": "POP_BLOCK( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 3, + "complexity": 1, + "token_count": 9, + "parameters": [ + "self", + "pc" + ], + "start_line": 1218, + "end_line": 1220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "STORE_FAST", + "long_name": "STORE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 4, + "token_count": 101, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1226, + "end_line": 1244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "STORE_GLOBAL", + "long_name": "STORE_GLOBAL( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 15, + "complexity": 1, + "token_count": 99, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1249, + "end_line": 1269, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 1 + }, + { + "name": "CALL_FUNCTION", + "long_name": "CALL_FUNCTION( self , pc , argc )", + "filename": "bytecodecompiler.py", + "nloc": 18, + "complexity": 2, + "token_count": 125, + "parameters": [ + "self", + "pc", + "argc" + ], + "start_line": 1274, + "end_line": 1300, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "JUMP_IF_FALSE", + "long_name": "JUMP_IF_FALSE( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 89, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1306, + "end_line": 1320, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "JUMP_FORWARD", + "long_name": "JUMP_FORWARD( self , pc , delta )", + "filename": "bytecodecompiler.py", + "nloc": 6, + "complexity": 1, + "token_count": 36, + "parameters": [ + "self", + "pc", + "delta" + ], + "start_line": 1326, + "end_line": 1332, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "RETURN_VALUE", + "long_name": "RETURN_VALUE( self , pc )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 4, + "token_count": 69, + "parameters": [ + "self", + "pc" + ], + "start_line": 1337, + "end_line": 1349, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "listing", + "long_name": "listing( f )", + "filename": "bytecodecompiler.py", + "nloc": 29, + "complexity": 9, + "token_count": 166, + "parameters": [ + "f" + ], + "start_line": 181, + "end_line": 209, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 29, + "top_nesting_level": 0 + }, + { + "name": "LOAD_FAST", + "long_name": "LOAD_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 12, + "complexity": 3, + "token_count": 85, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1144, + "end_line": 1155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "STORE_FAST", + "long_name": "STORE_FAST( self , pc , var_num )", + "filename": "bytecodecompiler.py", + "nloc": 13, + "complexity": 4, + "token_count": 101, + "parameters": [ + "self", + "pc", + "var_num" + ], + "start_line": 1226, + "end_line": 1244, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 19, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , function , signature , name = None )", + "filename": "bytecodecompiler.py", + "nloc": 11, + "complexity": 2, + "token_count": 72, + "parameters": [ + "self", + "function", + "signature", + "name" + ], + "start_line": 690, + "end_line": 700, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "execute", + "long_name": "execute( self , pc , opcode , argument )", + "filename": "bytecodecompiler.py", + "nloc": 7, + "complexity": 2, + "token_count": 54, + "parameters": [ + "self", + "pc", + "opcode", + "argument" + ], + "start_line": 225, + "end_line": 231, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "evaluate", + "long_name": "evaluate( self , pc , code )", + "filename": "bytecodecompiler.py", + "nloc": 9, + "complexity": 3, + "token_count": 54, + "parameters": [ + "self", + "pc", + "code" + ], + "start_line": 233, + "end_line": 241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "generate", + "long_name": "generate( self )", + "filename": "bytecodecompiler.py", + "nloc": 51, + "complexity": 14, + "token_count": 373, + "parameters": [ + "self" + ], + "start_line": 716, + "end_line": 798, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 83, + "top_nesting_level": 1 + } + ], + "nloc": 934, + "complexity": 211, + "token_count": 5135, + "diff_parsed": { + "added": [ + " if arg is None: arg = ''", + " if argument is None:", + " elif goto is None:", + " if name is None: name = function.func_name", + " if T is None: continue", + " if t is None:", + " if saveT is None or t == saveT:" + ], + "deleted": [ + " if arg == None: arg = ''", + " if argument == None:", + " elif goto == None:", + " if name == None: name = function.func_name", + " if T == None: continue", + " if t == None:", + " if saveT == None or t == saveT:" + ] + } + }, + { + "old_path": "weave/lib2def.py", + "new_path": "weave/lib2def.py", + "filename": "lib2def.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -106,7 +106,7 @@ def output_def(dlist, flist, header, file = sys.stdout):\n \n if __name__ == '__main__':\n libfile, deffile = parse_cmd()\n- if deffile == None:\n+ if deffile is None:\n deffile = sys.stdout\n else:\n deffile = open(deffile, 'w')\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "import re\nimport sys\nimport os\nimport string\n\n__doc__ = \"\"\"This module generates a DEF file from the symbols in\nan MSVC-compiled DLL import library. It correctly discriminates between\ndata and functions. The data is collected from the output of the program\nnm(1).\n\nUsage:\n python lib2def.py [libname.lib] [output.def]\nor\n python lib2def.py [libname.lib] > output.def\n\nlibname.lib defaults to python.lib and output.def defaults to stdout\n\nAuthor: Robert Kern \nLast Update: April 30, 1999\n\"\"\"\n\n__version__ = '0.1a'\n\nimport sys\n\npy_ver = \"%d%d\" % tuple(sys.version_info[:2])\n\nDEFAULT_NM = 'nm -Cs'\n\nDEF_HEADER = \"\"\"LIBRARY\t\tpython%s.dll\n;CODE\t\tPRELOAD MOVEABLE DISCARDABLE\n;DATA\t\tPRELOAD SINGLE\n\nEXPORTS\n\"\"\" % py_ver\n# the header of the DEF file\n\nFUNC_RE = re.compile(r\"^(.*) in python%s\\.dll\" % py_ver, re.MULTILINE)\nDATA_RE = re.compile(r\"^_imp__(.*) in python%s\\.dll\" % py_ver, re.MULTILINE)\n\ndef parse_cmd():\n \"\"\"Parses the command-line arguments.\n\nlibfile, deffile = parse_cmd()\"\"\"\n if len(sys.argv) == 3:\n if sys.argv[1][-4:] == '.lib' and sys.argv[2][-4:] == '.def':\n libfile, deffile = sys.argv[1:]\n elif sys.argv[1][-4:] == '.def' and sys.argv[2][-4:] == '.lib':\n deffile, libfile = sys.argv[1:]\n else:\n print \"I'm assuming that your first argument is the library\"\n print \"and the second is the DEF file.\"\n elif len(sys.argv) == 2:\n if sys.argv[1][-4:] == '.def':\n deffile = sys.argv[1]\n libfile = 'python%s.lib' % py_ver\n elif sys.argv[1][-4:] == '.lib':\n deffile = None\n libfile = sys.argv[1]\n else:\n libfile = 'python%s.lib' % py_ver\n deffile = None\n return libfile, deffile\n\ndef getnm(nm_cmd = 'nm -Cs python%s.lib' % py_ver):\n \"\"\"Returns the output of nm_cmd via a pipe.\n\nnm_output = getnam(nm_cmd = 'nm -Cs py_lib')\"\"\"\n f = os.popen(nm_cmd)\n nm_output = f.read()\n f.close()\n return nm_output\n\ndef parse_nm(nm_output):\n \"\"\"Returns a tuple of lists: dlist for the list of data\nsymbols and flist for the list of function symbols.\n\ndlist, flist = parse_nm(nm_output)\"\"\"\n data = DATA_RE.findall(nm_output)\n func = FUNC_RE.findall(nm_output)\n\n flist = []\n for sym in data:\n if sym in func and (sym[:2] == 'Py' or sym[:3] == '_Py' or sym[:4] == 'init'):\n flist.append(sym)\n\n dlist = []\n for sym in data:\n if sym not in flist and (sym[:2] == 'Py' or sym[:3] == '_Py'):\n dlist.append(sym)\n \n dlist.sort()\n flist.sort()\n return dlist, flist\n\ndef output_def(dlist, flist, header, file = sys.stdout):\n \"\"\"Outputs the final DEF file to a file defaulting to stdout.\n\noutput_def(dlist, flist, header, file = sys.stdout)\"\"\"\n for data_sym in dlist:\n header = header + '\\t%s DATA\\n' % data_sym\n header = header + '\\n' # blank line\n for func_sym in flist:\n header = header + '\\t%s\\n' % func_sym\n file.write(header)\n\nif __name__ == '__main__':\n libfile, deffile = parse_cmd()\n if deffile is None:\n deffile = sys.stdout\n else:\n deffile = open(deffile, 'w')\n nm_cmd = '%s %s' % (DEFAULT_NM, libfile)\n nm_output = getnm(nm_cmd)\n dlist, flist = parse_nm(nm_output)\n output_def(dlist, flist, DEF_HEADER, deffile)\n", + "source_code_before": "import re\nimport sys\nimport os\nimport string\n\n__doc__ = \"\"\"This module generates a DEF file from the symbols in\nan MSVC-compiled DLL import library. It correctly discriminates between\ndata and functions. The data is collected from the output of the program\nnm(1).\n\nUsage:\n python lib2def.py [libname.lib] [output.def]\nor\n python lib2def.py [libname.lib] > output.def\n\nlibname.lib defaults to python.lib and output.def defaults to stdout\n\nAuthor: Robert Kern \nLast Update: April 30, 1999\n\"\"\"\n\n__version__ = '0.1a'\n\nimport sys\n\npy_ver = \"%d%d\" % tuple(sys.version_info[:2])\n\nDEFAULT_NM = 'nm -Cs'\n\nDEF_HEADER = \"\"\"LIBRARY\t\tpython%s.dll\n;CODE\t\tPRELOAD MOVEABLE DISCARDABLE\n;DATA\t\tPRELOAD SINGLE\n\nEXPORTS\n\"\"\" % py_ver\n# the header of the DEF file\n\nFUNC_RE = re.compile(r\"^(.*) in python%s\\.dll\" % py_ver, re.MULTILINE)\nDATA_RE = re.compile(r\"^_imp__(.*) in python%s\\.dll\" % py_ver, re.MULTILINE)\n\ndef parse_cmd():\n \"\"\"Parses the command-line arguments.\n\nlibfile, deffile = parse_cmd()\"\"\"\n if len(sys.argv) == 3:\n if sys.argv[1][-4:] == '.lib' and sys.argv[2][-4:] == '.def':\n libfile, deffile = sys.argv[1:]\n elif sys.argv[1][-4:] == '.def' and sys.argv[2][-4:] == '.lib':\n deffile, libfile = sys.argv[1:]\n else:\n print \"I'm assuming that your first argument is the library\"\n print \"and the second is the DEF file.\"\n elif len(sys.argv) == 2:\n if sys.argv[1][-4:] == '.def':\n deffile = sys.argv[1]\n libfile = 'python%s.lib' % py_ver\n elif sys.argv[1][-4:] == '.lib':\n deffile = None\n libfile = sys.argv[1]\n else:\n libfile = 'python%s.lib' % py_ver\n deffile = None\n return libfile, deffile\n\ndef getnm(nm_cmd = 'nm -Cs python%s.lib' % py_ver):\n \"\"\"Returns the output of nm_cmd via a pipe.\n\nnm_output = getnam(nm_cmd = 'nm -Cs py_lib')\"\"\"\n f = os.popen(nm_cmd)\n nm_output = f.read()\n f.close()\n return nm_output\n\ndef parse_nm(nm_output):\n \"\"\"Returns a tuple of lists: dlist for the list of data\nsymbols and flist for the list of function symbols.\n\ndlist, flist = parse_nm(nm_output)\"\"\"\n data = DATA_RE.findall(nm_output)\n func = FUNC_RE.findall(nm_output)\n\n flist = []\n for sym in data:\n if sym in func and (sym[:2] == 'Py' or sym[:3] == '_Py' or sym[:4] == 'init'):\n flist.append(sym)\n\n dlist = []\n for sym in data:\n if sym not in flist and (sym[:2] == 'Py' or sym[:3] == '_Py'):\n dlist.append(sym)\n \n dlist.sort()\n flist.sort()\n return dlist, flist\n\ndef output_def(dlist, flist, header, file = sys.stdout):\n \"\"\"Outputs the final DEF file to a file defaulting to stdout.\n\noutput_def(dlist, flist, header, file = sys.stdout)\"\"\"\n for data_sym in dlist:\n header = header + '\\t%s DATA\\n' % data_sym\n header = header + '\\n' # blank line\n for func_sym in flist:\n header = header + '\\t%s\\n' % func_sym\n file.write(header)\n\nif __name__ == '__main__':\n libfile, deffile = parse_cmd()\n if deffile == None:\n deffile = sys.stdout\n else:\n deffile = open(deffile, 'w')\n nm_cmd = '%s %s' % (DEFAULT_NM, libfile)\n nm_output = getnm(nm_cmd)\n dlist, flist = parse_nm(nm_output)\n output_def(dlist, flist, DEF_HEADER, deffile)\n", + "methods": [ + { + "name": "parse_cmd", + "long_name": "parse_cmd( )", + "filename": "lib2def.py", + "nloc": 20, + "complexity": 9, + "token_count": 179, + "parameters": [], + "start_line": 41, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "getnm", + "long_name": "getnm( nm_cmd = 'nm -Cs python%s.lib' % py_ver )", + "filename": "lib2def.py", + "nloc": 5, + "complexity": 1, + "token_count": 32, + "parameters": [ + "nm_cmd" + ], + "start_line": 65, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "parse_nm", + "long_name": "parse_nm( nm_output )", + "filename": "lib2def.py", + "nloc": 14, + "complexity": 10, + "token_count": 121, + "parameters": [ + "nm_output" + ], + "start_line": 74, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "output_def", + "long_name": "output_def( dlist , flist , header , file = sys . stdout )", + "filename": "lib2def.py", + "nloc": 7, + "complexity": 3, + "token_count": 51, + "parameters": [ + "dlist", + "flist", + "header", + "file" + ], + "start_line": 96, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "parse_cmd", + "long_name": "parse_cmd( )", + "filename": "lib2def.py", + "nloc": 20, + "complexity": 9, + "token_count": 179, + "parameters": [], + "start_line": 41, + "end_line": 63, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "getnm", + "long_name": "getnm( nm_cmd = 'nm -Cs python%s.lib' % py_ver )", + "filename": "lib2def.py", + "nloc": 5, + "complexity": 1, + "token_count": 32, + "parameters": [ + "nm_cmd" + ], + "start_line": 65, + "end_line": 72, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + }, + { + "name": "parse_nm", + "long_name": "parse_nm( nm_output )", + "filename": "lib2def.py", + "nloc": 14, + "complexity": 10, + "token_count": 121, + "parameters": [ + "nm_output" + ], + "start_line": 74, + "end_line": 94, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "output_def", + "long_name": "output_def( dlist , flist , header , file = sys . stdout )", + "filename": "lib2def.py", + "nloc": 7, + "complexity": 3, + "token_count": 51, + "parameters": [ + "dlist", + "flist", + "header", + "file" + ], + "start_line": 96, + "end_line": 105, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 0 + } + ], + "changed_methods": [], + "nloc": 87, + "complexity": 23, + "token_count": 520, + "diff_parsed": { + "added": [ + " if deffile is None:" + ], + "deleted": [ + " if deffile == None:" + ] + } + }, + { + "old_path": "weave/tests/test_catalog.py", + "new_path": "weave/tests/test_catalog.py", + "filename": "test_catalog.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -127,10 +127,10 @@ def check_set_module_directory(self):\n def check_clear_module_directory(self):\n q = catalog.catalog()\n r = q.get_module_directory()\n- assert (r == None)\n+ assert (r is None)\n q.set_module_directory('bob')\n r = q.clear_module_directory()\n- assert (r == None)\n+ assert (r is None)\n def check_get_environ_path(self):\n if sys.platform == 'win32': sep = ';'\n else: sep = ':'\n", + "added_lines": 2, + "deleted_lines": 2, + "source_code": "import unittest\nimport sys, os\n\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport catalog\nreload(catalog) # this'll pick up any recent code changes\nrestore_path()\n\nadd_local_to_path(__name__)\nfrom weave_test_utils import *\nrestore_path()\n\n\nclass test_default_dir(unittest.TestCase):\n def check_is_writable(self):\n path = catalog.default_dir()\n name = os.path.join(path,'dummy_catalog')\n test_file = open(name,'w')\n try:\n test_file.write('making sure default location is writable\\n')\n finally:\n test_file.close()\n os.remove(name)\n\nclass test_os_dependent_catalog_name(unittest.TestCase): \n pass\n \nclass test_catalog_path(unittest.TestCase): \n def check_default(self):\n in_path = catalog.default_dir()\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == in_path)\n assert(f == catalog.os_dependent_catalog_name())\n def check_current(self):\n in_path = '.'\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == os.path.abspath(in_path)) \n assert(f == catalog.os_dependent_catalog_name()) \n def check_user(path):\n if sys.platform != 'win32':\n in_path = '~'\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == os.path.expanduser(in_path)) \n assert(f == catalog.os_dependent_catalog_name())\n def check_module(self):\n # hand it a module and see if it uses the parent directory\n # of the module.\n path = catalog.catalog_path(os.__file__)\n d,f = os.path.split(os.__file__)\n d2,f = os.path.split(path)\n assert (d2 == d)\n def check_path(self):\n # use os.__file__ to get a usable directory.\n in_path,f = os.path.split(os.__file__)\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert (d == in_path)\n def check_bad_path(self):\n # stupid_path_name\n in_path = 'stupid_path_name'\n path = catalog.catalog_path(in_path)\n assert (path is None)\n\nclass test_get_catalog(unittest.TestCase):\n \"\"\" This only tests whether new catalogs are created correctly.\n And whether non-existent return None correctly with read mode.\n Putting catalogs in the right place is all tested with\n catalog_dir tests.\n \"\"\"\n def get_test_dir(self,erase = 0):\n # make sure tempdir catalog doesn't exist\n import tempfile, glob\n #temp = tempfile.gettempdir()\n pardir = tempfile.mktemp(suffix='cat_test')\n if not os.path.exists(pardir):\n os.mkdir(pardir)\n cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*') \n cat_files = glob.glob(cat_glob)\n if erase:\n for cat_file in cat_files:\n os.remove(cat_file)\n return pardir\n def remove_dir(self,d):\n import distutils.dir_util\n distutils.dir_util.remove_tree(d)\n \n def check_nonexistent_catalog_is_none(self):\n pardir = self.get_test_dir(erase=1)\n cat = catalog.get_catalog(pardir,'r')\n self.remove_dir(pardir)\n assert(cat is None)\n def check_create_catalog(self):\n pardir = self.get_test_dir(erase=1)\n cat = catalog.get_catalog(pardir,'c')\n self.remove_dir(pardir)\n assert(cat is not None)\n\nclass test_catalog(unittest.TestCase):\n\n def clear_environ(self):\n if os.environ.has_key('PYTHONCOMPILED'):\n self.old_PYTHONCOMPILED = os.environ['PYTHONCOMPILED']\n del os.environ['PYTHONCOMPILED']\n else: \n self.old_PYTHONCOMPILED = None\n def reset_environ(self):\n if self.old_PYTHONCOMPILED:\n os.environ['PYTHONCOMPILED'] = self.old_PYTHONCOMPILED\n self.old_PYTHONCOMPILED = None\n def setUp(self):\n self.clear_environ() \n def tearDown(self):\n self.reset_environ()\n \n def check_set_module_directory(self):\n q = catalog.catalog()\n q.set_module_directory('bob')\n r = q.get_module_directory()\n assert (r == 'bob')\n def check_clear_module_directory(self):\n q = catalog.catalog()\n r = q.get_module_directory()\n assert (r is None)\n q.set_module_directory('bob')\n r = q.clear_module_directory()\n assert (r is None)\n def check_get_environ_path(self):\n if sys.platform == 'win32': sep = ';'\n else: sep = ':'\n os.environ['PYTHONCOMPILED'] = sep.join(('path1','path2','path3'))\n q = catalog.catalog()\n path = q.get_environ_path() \n assert(path == ['path1','path2','path3'])\n def check_build_search_order1(self): \n \"\"\" MODULE in search path should be replaced by module_dir.\n \"\"\" \n q = catalog.catalog(['first','MODULE','third'])\n q.set_module_directory('second')\n order = q.build_search_order()\n assert(order == ['first','second','third',catalog.default_dir()])\n def check_build_search_order2(self): \n \"\"\" MODULE in search path should be removed if module_dir==None.\n \"\"\" \n q = catalog.catalog(['first','MODULE','third'])\n order = q.build_search_order()\n assert(order == ['first','third',catalog.default_dir()]) \n def check_build_search_order3(self):\n \"\"\" If MODULE is absent, module_dir shouldn't be in search path.\n \"\"\" \n q = catalog.catalog(['first','second'])\n q.set_module_directory('third')\n order = q.build_search_order()\n assert(order == ['first','second',catalog.default_dir()])\n def check_build_search_order4(self):\n \"\"\" Make sure environment variable is getting used.\n \"\"\" \n q = catalog.catalog(['first','second'])\n if sys.platform == 'win32': sep = ';'\n else: sep = ':'\n os.environ['PYTHONCOMPILED'] = sep.join(('MODULE','fourth','fifth'))\n q.set_module_directory('third')\n order = q.build_search_order()\n assert(order == ['first','second','third','fourth','fifth',catalog.default_dir()])\n \n def check_catalog_files1(self):\n \"\"\" Be sure we get at least one file even without specifying the path.\n \"\"\"\n q = catalog.catalog()\n files = q.get_catalog_files()\n assert(len(files) == 1)\n\n def check_catalog_files2(self):\n \"\"\" Ignore bad paths in the path.\n \"\"\"\n q = catalog.catalog()\n os.environ['PYTHONCOMPILED'] = '_some_bad_path_'\n files = q.get_catalog_files()\n assert(len(files) == 1)\n \n def check_get_existing_files1(self):\n \"\"\" Shouldn't get any files when temp doesn't exist and no path set. \n \"\"\" \n clear_temp_catalog()\n q = catalog.catalog()\n files = q.get_existing_files()\n restore_temp_catalog()\n assert(len(files) == 0)\n def check_get_existing_files2(self):\n \"\"\" Shouldn't get a single file from the temp dir.\n \"\"\" \n clear_temp_catalog()\n q = catalog.catalog()\n # create a dummy file\n import os \n q.add_function('code', os.getpid)\n del q\n q = catalog.catalog()\n files = q.get_existing_files()\n restore_temp_catalog()\n assert(len(files) == 1)\n \n def check_access_writable_file(self):\n \"\"\" There should always be a writable file -- even if it is in temp\n \"\"\"\n q = catalog.catalog()\n file = q.get_writable_file()\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file) \n def check_writable_with_bad_path(self):\n \"\"\" There should always be a writable file -- even if search paths contain\n bad values.\n \"\"\"\n if sys.platform == 'win32': sep = ';'\n else: sep = ':' \n os.environ['PYTHONCOMPILED'] = sep.join(('_bad_path_name_'))\n q = catalog.catalog()\n file = q.get_writable_file()\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file) \n def check_writable_dir(self):\n \"\"\" Check that we can create a file in the writable directory\n \"\"\"\n q = catalog.catalog()\n d = q.get_writable_dir()\n file = os.path.join(d,'some_silly_file')\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file)\n def check_unique_module_name(self):\n \"\"\" Check that we can create a file in the writable directory\n \"\"\"\n q = catalog.catalog()\n file = q.unique_module_name('bob')\n cfile1 = file+'.cpp'\n assert(not os.path.exists(cfile1))\n #make sure it is writable\n try:\n f = open(cfile1,'w')\n f.write('bob')\n finally: \n f.close()\n # try again with same code fragment -- should get unique name\n file = q.unique_module_name('bob')\n cfile2 = file+'.cpp'\n assert(not os.path.exists(cfile2+'.cpp'))\n os.remove(cfile1)\n def check_add_function_persistent1(self):\n \"\"\" Test persisting a function in the default catalog\n \"\"\"\n clear_temp_catalog()\n q = catalog.catalog()\n # just use some already available functions\n import string\n funcs = [string.upper, string.lower, string.find,string.replace]\n for i in funcs:\n q.add_function_persistent('code',i)\n pfuncs = q.get_cataloged_functions('code') \n # any way to clean modules???\n restore_temp_catalog()\n for i in funcs:\n assert(i in pfuncs) \n \n def check_add_function_ordered(self):\n clear_temp_catalog()\n q = catalog.catalog()\n import string\n \n q.add_function('f',string.upper) \n q.add_function('f',string.lower)\n q.add_function('ff',string.find) \n q.add_function('ff',string.replace)\n q.add_function('fff',string.atof)\n q.add_function('fff',string.atoi)\n del q\n\n # now we're gonna make a new catalog with same code\n # but different functions in a specified module directory\n env_dir = empty_temp_dir()\n r = catalog.catalog(env_dir)\n r.add_function('ff',os.abort)\n r.add_function('ff',os.chdir)\n r.add_function('fff',os.access)\n r.add_function('fff',os.open)\n del r\n # now we're gonna make a new catalog with same code\n # but different functions in a user specified directory\n user_dir = empty_temp_dir()\n s = catalog.catalog(user_dir)\n import re\n s.add_function('fff',re.match)\n s.add_function('fff',re.purge)\n del s\n\n # open new catalog and make sure it retreives the functions\n # from d catalog instead of the temp catalog (made by q)\n os.environ['PYTHONCOMPILED'] = env_dir\n t = catalog.catalog(user_dir)\n funcs1 = t.get_functions('f')\n funcs2 = t.get_functions('ff')\n funcs3 = t.get_functions('fff')\n restore_temp_catalog()\n # make sure everything is read back in the correct order\n # a little cheating... I'm ignoring any functions that might have\n # been read in from a prior catalog file (such as the defualt one).\n # the test should really be made so that these aren't read in, but\n # until I get this figured out...\n #assert(funcs1 == [string.lower,string.upper])\n #assert(funcs2 == [os.chdir,os.abort,string.replace,string.find])\n #assert(funcs3 == [re.purge,re.match,os.open,\n # os.access,string.atoi,string.atof])\n assert(funcs1[:2] == [string.lower,string.upper])\n assert(funcs2[:4] == [os.chdir,os.abort,string.replace,string.find])\n assert(funcs3[:6] == [re.purge,re.match,os.open,\n os.access,string.atoi,string.atof])\n cleanup_temp_dir(user_dir)\n cleanup_temp_dir(env_dir)\n \n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_default_dir,'check_'))\n suites.append( unittest.makeSuite(test_os_dependent_catalog_name,\n 'check_'))\n suites.append( unittest.makeSuite(test_catalog_path,'check_'))\n suites.append( unittest.makeSuite(test_get_catalog,'check_'))\n suites.append( unittest.makeSuite(test_catalog,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == '__main__':\n test()\n", + "source_code_before": "import unittest\nimport sys, os\n\n\nfrom scipy_distutils.misc_util import add_grandparent_to_path, restore_path\nfrom scipy_distutils.misc_util import add_local_to_path\n\nadd_grandparent_to_path(__name__)\nimport catalog\nreload(catalog) # this'll pick up any recent code changes\nrestore_path()\n\nadd_local_to_path(__name__)\nfrom weave_test_utils import *\nrestore_path()\n\n\nclass test_default_dir(unittest.TestCase):\n def check_is_writable(self):\n path = catalog.default_dir()\n name = os.path.join(path,'dummy_catalog')\n test_file = open(name,'w')\n try:\n test_file.write('making sure default location is writable\\n')\n finally:\n test_file.close()\n os.remove(name)\n\nclass test_os_dependent_catalog_name(unittest.TestCase): \n pass\n \nclass test_catalog_path(unittest.TestCase): \n def check_default(self):\n in_path = catalog.default_dir()\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == in_path)\n assert(f == catalog.os_dependent_catalog_name())\n def check_current(self):\n in_path = '.'\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == os.path.abspath(in_path)) \n assert(f == catalog.os_dependent_catalog_name()) \n def check_user(path):\n if sys.platform != 'win32':\n in_path = '~'\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert(d == os.path.expanduser(in_path)) \n assert(f == catalog.os_dependent_catalog_name())\n def check_module(self):\n # hand it a module and see if it uses the parent directory\n # of the module.\n path = catalog.catalog_path(os.__file__)\n d,f = os.path.split(os.__file__)\n d2,f = os.path.split(path)\n assert (d2 == d)\n def check_path(self):\n # use os.__file__ to get a usable directory.\n in_path,f = os.path.split(os.__file__)\n path = catalog.catalog_path(in_path)\n d,f = os.path.split(path)\n assert (d == in_path)\n def check_bad_path(self):\n # stupid_path_name\n in_path = 'stupid_path_name'\n path = catalog.catalog_path(in_path)\n assert (path is None)\n\nclass test_get_catalog(unittest.TestCase):\n \"\"\" This only tests whether new catalogs are created correctly.\n And whether non-existent return None correctly with read mode.\n Putting catalogs in the right place is all tested with\n catalog_dir tests.\n \"\"\"\n def get_test_dir(self,erase = 0):\n # make sure tempdir catalog doesn't exist\n import tempfile, glob\n #temp = tempfile.gettempdir()\n pardir = tempfile.mktemp(suffix='cat_test')\n if not os.path.exists(pardir):\n os.mkdir(pardir)\n cat_glob = os.path.join(pardir,catalog.os_dependent_catalog_name()+'.*') \n cat_files = glob.glob(cat_glob)\n if erase:\n for cat_file in cat_files:\n os.remove(cat_file)\n return pardir\n def remove_dir(self,d):\n import distutils.dir_util\n distutils.dir_util.remove_tree(d)\n \n def check_nonexistent_catalog_is_none(self):\n pardir = self.get_test_dir(erase=1)\n cat = catalog.get_catalog(pardir,'r')\n self.remove_dir(pardir)\n assert(cat is None)\n def check_create_catalog(self):\n pardir = self.get_test_dir(erase=1)\n cat = catalog.get_catalog(pardir,'c')\n self.remove_dir(pardir)\n assert(cat is not None)\n\nclass test_catalog(unittest.TestCase):\n\n def clear_environ(self):\n if os.environ.has_key('PYTHONCOMPILED'):\n self.old_PYTHONCOMPILED = os.environ['PYTHONCOMPILED']\n del os.environ['PYTHONCOMPILED']\n else: \n self.old_PYTHONCOMPILED = None\n def reset_environ(self):\n if self.old_PYTHONCOMPILED:\n os.environ['PYTHONCOMPILED'] = self.old_PYTHONCOMPILED\n self.old_PYTHONCOMPILED = None\n def setUp(self):\n self.clear_environ() \n def tearDown(self):\n self.reset_environ()\n \n def check_set_module_directory(self):\n q = catalog.catalog()\n q.set_module_directory('bob')\n r = q.get_module_directory()\n assert (r == 'bob')\n def check_clear_module_directory(self):\n q = catalog.catalog()\n r = q.get_module_directory()\n assert (r == None)\n q.set_module_directory('bob')\n r = q.clear_module_directory()\n assert (r == None)\n def check_get_environ_path(self):\n if sys.platform == 'win32': sep = ';'\n else: sep = ':'\n os.environ['PYTHONCOMPILED'] = sep.join(('path1','path2','path3'))\n q = catalog.catalog()\n path = q.get_environ_path() \n assert(path == ['path1','path2','path3'])\n def check_build_search_order1(self): \n \"\"\" MODULE in search path should be replaced by module_dir.\n \"\"\" \n q = catalog.catalog(['first','MODULE','third'])\n q.set_module_directory('second')\n order = q.build_search_order()\n assert(order == ['first','second','third',catalog.default_dir()])\n def check_build_search_order2(self): \n \"\"\" MODULE in search path should be removed if module_dir==None.\n \"\"\" \n q = catalog.catalog(['first','MODULE','third'])\n order = q.build_search_order()\n assert(order == ['first','third',catalog.default_dir()]) \n def check_build_search_order3(self):\n \"\"\" If MODULE is absent, module_dir shouldn't be in search path.\n \"\"\" \n q = catalog.catalog(['first','second'])\n q.set_module_directory('third')\n order = q.build_search_order()\n assert(order == ['first','second',catalog.default_dir()])\n def check_build_search_order4(self):\n \"\"\" Make sure environment variable is getting used.\n \"\"\" \n q = catalog.catalog(['first','second'])\n if sys.platform == 'win32': sep = ';'\n else: sep = ':'\n os.environ['PYTHONCOMPILED'] = sep.join(('MODULE','fourth','fifth'))\n q.set_module_directory('third')\n order = q.build_search_order()\n assert(order == ['first','second','third','fourth','fifth',catalog.default_dir()])\n \n def check_catalog_files1(self):\n \"\"\" Be sure we get at least one file even without specifying the path.\n \"\"\"\n q = catalog.catalog()\n files = q.get_catalog_files()\n assert(len(files) == 1)\n\n def check_catalog_files2(self):\n \"\"\" Ignore bad paths in the path.\n \"\"\"\n q = catalog.catalog()\n os.environ['PYTHONCOMPILED'] = '_some_bad_path_'\n files = q.get_catalog_files()\n assert(len(files) == 1)\n \n def check_get_existing_files1(self):\n \"\"\" Shouldn't get any files when temp doesn't exist and no path set. \n \"\"\" \n clear_temp_catalog()\n q = catalog.catalog()\n files = q.get_existing_files()\n restore_temp_catalog()\n assert(len(files) == 0)\n def check_get_existing_files2(self):\n \"\"\" Shouldn't get a single file from the temp dir.\n \"\"\" \n clear_temp_catalog()\n q = catalog.catalog()\n # create a dummy file\n import os \n q.add_function('code', os.getpid)\n del q\n q = catalog.catalog()\n files = q.get_existing_files()\n restore_temp_catalog()\n assert(len(files) == 1)\n \n def check_access_writable_file(self):\n \"\"\" There should always be a writable file -- even if it is in temp\n \"\"\"\n q = catalog.catalog()\n file = q.get_writable_file()\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file) \n def check_writable_with_bad_path(self):\n \"\"\" There should always be a writable file -- even if search paths contain\n bad values.\n \"\"\"\n if sys.platform == 'win32': sep = ';'\n else: sep = ':' \n os.environ['PYTHONCOMPILED'] = sep.join(('_bad_path_name_'))\n q = catalog.catalog()\n file = q.get_writable_file()\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file) \n def check_writable_dir(self):\n \"\"\" Check that we can create a file in the writable directory\n \"\"\"\n q = catalog.catalog()\n d = q.get_writable_dir()\n file = os.path.join(d,'some_silly_file')\n try:\n f = open(file,'w')\n f.write('bob')\n finally:\n f.close()\n os.remove(file)\n def check_unique_module_name(self):\n \"\"\" Check that we can create a file in the writable directory\n \"\"\"\n q = catalog.catalog()\n file = q.unique_module_name('bob')\n cfile1 = file+'.cpp'\n assert(not os.path.exists(cfile1))\n #make sure it is writable\n try:\n f = open(cfile1,'w')\n f.write('bob')\n finally: \n f.close()\n # try again with same code fragment -- should get unique name\n file = q.unique_module_name('bob')\n cfile2 = file+'.cpp'\n assert(not os.path.exists(cfile2+'.cpp'))\n os.remove(cfile1)\n def check_add_function_persistent1(self):\n \"\"\" Test persisting a function in the default catalog\n \"\"\"\n clear_temp_catalog()\n q = catalog.catalog()\n # just use some already available functions\n import string\n funcs = [string.upper, string.lower, string.find,string.replace]\n for i in funcs:\n q.add_function_persistent('code',i)\n pfuncs = q.get_cataloged_functions('code') \n # any way to clean modules???\n restore_temp_catalog()\n for i in funcs:\n assert(i in pfuncs) \n \n def check_add_function_ordered(self):\n clear_temp_catalog()\n q = catalog.catalog()\n import string\n \n q.add_function('f',string.upper) \n q.add_function('f',string.lower)\n q.add_function('ff',string.find) \n q.add_function('ff',string.replace)\n q.add_function('fff',string.atof)\n q.add_function('fff',string.atoi)\n del q\n\n # now we're gonna make a new catalog with same code\n # but different functions in a specified module directory\n env_dir = empty_temp_dir()\n r = catalog.catalog(env_dir)\n r.add_function('ff',os.abort)\n r.add_function('ff',os.chdir)\n r.add_function('fff',os.access)\n r.add_function('fff',os.open)\n del r\n # now we're gonna make a new catalog with same code\n # but different functions in a user specified directory\n user_dir = empty_temp_dir()\n s = catalog.catalog(user_dir)\n import re\n s.add_function('fff',re.match)\n s.add_function('fff',re.purge)\n del s\n\n # open new catalog and make sure it retreives the functions\n # from d catalog instead of the temp catalog (made by q)\n os.environ['PYTHONCOMPILED'] = env_dir\n t = catalog.catalog(user_dir)\n funcs1 = t.get_functions('f')\n funcs2 = t.get_functions('ff')\n funcs3 = t.get_functions('fff')\n restore_temp_catalog()\n # make sure everything is read back in the correct order\n # a little cheating... I'm ignoring any functions that might have\n # been read in from a prior catalog file (such as the defualt one).\n # the test should really be made so that these aren't read in, but\n # until I get this figured out...\n #assert(funcs1 == [string.lower,string.upper])\n #assert(funcs2 == [os.chdir,os.abort,string.replace,string.find])\n #assert(funcs3 == [re.purge,re.match,os.open,\n # os.access,string.atoi,string.atof])\n assert(funcs1[:2] == [string.lower,string.upper])\n assert(funcs2[:4] == [os.chdir,os.abort,string.replace,string.find])\n assert(funcs3[:6] == [re.purge,re.match,os.open,\n os.access,string.atoi,string.atof])\n cleanup_temp_dir(user_dir)\n cleanup_temp_dir(env_dir)\n \n \ndef test_suite(level=1):\n suites = []\n if level > 0:\n suites.append( unittest.makeSuite(test_default_dir,'check_'))\n suites.append( unittest.makeSuite(test_os_dependent_catalog_name,\n 'check_'))\n suites.append( unittest.makeSuite(test_catalog_path,'check_'))\n suites.append( unittest.makeSuite(test_get_catalog,'check_'))\n suites.append( unittest.makeSuite(test_catalog,'check_'))\n\n total_suite = unittest.TestSuite(suites)\n return total_suite\n\ndef test(level=10):\n all_tests = test_suite(level)\n runner = unittest.TextTestRunner()\n runner.run(all_tests)\n return runner\n\n\nif __name__ == '__main__':\n test()\n", + "methods": [ + { + "name": "check_is_writable", + "long_name": "check_is_writable( self )", + "filename": "test_catalog.py", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_default", + "long_name": "check_default( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 33, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_current", + "long_name": "check_current( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_user", + "long_name": "check_user( path )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 58, + "parameters": [ + "path" + ], + "start_line": 45, + "end_line": 51, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_module", + "long_name": "check_module( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_path", + "long_name": "check_path( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 59, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_bad_path", + "long_name": "check_bad_path( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 65, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_test_dir", + "long_name": "get_test_dir( self , erase = 0 )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 82, + "parameters": [ + "self", + "erase" + ], + "start_line": 77, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "remove_dir", + "long_name": "remove_dir( self , d )", + "filename": "test_catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "d" + ], + "start_line": 90, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_nonexistent_catalog_is_none", + "long_name": "check_nonexistent_catalog_is_none( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 94, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_create_catalog", + "long_name": "check_create_catalog( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 99, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "clear_environ", + "long_name": "clear_environ( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 107, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "reset_environ", + "long_name": "reset_environ( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "setUp", + "long_name": "setUp( self )", + "filename": "test_catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tearDown", + "long_name": "tearDown( self )", + "filename": "test_catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 119, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_set_module_directory", + "long_name": "check_set_module_directory( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_clear_module_directory", + "long_name": "check_clear_module_directory( self )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 1, + "token_count": 44, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_get_environ_path", + "long_name": "check_get_environ_path( self )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order1", + "long_name": "check_build_search_order1( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 141, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order2", + "long_name": "check_build_search_order2( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 43, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order3", + "long_name": "check_build_search_order3( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order4", + "long_name": "check_build_search_order4( self )", + "filename": "test_catalog.py", + "nloc": 8, + "complexity": 2, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 161, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_catalog_files1", + "long_name": "check_catalog_files1( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 172, + "end_line": 177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_catalog_files2", + "long_name": "check_catalog_files2( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 179, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_get_existing_files1", + "long_name": "check_get_existing_files1( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 187, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_get_existing_files2", + "long_name": "check_get_existing_files2( self )", + "filename": "test_catalog.py", + "nloc": 10, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_access_writable_file", + "long_name": "check_access_writable_file( self )", + "filename": "test_catalog.py", + "nloc": 9, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 209, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_writable_with_bad_path", + "long_name": "check_writable_with_bad_path( self )", + "filename": "test_catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 79, + "parameters": [ + "self" + ], + "start_line": 220, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_writable_dir", + "long_name": "check_writable_dir( self )", + "filename": "test_catalog.py", + "nloc": 10, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_unique_module_name", + "long_name": "check_unique_module_name( self )", + "filename": "test_catalog.py", + "nloc": 14, + "complexity": 2, + "token_count": 94, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_add_function_persistent1", + "long_name": "check_add_function_persistent1( self )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 265, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_add_function_ordered", + "long_name": "check_add_function_ordered( self )", + "filename": "test_catalog.py", + "nloc": 36, + "complexity": 1, + "token_count": 300, + "parameters": [ + "self" + ], + "start_line": 281, + "end_line": 334, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 2, + "token_count": 91, + "parameters": [ + "level" + ], + "start_line": 337, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 350, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "check_is_writable", + "long_name": "check_is_writable( self )", + "filename": "test_catalog.py", + "nloc": 9, + "complexity": 2, + "token_count": 53, + "parameters": [ + "self" + ], + "start_line": 19, + "end_line": 27, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_default", + "long_name": "check_default( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 48, + "parameters": [ + "self" + ], + "start_line": 33, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_current", + "long_name": "check_current( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 39, + "end_line": 44, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_user", + "long_name": "check_user( path )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 58, + "parameters": [ + "path" + ], + "start_line": 45, + "end_line": 51, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_module", + "long_name": "check_module( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 52, + "end_line": 58, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_path", + "long_name": "check_path( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 45, + "parameters": [ + "self" + ], + "start_line": 59, + "end_line": 64, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_bad_path", + "long_name": "check_bad_path( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 22, + "parameters": [ + "self" + ], + "start_line": 65, + "end_line": 69, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_test_dir", + "long_name": "get_test_dir( self , erase = 0 )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 4, + "token_count": 82, + "parameters": [ + "self", + "erase" + ], + "start_line": 77, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "remove_dir", + "long_name": "remove_dir( self , d )", + "filename": "test_catalog.py", + "nloc": 3, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self", + "d" + ], + "start_line": 90, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "check_nonexistent_catalog_is_none", + "long_name": "check_nonexistent_catalog_is_none( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 94, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_create_catalog", + "long_name": "check_create_catalog( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 38, + "parameters": [ + "self" + ], + "start_line": 99, + "end_line": 103, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "clear_environ", + "long_name": "clear_environ( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 2, + "token_count": 39, + "parameters": [ + "self" + ], + "start_line": 107, + "end_line": 112, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "reset_environ", + "long_name": "reset_environ( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 2, + "token_count": 25, + "parameters": [ + "self" + ], + "start_line": 113, + "end_line": 116, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "setUp", + "long_name": "setUp( self )", + "filename": "test_catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 117, + "end_line": 118, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "tearDown", + "long_name": "tearDown( self )", + "filename": "test_catalog.py", + "nloc": 2, + "complexity": 1, + "token_count": 10, + "parameters": [ + "self" + ], + "start_line": 119, + "end_line": 120, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "check_set_module_directory", + "long_name": "check_set_module_directory( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 31, + "parameters": [ + "self" + ], + "start_line": 122, + "end_line": 126, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "check_clear_module_directory", + "long_name": "check_clear_module_directory( self )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 1, + "token_count": 44, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_get_environ_path", + "long_name": "check_get_environ_path( self )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 2, + "token_count": 65, + "parameters": [ + "self" + ], + "start_line": 134, + "end_line": 140, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order1", + "long_name": "check_build_search_order1( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 51, + "parameters": [ + "self" + ], + "start_line": 141, + "end_line": 147, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order2", + "long_name": "check_build_search_order2( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 43, + "parameters": [ + "self" + ], + "start_line": 148, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order3", + "long_name": "check_build_search_order3( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 47, + "parameters": [ + "self" + ], + "start_line": 154, + "end_line": 160, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_build_search_order4", + "long_name": "check_build_search_order4( self )", + "filename": "test_catalog.py", + "nloc": 8, + "complexity": 2, + "token_count": 87, + "parameters": [ + "self" + ], + "start_line": 161, + "end_line": 170, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "check_catalog_files1", + "long_name": "check_catalog_files1( self )", + "filename": "test_catalog.py", + "nloc": 4, + "complexity": 1, + "token_count": 29, + "parameters": [ + "self" + ], + "start_line": 172, + "end_line": 177, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_catalog_files2", + "long_name": "check_catalog_files2( self )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 37, + "parameters": [ + "self" + ], + "start_line": 179, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + }, + { + "name": "check_get_existing_files1", + "long_name": "check_get_existing_files1( self )", + "filename": "test_catalog.py", + "nloc": 6, + "complexity": 1, + "token_count": 35, + "parameters": [ + "self" + ], + "start_line": 187, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_get_existing_files2", + "long_name": "check_get_existing_files2( self )", + "filename": "test_catalog.py", + "nloc": 10, + "complexity": 1, + "token_count": 56, + "parameters": [ + "self" + ], + "start_line": 195, + "end_line": 207, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "check_access_writable_file", + "long_name": "check_access_writable_file( self )", + "filename": "test_catalog.py", + "nloc": 9, + "complexity": 2, + "token_count": 49, + "parameters": [ + "self" + ], + "start_line": 209, + "end_line": 219, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 1 + }, + { + "name": "check_writable_with_bad_path", + "long_name": "check_writable_with_bad_path( self )", + "filename": "test_catalog.py", + "nloc": 12, + "complexity": 3, + "token_count": 79, + "parameters": [ + "self" + ], + "start_line": 220, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_writable_dir", + "long_name": "check_writable_dir( self )", + "filename": "test_catalog.py", + "nloc": 10, + "complexity": 2, + "token_count": 61, + "parameters": [ + "self" + ], + "start_line": 235, + "end_line": 246, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 1 + }, + { + "name": "check_unique_module_name", + "long_name": "check_unique_module_name( self )", + "filename": "test_catalog.py", + "nloc": 14, + "complexity": 2, + "token_count": 94, + "parameters": [ + "self" + ], + "start_line": 247, + "end_line": 264, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "check_add_function_persistent1", + "long_name": "check_add_function_persistent1( self )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 3, + "token_count": 72, + "parameters": [ + "self" + ], + "start_line": 265, + "end_line": 279, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "check_add_function_ordered", + "long_name": "check_add_function_ordered( self )", + "filename": "test_catalog.py", + "nloc": 36, + "complexity": 1, + "token_count": 300, + "parameters": [ + "self" + ], + "start_line": 281, + "end_line": 334, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 54, + "top_nesting_level": 1 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "test_catalog.py", + "nloc": 11, + "complexity": 2, + "token_count": 91, + "parameters": [ + "level" + ], + "start_line": 337, + "end_line": 348, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 12, + "top_nesting_level": 0 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "test_catalog.py", + "nloc": 5, + "complexity": 1, + "token_count": 28, + "parameters": [ + "level" + ], + "start_line": 350, + "end_line": 354, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "check_clear_module_directory", + "long_name": "check_clear_module_directory( self )", + "filename": "test_catalog.py", + "nloc": 7, + "complexity": 1, + "token_count": 44, + "parameters": [ + "self" + ], + "start_line": 127, + "end_line": 133, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 1 + } + ], + "nloc": 278, + "complexity": 51, + "token_count": 2011, + "diff_parsed": { + "added": [ + " assert (r is None)", + " assert (r is None)" + ], + "deleted": [ + " assert (r == None)", + " assert (r == None)" + ] + } + } + ] + }, + { + "hash": "38dbd4ba524b7d7f617b7ee5516b762cca431b23", + "msg": "Fixed scipy_base.fastumath", + "author": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "committer": { + "name": "Travis Oliphant", + "email": "oliphant@enthought.com" + }, + "author_date": "2002-04-05T17:06:24+00:00", + "author_timezone": 0, + "committer_date": "2002-04-05T17:06:24+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "17ea2ead1f794accc763cda67045fb1b7697ccc9" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/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_base/setup_scipy_base.py", + "new_path": "scipy_base/setup_scipy_base.py", + "filename": "setup_scipy_base.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -21,7 +21,7 @@ def configuration(parent_package=''):\n config['package_dir']['scipy_base.tests'] = test_path\n \n # scipy_base.fastumath module\n- sources = ['scipy_base.fastumathmodule.c','isnan.c']\n+ sources = ['fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n", + "added_lines": 1, + "deleted_lines": 1, + "source_code": "#!/usr/bin/env python\n\nimport os, sys\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\nimport shutil\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # scipy_base.fastumath module\n sources = ['fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n\n # Test to see if big or little-endian machine and get correct default\n # mconf.h module.\n if sys.byteorder == \"little\":\n print \"### Little Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n else:\n print \"### Big Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "source_code_before": "#!/usr/bin/env python\n\nimport os, sys\nfrom glob import glob\nfrom scipy_distutils.core import Extension\nfrom scipy_distutils.misc_util import get_path, default_config_dict,dot_join\nimport shutil\n\ndef configuration(parent_package=''):\n parent_path = parent_package\n if parent_package:\n parent_package += '.'\n local_path = get_path(__name__)\n\n config = default_config_dict()\n config['packages'].append(parent_package+'scipy_base')\n config['package_dir'][parent_package+'scipy_base'] = local_path\n\n config['packages'].append(dot_join(parent_package,'scipy_base.tests'))\n test_path = os.path.join(local_path,'tests')\n config['package_dir']['scipy_base.tests'] = test_path\n\n # scipy_base.fastumath module\n sources = ['scipy_base.fastumathmodule.c','isnan.c']\n sources = [os.path.join(local_path,x) for x in sources]\n ext = Extension('scipy_base.fastumath',sources,libraries=[])\n config['ext_modules'].append(ext)\n\n # Test to see if big or little-endian machine and get correct default\n # mconf.h module.\n if sys.byteorder == \"little\":\n print \"### Little Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_LE.h'),os.path.join(local_path,'mconf_lite.h'))\n else:\n print \"### Big Endian detected ####\"\n shutil.copy2(os.path.join(local_path,'mconf_lite_BE.h'),os.path.join(local_path,'mconf_lite.h'))\n\n return config\n\nif __name__ == '__main__': \n from scipy_distutils.core import setup\n setup(**configuration())\n", + "methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "configuration", + "long_name": "configuration( parent_package = '' )", + "filename": "setup_scipy_base.py", + "nloc": 22, + "complexity": 4, + "token_count": 198, + "parameters": [ + "parent_package" + ], + "start_line": 9, + "end_line": 38, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 30, + "top_nesting_level": 0 + } + ], + "nloc": 30, + "complexity": 4, + "token_count": 243, + "diff_parsed": { + "added": [ + " sources = ['fastumathmodule.c','isnan.c']" + ], + "deleted": [ + " sources = ['scipy_base.fastumathmodule.c','isnan.c']" + ] + } + } + ] + }, + { + "hash": "525bfa8f809ecb4a14080b5a3b4b055b303b701e", + "msg": "added an attempt to fix problem with the name cc being used for gcc on FreeBSD. THis causes weave to fail because it needs to link with g++.", + "author": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "committer": { + "name": "Eric Jones", + "email": "eric@enthought.com" + }, + "author_date": "2002-04-05T23:20:42+00:00", + "author_timezone": 0, + "committer_date": "2002-04-05T23:20:42+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "38dbd4ba524b7d7f617b7ee5516b762cca431b23" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 4, + "insertions": 14, + "lines": 18, + "files": 1, + "dmm_unit_size": 1.0, + "dmm_unit_complexity": 1.0, + "dmm_unit_interfacing": 1.0, + "modified_files": [ + { + "old_path": "weave/build_tools.py", + "new_path": "weave/build_tools.py", + "filename": "build_tools.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -30,7 +30,16 @@\n def _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n- distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n+ #distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n+ # FreeBSD names gcc as cc, so the above find and replace doesn't work. \n+ # So, assume first entry in ld is the name of the linker -- gcc or cc or \n+ # whatever. This is a sane assumption, correct?\n+ # If the linker is gcc, set it to g++\n+ link_cmds = ld.split() \n+ if gcc_exists(link_cmds[0]):\n+ link_cmds[0] = 'g++'\n+ ld = ' '.join(link_cmds)\n+ distutils.sysconfig._config_vars['LDSHARED'] = ld \n \n distutils.sysconfig._init_posix = _init_posix \n # end force g++\n@@ -258,14 +267,15 @@ def choose_compiler(compiler_name=''):\n compiler_name = 'unix' \n return compiler_name\n \n-def gcc_exists():\n+def gcc_exists(name = 'gcc'):\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n+ cmd = '%s -v' % name\n try:\n- w,r=os.popen4('gcc -v')\n+ w,r=os.popen4(cmd)\n w.close()\n str_result = r.read()\n #print str_result\n@@ -276,7 +286,7 @@ def gcc_exists():\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n- result = not os.system('gcc -v')\n+ result = not os.system(cmd)\n return result\n \n def msvc_exists():\n", + "added_lines": 14, + "deleted_lines": 4, + "source_code": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n #distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n # FreeBSD names gcc as cc, so the above find and replace doesn't work. \n # So, assume first entry in ld is the name of the linker -- gcc or cc or \n # whatever. This is a sane assumption, correct?\n # If the linker is gcc, set it to g++\n link_cmds = ld.split() \n if gcc_exists(link_cmds[0]):\n link_cmds[0] = 'g++'\n ld = ' '.join(link_cmds)\n distutils.sysconfig._config_vars['LDSHARED'] = ld \n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists(name = 'gcc'):\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n cmd = '%s -v' % name\n try:\n w,r=os.popen4(cmd)\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system(cmd)\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "source_code_before": "\"\"\" Tools for compiling C/C++ code to extension modules\n\n The main function, build_extension(), takes the C/C++ file\n along with some other options and builds a Python extension.\n It uses distutils for most of the heavy lifting.\n \n choose_compiler() is also useful (mainly on windows anyway)\n for trying to determine whether MSVC++ or gcc is available.\n MSVC doesn't handle templates as well, so some of the code emitted\n by the python->C conversions need this info to choose what kind\n of code to create.\n \n The other main thing here is an alternative version of the MingW32\n compiler class. The class makes it possible to build libraries with\n gcc even if the original version of python was built using MSVC. It\n does this by converting a pythonxx.lib file to a libpythonxx.a file.\n Note that you need write access to the pythonxx/lib directory to do this.\n\"\"\"\n\nimport sys,os,string,time\nimport tempfile\nimport exceptions\n\n# If linker is 'gcc', this will convert it to 'g++'\n# necessary to make sure stdc++ is linked in cross-platform way.\nimport distutils.sysconfig\n\nold_init_posix = distutils.sysconfig._init_posix\n\ndef _init_posix():\n old_init_posix()\n ld = distutils.sysconfig._config_vars['LDSHARED']\n distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')\n\ndistutils.sysconfig._init_posix = _init_posix \n# end force g++\n\n\nclass CompileError(exceptions.Exception):\n pass\n \ndef build_extension(module_path,compiler_name = '',build_dir = None,\n temp_dir = None, verbose = 0, **kw):\n \"\"\" Build the file given by module_path into a Python extension module.\n \n build_extensions uses distutils to build Python extension modules.\n kw arguments not used are passed on to the distutils extension\n module. Directory settings can handle absoulte settings, but don't\n currently expand '~' or environment variables.\n \n module_path -- the full path name to the c file to compile. \n Something like: /full/path/name/module_name.c \n The name of the c/c++ file should be the same as the\n name of the module (i.e. the initmodule() routine)\n compiler_name -- The name of the compiler to use. On Windows if it \n isn't given, MSVC is used if it exists (is found).\n gcc is used as a second choice. If neither are found, \n the default distutils compiler is used. Acceptable \n names are 'gcc', 'msvc' or any of the compiler names \n shown by distutils.ccompiler.show_compilers()\n build_dir -- The location where the resulting extension module \n should be placed. This location must be writable. If\n it isn't, several default locations are tried. If the \n build_dir is not in the current python path, a warning\n is emitted, and it is added to the end of the path.\n build_dir defaults to the current directory.\n temp_dir -- The location where temporary files (*.o or *.obj)\n from the build are placed. This location must be \n writable. If it isn't, several default locations are \n tried. It defaults to tempfile.gettempdir()\n verbose -- 0, 1, or 2. 0 is as quiet as possible. 1 prints\n minimal information. 2 is noisy. \n **kw -- keyword arguments. These are passed on to the \n distutils extension module. Most of the keywords\n are listed below.\n\n Distutils keywords. These are cut and pasted from Greg Ward's\n distutils.extension.Extension class for convenience:\n \n sources : [string]\n list of source filenames, relative to the distribution root\n (where the setup script lives), in Unix form (slash-separated)\n for portability. Source files may be C, C++, SWIG (.i),\n platform-specific resource files, or whatever else is recognized\n by the \"build_ext\" command as source for a Python extension.\n Note: The module_path file is always appended to the front of this\n list \n include_dirs : [string]\n list of directories to search for C/C++ header files (in Unix\n form for portability) \n define_macros : [(name : string, value : string|None)]\n list of macros to define; each macro is defined using a 2-tuple,\n where 'value' is either the string to define it to or None to\n define it without a particular value (equivalent of \"#define\n FOO\" in source or -DFOO on Unix C compiler command line) \n undef_macros : [string]\n list of macros to undefine explicitly\n library_dirs : [string]\n list of directories to search for C/C++ libraries at link time\n libraries : [string]\n list of library names (not filenames or paths) to link against\n runtime_library_dirs : [string]\n list of directories to search for C/C++ libraries at run time\n (for shared extensions, this is when the extension is loaded)\n extra_objects : [string]\n list of extra files to link with (eg. object files not implied\n by 'sources', static library that must be explicitly specified,\n binary resource files, etc.)\n extra_compile_args : [string]\n any extra platform- and compiler-specific information to use\n when compiling the source files in 'sources'. For platforms and\n compilers where \"command line\" makes sense, this is typically a\n list of command-line arguments, but for other platforms it could\n be anything.\n extra_link_args : [string]\n any extra platform- and compiler-specific information to use\n when linking object files together to create the extension (or\n to create a new static Python interpreter). Similar\n interpretation as for 'extra_compile_args'.\n export_symbols : [string]\n list of symbols to be exported from a shared extension. Not\n used on all platforms, and not generally necessary for Python\n extensions, which typically export exactly one symbol: \"init\" +\n extension_name.\n \"\"\"\n success = 0\n from distutils.core import setup, Extension\n \n # this is a screwy trick to get rid of a ton of warnings on Unix\n import distutils.sysconfig\n distutils.sysconfig.get_config_vars()\n if distutils.sysconfig._config_vars.has_key('OPT'):\n flags = distutils.sysconfig._config_vars['OPT'] \n flags = flags.replace('-Wall','')\n distutils.sysconfig._config_vars['OPT'] = flags\n \n # get the name of the module and the extension directory it lives in. \n module_dir,cpp_name = os.path.split(os.path.abspath(module_path))\n module_name,ext = os.path.splitext(cpp_name) \n \n # configure temp and build directories\n temp_dir = configure_temp_dir(temp_dir) \n build_dir = configure_build_dir(module_dir)\n \n compiler_name = choose_compiler(compiler_name)\n configure_sys_argv(compiler_name,temp_dir,build_dir)\n \n # the business end of the function\n try:\n if verbose == 1:\n print 'Compiling code...'\n \n # set compiler verboseness 2 or more makes it output results\n if verbose > 1: verb = 1 \n else: verb = 0\n \n t1 = time.time() \n # add module to the needed source code files and build extension\n sources = kw.get('sources',[])\n kw['sources'] = [module_path] + sources \n \n # ! This was fixed at beginning of file by using g++ on most \n # !machines. We'll have to check how to handle it on non-gcc machines \n ## add module to the needed source code files and build extension\n ## FIX this is g++ specific. It probably should be fixed for other\n ## Unices/compilers. Find a generic solution\n #if compiler_name != 'msvc':\n # libraries = kw.get('libraries',[])\n # kw['libraries'] = ['stdc++'] + libraries \n # !\n \n # SunOS specific\n # fix for issue with linking to libstdc++.a. see:\n # http://mail.python.org/pipermail/python-dev/2001-March/013510.html\n platform = sys.platform\n version = sys.version.lower()\n if platform[:5] == 'sunos' and version.find('gcc') != -1:\n extra_link_args = kw.get('extra_link_args',[])\n kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args\n \n ext = Extension(module_name, **kw)\n \n # the switcheroo on SystemExit here is meant to keep command line\n # sessions from exiting when compiles fail.\n builtin = sys.modules['__builtin__']\n old_SysExit = builtin.__dict__['SystemExit']\n builtin.__dict__['SystemExit'] = CompileError\n \n # distutils for MSVC messes with the environment, so we save the\n # current state and restore them afterward.\n import copy\n environ = copy.deepcopy(os.environ)\n try:\n setup(name = module_name, ext_modules = [ext],verbose=verb)\n finally:\n # restore state\n os.environ = environ \n # restore SystemExit\n builtin.__dict__['SystemExit'] = old_SysExit\n t2 = time.time()\n \n if verbose == 1:\n print 'finished compiling (sec): ', t2 - t1 \n success = 1\n configure_python_path(build_dir)\n except SyntaxError: #TypeError:\n success = 0 \n \n # restore argv after our trick... \n restore_sys_argv()\n \n return success\n\nold_argv = []\ndef configure_sys_argv(compiler_name,temp_dir,build_dir):\n # We're gonna play some tricks with argv here to pass info to distutils \n # which is really built for command line use. better way??\n global old_argv\n old_argv = sys.argv[:] \n sys.argv = ['','build_ext','--build-lib', build_dir,\n '--build-temp',temp_dir] \n if compiler_name == 'gcc':\n sys.argv.insert(2,'--compiler='+compiler_name)\n elif compiler_name:\n sys.argv.insert(2,'--compiler='+compiler_name)\n\ndef restore_sys_argv():\n sys.argv = old_argv\n \ndef configure_python_path(build_dir): \n #make sure the module lives in a directory on the python path.\n python_paths = [os.path.abspath(x) for x in sys.path]\n if os.path.abspath(build_dir) not in python_paths:\n #print \"warning: build directory was not part of python path.\"\\\n # \" It has been appended to the path.\"\n sys.path.append(os.path.abspath(build_dir))\n\ndef choose_compiler(compiler_name=''):\n \"\"\" Try and figure out which compiler is gonna be used on windows.\n On other platforms, it just returns whatever value it is given.\n \n converts 'gcc' to 'mingw32' on win32\n \"\"\"\n if sys.platform == 'win32': \n if not compiler_name:\n # On Windows, default to MSVC and use gcc if it wasn't found\n # wasn't found. If neither are found, go with whatever\n # the default is for distutils -- and probably fail...\n if msvc_exists():\n compiler_name = 'msvc'\n elif gcc_exists():\n compiler_name = 'mingw32'\n elif compiler_name == 'gcc':\n compiler_name = 'mingw32'\n else:\n # don't know how to force gcc -- look into this.\n if compiler_name == 'gcc':\n compiler_name = 'unix' \n return compiler_name\n \ndef gcc_exists():\n \"\"\" Test to make sure gcc is found \n \n Does this return correct value on win98???\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('gcc -v')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Reading specs') != -1:\n result = 1\n except:\n # This was needed because the msvc compiler messes with\n # the path variable. and will occasionlly mess things up\n # so much that gcc is lost in the path. (Occurs in test\n # scripts)\n result = not os.system('gcc -v')\n return result\n\ndef msvc_exists():\n \"\"\" Determine whether MSVC is available on the machine.\n \"\"\"\n result = 0\n try:\n w,r=os.popen4('cl')\n w.close()\n str_result = r.read()\n #print str_result\n if string.find(str_result,'Microsoft') != -1:\n result = 1\n except:\n #assume we're ok if devstudio exists\n import distutils.msvccompiler\n version = distutils.msvccompiler.get_devstudio_version()\n if version:\n result = 1\n return result\n\ndef configure_temp_dir(temp_dir=None):\n if temp_dir is None: \n temp_dir = tempfile.gettempdir()\n elif not os.path.exists(temp_dir) or not os.access(temp_dir,os.W_OK):\n print \"warning: specified temp_dir '%s' does not exist or is \" \\\n \"or is not writable. Using the default temp directory\" % \\\n temp_dir\n temp_dir = tempfile.gettempdir()\n\n # final check that that directories are writable. \n if not os.access(temp_dir,os.W_OK):\n msg = \"Either the temp or build directory wasn't writable. Check\" \\\n \" these locations: '%s'\" % temp_dir \n raise ValueError, msg\n return temp_dir\n\ndef configure_build_dir(build_dir=None):\n # make sure build_dir exists and is writable\n if build_dir and (not os.path.exists(build_dir) or \n not os.access(build_dir,os.W_OK)):\n print \"warning: specified build_dir '%s' does not exist or is \" \\\n \"or is not writable. Trying default locations\" % build_dir\n build_dir = None\n \n if build_dir is None:\n #default to building in the home directory of the given module. \n build_dir = os.curdir\n # if it doesn't work use the current directory. This should always\n # be writable. \n if not os.access(build_dir,os.W_OK):\n print \"warning:, neither the module's directory nor the \"\\\n \"current directory are writable. Using the temporary\"\\\n \"directory.\"\n build_dir = tempfile.gettempdir()\n\n # final check that that directories are writable.\n if not os.access(build_dir,os.W_OK):\n msg = \"The build directory wasn't writable. Check\" \\\n \" this location: '%s'\" % build_dir\n raise ValueError, msg\n \n return os.path.abspath(build_dir) \n \nif sys.platform == 'win32':\n import distutils.cygwinccompiler\n # the same as cygwin plus some additional parameters\n class Mingw32CCompiler (distutils.cygwinccompiler.CygwinCCompiler):\n \"\"\" A modified MingW32 compiler compatible with an MSVC built Python.\n \n \"\"\"\n \n compiler_type = 'mingw32'\n \n def __init__ (self,\n verbose=0,\n dry_run=0,\n force=0):\n \n distutils.cygwinccompiler.CygwinCCompiler.__init__ (self, verbose, \n dry_run, force)\n \n # A real mingw32 doesn't need to specify a different entry point,\n # but cygwin 2.91.57 in no-cygwin-mode needs it.\n if self.gcc_version <= \"2.91.57\":\n entry_point = '--entry _DllMain@12'\n else:\n entry_point = ''\n if self.linker_dll == 'dllwrap':\n self.linker = 'dllwrap' + ' --driver-name g++'\n elif self.linker_dll == 'gcc':\n self.linker = 'g++' \n # **changes: eric jones 4/11/01\n # 1. Check for import library on Windows. Build if it doesn't exist.\n if not import_library_exists():\n build_import_library()\n \n # **changes: eric jones 4/11/01\n # 2. increased optimization and turned off all warnings\n # 3. also added --driver-name g++\n #self.set_executables(compiler='gcc -mno-cygwin -O2 -w',\n # compiler_so='gcc -mno-cygwin -mdll -O2 -w',\n # linker_exe='gcc -mno-cygwin',\n # linker_so='%s --driver-name g++ -mno-cygwin -mdll -static %s' \n # % (self.linker, entry_point))\n self.set_executables(compiler='g++ -mno-cygwin -O2 -w',\n compiler_so='g++ -mno-cygwin -mdll -O2 -w -Wstrict-prototypes',\n linker_exe='g++ -mno-cygwin',\n linker_so='%s -mno-cygwin -mdll -static %s' \n % (self.linker, entry_point))\n \n # Maybe we should also append -mthreads, but then the finished\n # dlls need another dll (mingwm10.dll see Mingw32 docs)\n # (-mthreads: Support thread-safe exception handling on `Mingw32') \n \n # no additional libraries needed \n self.dll_libraries=[]\n \n # __init__ ()\n \n # On windows platforms, we want to default to mingw32 (gcc)\n # because msvc can't build blitz stuff.\n # We should also check the version of gcc available...\n #distutils.ccompiler._default_compilers['nt'] = 'mingw32'\n #distutils.ccompiler._default_compilers = (('nt', 'mingw32'))\n # reset the Mingw32 compiler in distutils to the one defined above\n distutils.cygwinccompiler.Mingw32CCompiler = Mingw32CCompiler\n \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if os.name == 'nt':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n import lib2def as lib2def\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print 'WARNING: failed to build import library for gcc. Linking will fail.'\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \ndef test(level=10):\n from scipy_base.testing import module_test\n module_test(__name__,__file__,level=level)\n\ndef test_suite(level=1):\n from scipy_base.testing import module_test_suite\n return module_test_suite(__name__,__file__,level=level)\n\n\n\n", + "methods": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 57, + "parameters": [], + "start_line": 30, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 51, + "end_line": 221, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 224, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 236, + "end_line": 237, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 239, + "end_line": 245, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 247, + "end_line": 268, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( name = 'gcc' )", + "filename": "build_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 69, + "parameters": [ + "name" + ], + "start_line": 270, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 292, + "end_line": 309, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 311, + "end_line": 325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 327, + "end_line": 352, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 364, + "end_line": 406, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 418, + "end_line": 426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 428, + "end_line": 454, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 459, + "end_line": 461, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 463, + "end_line": 465, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 1, + "token_count": 34, + "parameters": [], + "start_line": 30, + "end_line": 33, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 0 + }, + { + "name": "build_extension", + "long_name": "build_extension( module_path , compiler_name = '' , build_dir = None , temp_dir = None , verbose = 0 , ** kw )", + "filename": "build_tools.py", + "nloc": 49, + "complexity": 9, + "token_count": 364, + "parameters": [ + "module_path", + "compiler_name", + "build_dir", + "temp_dir", + "verbose", + "kw" + ], + "start_line": 42, + "end_line": 212, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 171, + "top_nesting_level": 0 + }, + { + "name": "configure_sys_argv", + "long_name": "configure_sys_argv( compiler_name , temp_dir , build_dir )", + "filename": "build_tools.py", + "nloc": 9, + "complexity": 3, + "token_count": 68, + "parameters": [ + "compiler_name", + "temp_dir", + "build_dir" + ], + "start_line": 215, + "end_line": 225, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 11, + "top_nesting_level": 0 + }, + { + "name": "restore_sys_argv", + "long_name": "restore_sys_argv( )", + "filename": "build_tools.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 227, + "end_line": 228, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 0 + }, + { + "name": "configure_python_path", + "long_name": "configure_python_path( build_dir )", + "filename": "build_tools.py", + "nloc": 4, + "complexity": 3, + "token_count": 51, + "parameters": [ + "build_dir" + ], + "start_line": 230, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 7, + "top_nesting_level": 0 + }, + { + "name": "choose_compiler", + "long_name": "choose_compiler( compiler_name = '' )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 7, + "token_count": 55, + "parameters": [ + "compiler_name" + ], + "start_line": 238, + "end_line": 259, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "msvc_exists", + "long_name": "msvc_exists( )", + "filename": "build_tools.py", + "nloc": 14, + "complexity": 4, + "token_count": 71, + "parameters": [], + "start_line": 282, + "end_line": 299, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 0 + }, + { + "name": "configure_temp_dir", + "long_name": "configure_temp_dir( temp_dir = None )", + "filename": "build_tools.py", + "nloc": 13, + "complexity": 5, + "token_count": 82, + "parameters": [ + "temp_dir" + ], + "start_line": 301, + "end_line": 315, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 0 + }, + { + "name": "configure_build_dir", + "long_name": "configure_build_dir( build_dir = None )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 7, + "token_count": 112, + "parameters": [ + "build_dir" + ], + "start_line": 317, + "end_line": 342, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 26, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , verbose = 0 , dry_run = 0 , force = 0 )", + "filename": "build_tools.py", + "nloc": 22, + "complexity": 5, + "token_count": 117, + "parameters": [ + "self", + "verbose", + "dry_run", + "force" + ], + "start_line": 354, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 43, + "top_nesting_level": 2 + }, + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "build_tools.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 408, + "end_line": 416, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "build_tools.py", + "nloc": 18, + "complexity": 2, + "token_count": 190, + "parameters": [], + "start_line": 418, + "end_line": 444, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "test", + "long_name": "test( level = 10 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 23, + "parameters": [ + "level" + ], + "start_line": 449, + "end_line": 451, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "test_suite", + "long_name": "test_suite( level = 1 )", + "filename": "build_tools.py", + "nloc": 3, + "complexity": 1, + "token_count": 24, + "parameters": [ + "level" + ], + "start_line": 453, + "end_line": 455, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "_init_posix", + "long_name": "_init_posix( )", + "filename": "build_tools.py", + "nloc": 8, + "complexity": 2, + "token_count": 57, + "parameters": [], + "start_line": 30, + "end_line": 42, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( )", + "filename": "build_tools.py", + "nloc": 11, + "complexity": 3, + "token_count": 61, + "parameters": [], + "start_line": 261, + "end_line": 280, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 0 + }, + { + "name": "gcc_exists", + "long_name": "gcc_exists( name = 'gcc' )", + "filename": "build_tools.py", + "nloc": 12, + "complexity": 3, + "token_count": 69, + "parameters": [ + "name" + ], + "start_line": 270, + "end_line": 290, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 21, + "top_nesting_level": 0 + } + ], + "nloc": 230, + "complexity": 56, + "token_count": 1440, + "diff_parsed": { + "added": [ + " #distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')", + " # FreeBSD names gcc as cc, so the above find and replace doesn't work.", + " # So, assume first entry in ld is the name of the linker -- gcc or cc or", + " # whatever. This is a sane assumption, correct?", + " # If the linker is gcc, set it to g++", + " link_cmds = ld.split()", + " if gcc_exists(link_cmds[0]):", + " link_cmds[0] = 'g++'", + " ld = ' '.join(link_cmds)", + " distutils.sysconfig._config_vars['LDSHARED'] = ld", + "def gcc_exists(name = 'gcc'):", + " cmd = '%s -v' % name", + " w,r=os.popen4(cmd)", + " result = not os.system(cmd)" + ], + "deleted": [ + " distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')", + "def gcc_exists():", + " w,r=os.popen4('gcc -v')", + " result = not os.system('gcc -v')" + ] + } + } + ] + }, + { + "hash": "ed32f5697c533e7dd77a709a81c6f3eaef752b20", + "msg": "Fixed testing interface for linalg2, in testing local paths are inserted to first position instead of last", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2002-04-06T12:32:37+00:00", + "author_timezone": 0, + "committer_date": "2002-04-06T12:32:37+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "525bfa8f809ecb4a14080b5a3b4b055b303b701e" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 6, + "insertions": 9, + "lines": 15, + "files": 1, + "dmm_unit_size": null, + "dmm_unit_complexity": null, + "dmm_unit_interfacing": null, + "modified_files": [ + { + "old_path": "scipy_base/testing.py", + "new_path": "scipy_base/testing.py", + "filename": "testing.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -4,6 +4,9 @@\n class ScipyTestCase (unittest.TestCase):\n \n def measure(self,code_str,times=1):\n+ \"\"\" Return elapsed time for executing code_str in the\n+ namespace of the caller for given times.\n+ \"\"\"\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n@@ -179,9 +182,9 @@ def module_test(mod_name,mod_file,level=10):\n #print 'testing', mod_name\n d,f = os.path.split(mod_file)\n \n- # add the tests directory to the python path\n+ # insert the tests directory to the python path\n test_dir = os.path.join(d,'tests')\n- sys.path.append(test_dir)\n+ sys.path.insert(0,test_dir)\n \n # call the \"test_xxx.test()\" function for the appropriate\n # module.\n@@ -199,7 +202,7 @@ def module_test(mod_name,mod_file,level=10):\n exec(test_string)\n \n # remove test directory from python path.\n- sys.path = sys.path[:-1]\n+ sys.path = sys.path[1:]\n \n def module_test_suite(mod_name,mod_file,level=10):\n #try:\n@@ -207,9 +210,9 @@ def module_test_suite(mod_name,mod_file,level=10):\n print ' creating test suite for:', mod_name\n d,f = os.path.split(mod_file)\n \n- # add the tests directory to the python path\n+ # insert the tests directory to the python path\n test_dir = os.path.join(d,'tests')\n- sys.path.append(test_dir)\n+ sys.path.insert(0,test_dir)\n \n # call the \"test_xxx.test()\" function for the appropriate\n # module.\n@@ -223,7 +226,7 @@ def module_test_suite(mod_name,mod_file,level=10):\n exec(test_string)\n \n # remove test directory from python path.\n- sys.path = sys.path[:-1]\n+ sys.path = sys.path[1:]\n return suite\n #except:\n # print ' !! FAILURE loading test suite from', test_module, ':'\n", + "added_lines": 9, + "deleted_lines": 6, + "source_code": "import os,sys,time\nimport unittest\n\nclass ScipyTestCase (unittest.TestCase):\n\n def measure(self,code_str,times=1):\n \"\"\" Return elapsed time for executing code_str in the\n namespace of the caller for given times.\n \"\"\"\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n 'ScipyTestCase runner for '+self.__class__.__name__,\n 'exec')\n i = 0\n elapsed = time.time()\n while i.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n\n\"\"\"\n\nimport os, sys\nimport distutils.ccompiler\n\n# I'd really like to pull this out of scipy and make it part of distutils...\nimport scipy_distutils.command.build_flib as build_flib\n\n\nif sys.platform == 'win32':\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n \n # 1. Build libpython from .lib and .dll if they don't exist. \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if sys.platform == 'win32':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n #print full_path\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n # lib2def lives in weave\n sys.path.insert(0,os.path.join('.','weave'))\n import lib2def\n del sys.path[0]\n\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n print cmd\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print \"WARNING: failed to build import library for gcc. \"\\\n \"Linking will fail.\"\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \n def set_windows_compiler(compiler):\n distutils.ccompiler._default_compilers = (\n \n # Platform string mappings\n \n # on a cygwin built python we can use gcc like an ordinary UNIXish\n # compiler\n ('cygwin.*', 'unix'),\n \n # OS name mappings\n ('posix', 'unix'),\n ('nt', compiler),\n ('mac', 'mwerks'),\n \n ) \n def use_msvc():\n set_windows_compiler('msvc')\n \n def use_gcc(): \n set_windows_compiler('mingw32')\n \n standard_compiler_list = build_flib.all_compilers[:]\n def use_g77():\n build_flib.all_compilers = [build_flib.gnu_fortran_compiler] \n \n def use_standard_fortran_compiler():\n build_flib.all_compilers = standard_compiler_list\n \n # 2. force the use of gcc on windows platform\n use_gcc()\n # 3. force the use of g77 on windows platform\n use_g77()\n if not import_library_exists():\n build_import_library()\n", + "source_code_before": "\"\"\"\nSupport code for building Python extensions on Windows.\n\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n\n\"\"\"\n\nimport os, sys\nimport distutils.ccompiler\n\n# I'd really like to pull this out of scipy and make it part of distutils...\nimport scipy_distutils.command.build_flib as build_flib\n\n\nif sys.platform == 'win32':\n # NT stuff\n # 1. Make sure libpython.a exists for gcc. If not, build it.\n # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) \n # 3. Force windows to use g77\n \n # 1. Build libpython from .lib and .dll if they don't exist. \n def import_library_exists():\n \"\"\" on windows platforms, make sure a gcc import library exists\n \"\"\"\n if sys.platform == 'win32':\n lib_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n full_path = os.path.join(sys.prefix,'libs',lib_name)\n #print full_path\n if not os.path.exists(full_path):\n return 0\n return 1\n \n def build_import_library():\n \"\"\" Build the import libraries for Mingw32-gcc on Windows\n \"\"\"\n # lib2def lives in weave\n sys.path.append(os.path.join('.','weave'))\n\n import lib2def\n #libfile, deffile = parse_cmd()\n #if deffile is None:\n # deffile = sys.stdout\n #else:\n # deffile = open(deffile, 'w')\n lib_name = \"python%d%d.lib\" % tuple(sys.version_info[:2]) \n lib_file = os.path.join(sys.prefix,'libs',lib_name)\n def_name = \"python%d%d.def\" % tuple(sys.version_info[:2]) \n def_file = os.path.join(sys.prefix,'libs',def_name)\n nm_cmd = '%s %s' % (lib2def.DEFAULT_NM, lib_file)\n nm_output = lib2def.getnm(nm_cmd)\n dlist, flist = lib2def.parse_nm(nm_output)\n lib2def.output_def(dlist, flist, lib2def.DEF_HEADER, open(def_file, 'w'))\n \n out_name = \"libpython%d%d.a\" % tuple(sys.version_info[:2])\n out_file = os.path.join(sys.prefix,'libs',out_name)\n dll_name = \"python%d%d.dll\" % tuple(sys.version_info[:2])\n args = (dll_name,def_file,out_file)\n cmd = 'dlltool --dllname %s --def %s --output-lib %s' % args\n print cmd\n success = not os.system(cmd)\n # for now, fail silently\n if not success:\n print \"WARNING: failed to build import library for gcc. \"\\\n \"Linking will fail.\"\n #if not success:\n # msg = \"Couldn't find import library, and failed to build it.\"\n # raise DistutilsPlatformError, msg\n \n def set_windows_compiler(compiler):\n distutils.ccompiler._default_compilers = (\n \n # Platform string mappings\n \n # on a cygwin built python we can use gcc like an ordinary UNIXish\n # compiler\n ('cygwin.*', 'unix'),\n \n # OS name mappings\n ('posix', 'unix'),\n ('nt', compiler),\n ('mac', 'mwerks'),\n \n ) \n def use_msvc():\n set_windows_compiler('msvc')\n \n def use_gcc(): \n set_windows_compiler('mingw32') \n \n standard_compiler_list = build_flib.all_compilers[:]\n def use_g77():\n build_flib.all_compilers = [build_flib.gnu_fortran_compiler] \n \n def use_standard_fortran_compiler():\n build_flib.all_compilers = standard_compiler_list\n \n # 2. force the use of gcc on windows platform\n use_gcc()\n # 3. force the use of g77 on windows platform\n use_g77()\n if not import_library_exists():\n build_import_library()\n\n \n", + "methods": [ + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 25, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 22, + "complexity": 2, + "token_count": 218, + "parameters": [], + "start_line": 36, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + }, + { + "name": "set_windows_compiler", + "long_name": "set_windows_compiler( compiler )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 1, + "token_count": 37, + "parameters": [ + "compiler" + ], + "start_line": 73, + "end_line": 87, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "use_msvc", + "long_name": "use_msvc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 88, + "end_line": 89, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_gcc", + "long_name": "use_gcc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_g77", + "long_name": "use_g77( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 95, + "end_line": 96, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_standard_fortran_compiler", + "long_name": "use_standard_fortran_compiler( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 98, + "end_line": 99, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "methods_before": [ + { + "name": "import_library_exists", + "long_name": "import_library_exists( )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 3, + "token_count": 57, + "parameters": [], + "start_line": 25, + "end_line": 34, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 10, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 21, + "complexity": 2, + "token_count": 209, + "parameters": [], + "start_line": 36, + "end_line": 67, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 32, + "top_nesting_level": 1 + }, + { + "name": "set_windows_compiler", + "long_name": "set_windows_compiler( compiler )", + "filename": "mingw32_support.py", + "nloc": 7, + "complexity": 1, + "token_count": 37, + "parameters": [ + "compiler" + ], + "start_line": 72, + "end_line": 86, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 15, + "top_nesting_level": 1 + }, + { + "name": "use_msvc", + "long_name": "use_msvc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 87, + "end_line": 88, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_gcc", + "long_name": "use_gcc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 90, + "end_line": 91, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_g77", + "long_name": "use_g77( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 13, + "parameters": [], + "start_line": 94, + "end_line": 95, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "use_standard_fortran_compiler", + "long_name": "use_standard_fortran_compiler( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 9, + "parameters": [], + "start_line": 97, + "end_line": 98, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + } + ], + "changed_methods": [ + { + "name": "use_gcc", + "long_name": "use_gcc( )", + "filename": "mingw32_support.py", + "nloc": 2, + "complexity": 1, + "token_count": 8, + "parameters": [], + "start_line": 91, + "end_line": 92, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "build_import_library", + "long_name": "build_import_library( )", + "filename": "mingw32_support.py", + "nloc": 22, + "complexity": 2, + "token_count": 218, + "parameters": [], + "start_line": 36, + "end_line": 68, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 33, + "top_nesting_level": 1 + } + ], + "nloc": 62, + "complexity": 10, + "token_count": 404, + "diff_parsed": { + "added": [ + " sys.path.insert(0,os.path.join('.','weave'))", + " del sys.path[0]", + "", + " set_windows_compiler('mingw32')" + ], + "deleted": [ + " sys.path.append(os.path.join('.','weave'))", + "", + " set_windows_compiler('mingw32')", + "", + "" + ] + } + } + ] + }, + { + "hash": "de1ef4814bd3e96ed4f7c384c45f2231bd61a20d", + "msg": "Cleaned up testing.py", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2002-04-07T10:08:03+00:00", + "author_timezone": 0, + "committer_date": "2002-04-07T10:08:03+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "7cda86618c3f2e1ff4781b13bec6322892ce2763" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 57, + "insertions": 59, + "lines": 116, + "files": 1, + "dmm_unit_size": 0.6666666666666666, + "dmm_unit_complexity": 0.3333333333333333, + "dmm_unit_interfacing": 0.5, + "modified_files": [ + { + "old_path": "scipy_base/testing.py", + "new_path": "scipy_base/testing.py", + "filename": "testing.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -1,6 +1,12 @@\n-import os,sys,time\n-import unittest\n \n+__all__ = []\n+\n+import os,sys,time,glob,string,traceback,unittest\n+\n+from Numeric import alltrue,equal,shape,ravel,around,zeros,Float64\n+import scipy_base.fastumath\n+\n+__all__.append('ScipyTestCase')\n class ScipyTestCase (unittest.TestCase):\n \n def measure(self,code_str,times=1):\n@@ -27,7 +33,7 @@ def remove_ignored_patterns(files,pattern):\n if not fnmatch(file,pattern):\n good_files.append(file)\n return good_files \n- \n+\n def remove_ignored_files(original,ignored_files,cur_dir):\n \"\"\" This is actually expanded to do pattern matching.\n \n@@ -48,7 +54,8 @@ def remove_ignored_files(original,ignored_files,cur_dir):\n good_files = remove_ignored_patterns(good_files,pattern)\n \n return good_files\n- \n+\n+__all__.append('harvest_modules')\n def harvest_modules(package,ignore=None):\n \"\"\"* Retreive a list of all modules that live within a package.\n \n@@ -57,12 +64,9 @@ def harvest_modules(package,ignore=None):\n directories. The returned list contains actual modules, not\n just their names.\n *\"\"\"\n- import os,sys\n-\n d,f = os.path.split(package.__file__)\n \n # go through the directory and import every py file there.\n- import glob\n common_dir = os.path.join(d,'*.py')\n py_files = glob.glob(common_dir)\n #py_files.remove(os.path.join(d,'__init__.py'))\n@@ -90,6 +94,7 @@ def harvest_modules(package,ignore=None):\n \n return all_modules\n \n+__all__.append('harvest_packages')\n def harvest_packages(package,ignore = None):\n \"\"\" Retreive a list of all sub-packages that live within a package.\n \n@@ -98,7 +103,6 @@ def harvest_packages(package,ignore = None):\n directories. The returned list contains actual package objects, not\n just their names.\n \"\"\"\n- import os,sys\n join = os.path.join\n \n d,f = os.path.split(package.__file__)\n@@ -127,6 +131,7 @@ def harvest_packages(package,ignore = None):\n output_exception() \n return all_packages\n \n+__all__.append('harvest_modules_and_packages')\n def harvest_modules_and_packages(package,ignore=None):\n \"\"\" Retreive list of all packages and modules that live within a package.\n \n@@ -135,6 +140,7 @@ def harvest_modules_and_packages(package,ignore=None):\n all = harvest_modules(package,ignore) + harvest_packages(package,ignore)\n return all\n \n+__all__.append('harvest_test_suites')\n def harvest_test_suites(package,ignore = None,level=10):\n \"\"\"\n package -- the module to test. This is an actual module object \n@@ -144,7 +150,6 @@ def harvest_test_suites(package,ignore = None,level=10):\n of tests. This is a fast \"smoke test\". Tests that take\n longer to run should have higher numbers ranging up to 10.\n \"\"\"\n- import unittest\n suites=[]\n test_modules = harvest_modules_and_packages(package,ignore)\n #for i in test_modules:\n@@ -174,11 +179,11 @@ def harvest_test_suites(package,ignore = None,level=10):\n total_suite = unittest.TestSuite(suites)\n return total_suite\n \n+__all__.append('module_test')\n def module_test(mod_name,mod_file,level=10):\n \"\"\"*\n \n *\"\"\"\n- import os,sys,string\n #print 'testing', mod_name\n d,f = os.path.split(mod_file)\n \n@@ -204,9 +209,9 @@ def module_test(mod_name,mod_file,level=10):\n # remove test directory from python path.\n sys.path = sys.path[1:]\n \n+__all__.append('module_test_suite')\n def module_test_suite(mod_name,mod_file,level=10):\n #try:\n- import os,sys,string\n print ' creating test suite for:', mod_name\n d,f = os.path.split(mod_file)\n \n@@ -236,6 +241,7 @@ def module_test_suite(mod_name,mod_file,level=10):\n \n # Utility function to facilitate testing.\n \n+__all__.append('assert_equal')\n def assert_equal(actual,desired,err_msg='',verbose=1):\n \"\"\" Raise an assertion if two items are not\n equal. I think this should be part of unittest.py\n@@ -252,6 +258,7 @@ def assert_equal(actual,desired,err_msg='',verbose=1):\n + '\\nACTUAL: ' + str(actual)\n assert desired == actual, msg\n \n+__all__.append('assert_almost_equal')\n def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1):\n \"\"\" Raise an assertion if two items are not\n equal. I think this should be part of unittest.py\n@@ -268,6 +275,7 @@ def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1):\n + '\\nACTUAL: ' + str(actual)\n assert round(abs(desired - actual),decimal) == 0, msg\n \n+__all__.append('assert_approx_equal')\n def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1):\n \"\"\" Raise an assertion if two items are not\n equal. I think this should be part of unittest.py\n@@ -289,52 +297,47 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1):\n + '\\nACTUAL: ' + str(actual)\n assert math.fabs(sc_desired - sc_actual) < pow(10.,-1*significant), msg\n \n-try:\n- # Numeric specific testss\n- from Numeric import *\n- from scipy_base.fastumath import *\n- \n- def assert_array_equal(x,y,err_msg=''):\n- msg = '\\nArrays are not equal'\n- try:\n- assert alltrue(equal(shape(x),shape(y))),\\\n- msg + ' (shapes mismatch):\\n\\t' + err_msg\n- reduced = equal(x,y)\n- assert alltrue(ravel(reduced)),\\\n- msg + ':\\n\\t' + err_msg\n- except ValueError:\n- print shape(x),shape(y)\n- raise ValueError, 'arrays are not equal'\n- \n- def assert_array_almost_equal(x,y,decimal=6,err_msg=''):\n- msg = '\\nArrays are not almost equal'\n- try:\n- assert alltrue(equal(shape(x),shape(y))),\\\n- msg + ' (shapes mismatch):\\n\\t' + err_msg\n- reduced = equal(around(abs(x-y),decimal),0)\n- assert alltrue(ravel(reduced)),\\\n- msg + ':\\n\\t' + err_msg\n- except ValueError:\n- print sys.exc_value\n- print shape(x),shape(y)\n- print x, y\n- raise ValueError, 'arrays are not almost equal'\n-\n- def rand(*args):\n- \"\"\" Returns an array of random numbers with the given shape.\n- used for testing\n- \"\"\"\n- import whrandom\n- results = zeros(args,Float64)\n- f = results.flat\n- for i in range(len(f)):\n- f[i] = whrandom.random()\n- return results \n-\n-except:\n- pass # Numeric not installed\n+\n+__all__.append('assert_array_equal')\n+def assert_array_equal(x,y,err_msg=''):\n+ msg = '\\nArrays are not equal'\n+ try:\n+ assert alltrue(equal(shape(x),shape(y))),\\\n+ msg + ' (shapes mismatch):\\n\\t' + err_msg\n+ reduced = equal(x,y)\n+ assert alltrue(ravel(reduced)),\\\n+ msg + ':\\n\\t' + err_msg\n+ except ValueError:\n+ print shape(x),shape(y)\n+ raise ValueError, 'arrays are not equal'\n+\n+__all__.append('assert_array_almost_equal')\n+def assert_array_almost_equal(x,y,decimal=6,err_msg=''):\n+ msg = '\\nArrays are not almost equal'\n+ try:\n+ assert alltrue(equal(shape(x),shape(y))),\\\n+ msg + ' (shapes mismatch):\\n\\t' + err_msg\n+ reduced = equal(around(abs(x-y),decimal),0)\n+ assert alltrue(ravel(reduced)),\\\n+ msg + ':\\n\\t' + err_msg\n+ except ValueError:\n+ print sys.exc_value\n+ print shape(x),shape(y)\n+ print x, y\n+ raise ValueError, 'arrays are not almost equal'\n \n-import traceback,sys\n+__all__.append('rand')\n+def rand(*args):\n+ \"\"\" Returns an array of random numbers with the given shape.\n+ used for testing\n+ \"\"\"\n+ import whrandom\n+ results = zeros(args,Float64)\n+ f = results.flat\n+ for i in range(len(f)):\n+ f[i] = whrandom.random()\n+ return results \n+\n def output_exception():\n try:\n type, value, tb = sys.exc_info()\n@@ -346,4 +349,3 @@ def output_exception():\n (filename, lineno, type.__name__, str(value), function)\n finally:\n type = value = tb = None # clean up\n-\n", + "added_lines": 59, + "deleted_lines": 57, + "source_code": "\n__all__ = []\n\nimport os,sys,time,glob,string,traceback,unittest\n\nfrom Numeric import alltrue,equal,shape,ravel,around,zeros,Float64\nimport scipy_base.fastumath\n\n__all__.append('ScipyTestCase')\nclass ScipyTestCase (unittest.TestCase):\n\n def measure(self,code_str,times=1):\n \"\"\" Return elapsed time for executing code_str in the\n namespace of the caller for given times.\n \"\"\"\n frame = sys._getframe(1)\n locs,globs = frame.f_locals,frame.f_globals\n code = compile(code_str,\n 'ScipyTestCase runner for '+self.__class__.__name__,\n 'exec')\n i = 0\n elapsed = time.time()\n while ilinalg/linalg1 and linalg2->linalg", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2002-04-07T15:03:50+00:00", + "author_timezone": 0, + "committer_date": "2002-04-07T15:03:50+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "de1ef4814bd3e96ed4f7c384c45f2231bd61a20d" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 104, + "insertions": 1, + "lines": 105, + "files": 3, + "dmm_unit_size": 0.8153846153846154, + "dmm_unit_complexity": 0.49230769230769234, + "dmm_unit_interfacing": 0.0, + "modified_files": [ + { + "old_path": "scipy_distutils/atlas_info.py", + "new_path": null, + "filename": "atlas_info.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,60 +0,0 @@\n-import sys, os\n-from misc_util import get_path\n-from system_info import get_info\n-\n-library_path = None\n-\n-def dir_exists(dir_list):\n- if dir_list:\n- if os.path.exists(dir_list[0]):\n- return 1\n- return 0\n-\n-def get_atlas_info():\n- if sys.platform == 'win32':\n- if not dir_exists(library_path):\n- atlas_library_dirs=['C:\\\\atlas\\\\WinNT_PIIISSE1']\n- else:\n- atlas_library_dirs = library_path\n- blas_libraries = ['f77blas', 'cblas', 'atlas', 'g2c']\n- lapack_libraries = ['lapack'] + blas_libraries\n- #XXX: need to use `atlas_info = get_info('atlas')'\n- atlas_info = {'libraries':lapack_libraries,\n- 'library_dirs':atlas_library_dirs}\n- return atlas_info\n- else:\n- atlas_info = get_info('atlas')\n- return atlas_info\n-\n- if not dir_exists(library_path):\n- atlas_library_dirs = unix_atlas_directory(sys.platform)\n- else:\n- atlas_library_dirs = library_path\n- blas_libraries = ['cblas','f77blas','atlas','g2c']\n- lapack_libraries = ['lapack'] + blas_libraries\n- return blas_libraries, lapack_libraries, atlas_library_dirs\n-\n-def unix_atlas_directory(platform): #OBSOLETE (see system_info)\n- \"\"\" Search a list of common locations looking for the atlas directory.\n- \n- Return None if the directory isn't found, otherwise return the\n- directory name. This isn't very sophisticated right now. I can\n- imagine doing an ftp to our server on platforms that we know about.\n- \n- Atlas is a highly optimized version of lapack and blas that is fast\n- on almost all platforms.\n- \"\"\"\n- result = [] #None\n- # do a little looking for the linalg directory for atlas libraries\n- #path = get_path(__name__)\n- #local_atlas0 = os.path.join(path,platform,'atlas')\n- #local_atlas1 = os.path.join(path,platform[:-1],'atlas')\n- \n- # first look for a system defined atlas directory\n- dir_search = ['/usr/local/lib/atlas','/usr/lib/atlas']#,\n- # local_atlas0, local_atlas1]\n- for directory in dir_search:\n- if os.path.exists(directory):\n- result = [directory]\n- # we should really do an ftp search or something like that at this point.\n- return result \n", + "added_lines": 0, + "deleted_lines": 60, + "source_code": null, + "source_code_before": "import sys, os\nfrom misc_util import get_path\nfrom system_info import get_info\n\nlibrary_path = None\n\ndef dir_exists(dir_list):\n if dir_list:\n if os.path.exists(dir_list[0]):\n return 1\n return 0\n\ndef get_atlas_info():\n if sys.platform == 'win32':\n if not dir_exists(library_path):\n atlas_library_dirs=['C:\\\\atlas\\\\WinNT_PIIISSE1']\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['f77blas', 'cblas', 'atlas', 'g2c']\n lapack_libraries = ['lapack'] + blas_libraries\n #XXX: need to use `atlas_info = get_info('atlas')'\n atlas_info = {'libraries':lapack_libraries,\n 'library_dirs':atlas_library_dirs}\n return atlas_info\n else:\n atlas_info = get_info('atlas')\n return atlas_info\n\n if not dir_exists(library_path):\n atlas_library_dirs = unix_atlas_directory(sys.platform)\n else:\n atlas_library_dirs = library_path\n blas_libraries = ['cblas','f77blas','atlas','g2c']\n lapack_libraries = ['lapack'] + blas_libraries\n return blas_libraries, lapack_libraries, atlas_library_dirs\n\ndef unix_atlas_directory(platform): #OBSOLETE (see system_info)\n \"\"\" Search a list of common locations looking for the atlas directory.\n \n Return None if the directory isn't found, otherwise return the\n directory name. This isn't very sophisticated right now. I can\n imagine doing an ftp to our server on platforms that we know about.\n \n Atlas is a highly optimized version of lapack and blas that is fast\n on almost all platforms.\n \"\"\"\n result = [] #None\n # do a little looking for the linalg directory for atlas libraries\n #path = get_path(__name__)\n #local_atlas0 = os.path.join(path,platform,'atlas')\n #local_atlas1 = os.path.join(path,platform[:-1],'atlas')\n \n # first look for a system defined atlas directory\n dir_search = ['/usr/local/lib/atlas','/usr/lib/atlas']#,\n # local_atlas0, local_atlas1]\n for directory in dir_search:\n if os.path.exists(directory):\n result = [directory]\n # we should really do an ftp search or something like that at this point.\n return result \n", + "methods": [], + "methods_before": [ + { + "name": "dir_exists", + "long_name": "dir_exists( dir_list )", + "filename": "atlas_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 25, + "parameters": [ + "dir_list" + ], + "start_line": 7, + "end_line": 11, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "get_atlas_info", + "long_name": "get_atlas_info( )", + "filename": "atlas_info.py", + "nloc": 21, + "complexity": 4, + "token_count": 113, + "parameters": [], + "start_line": 13, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + }, + { + "name": "unix_atlas_directory", + "long_name": "unix_atlas_directory( platform )", + "filename": "atlas_info.py", + "nloc": 7, + "complexity": 3, + "token_count": 39, + "parameters": [ + "platform" + ], + "start_line": 37, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "dir_exists", + "long_name": "dir_exists( dir_list )", + "filename": "atlas_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 25, + "parameters": [ + "dir_list" + ], + "start_line": 7, + "end_line": 11, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "unix_atlas_directory", + "long_name": "unix_atlas_directory( platform )", + "filename": "atlas_info.py", + "nloc": 7, + "complexity": 3, + "token_count": 39, + "parameters": [ + "platform" + ], + "start_line": 37, + "end_line": 60, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 24, + "top_nesting_level": 0 + }, + { + "name": "get_atlas_info", + "long_name": "get_atlas_info( )", + "filename": "atlas_info.py", + "nloc": 21, + "complexity": 4, + "token_count": 113, + "parameters": [], + "start_line": 13, + "end_line": 35, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "import sys, os", + "from misc_util import get_path", + "from system_info import get_info", + "", + "library_path = None", + "", + "def dir_exists(dir_list):", + " if dir_list:", + " if os.path.exists(dir_list[0]):", + " return 1", + " return 0", + "", + "def get_atlas_info():", + " if sys.platform == 'win32':", + " if not dir_exists(library_path):", + " atlas_library_dirs=['C:\\\\atlas\\\\WinNT_PIIISSE1']", + " else:", + " atlas_library_dirs = library_path", + " blas_libraries = ['f77blas', 'cblas', 'atlas', 'g2c']", + " lapack_libraries = ['lapack'] + blas_libraries", + " #XXX: need to use `atlas_info = get_info('atlas')'", + " atlas_info = {'libraries':lapack_libraries,", + " 'library_dirs':atlas_library_dirs}", + " return atlas_info", + " else:", + " atlas_info = get_info('atlas')", + " return atlas_info", + "", + " if not dir_exists(library_path):", + " atlas_library_dirs = unix_atlas_directory(sys.platform)", + " else:", + " atlas_library_dirs = library_path", + " blas_libraries = ['cblas','f77blas','atlas','g2c']", + " lapack_libraries = ['lapack'] + blas_libraries", + " return blas_libraries, lapack_libraries, atlas_library_dirs", + "", + "def unix_atlas_directory(platform): #OBSOLETE (see system_info)", + " \"\"\" Search a list of common locations looking for the atlas directory.", + "", + " Return None if the directory isn't found, otherwise return the", + " directory name. This isn't very sophisticated right now. I can", + " imagine doing an ftp to our server on platforms that we know about.", + "", + " Atlas is a highly optimized version of lapack and blas that is fast", + " on almost all platforms.", + " \"\"\"", + " result = [] #None", + " # do a little looking for the linalg directory for atlas libraries", + " #path = get_path(__name__)", + " #local_atlas0 = os.path.join(path,platform,'atlas')", + " #local_atlas1 = os.path.join(path,platform[:-1],'atlas')", + "", + " # first look for a system defined atlas directory", + " dir_search = ['/usr/local/lib/atlas','/usr/lib/atlas']#,", + " # local_atlas0, local_atlas1]", + " for directory in dir_search:", + " if os.path.exists(directory):", + " result = [directory]", + " # we should really do an ftp search or something like that at this point.", + " return result" + ] + } + }, + { + "old_path": "scipy_distutils/system_info.py", + "new_path": "scipy_distutils/system_info.py", + "filename": "system_info.py", + "extension": "py", + "change_type": "MODIFY", + "diff": "@@ -116,7 +116,7 @@ class F2pyNotFoundError(NotFoundError):\n \n class NumericNotFoundError(NotFoundError):\n \"\"\"\n- Numeric (http://pfdubois.com/numpy/) module not found.\n+ Numeric (http://www.numpy.org/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n \n class X11NotFoundError(NotFoundError):\n@@ -138,7 +138,6 @@ def __init__ (self,\n default_include_dirs=default_include_dirs,\n ):\n self.__class__.info = {}\n- #self.__class__.need_refresh = not self.info\n self.local_prefixes = []\n defaults = {}\n defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)\n@@ -153,7 +152,6 @@ def __init__ (self,\n self.static_first = self.cp.getboolean(self.section, 'static_first')\n \n def set_info(self,**info):\n- #self.__class__.info = info\n self.saved_results[self.__class__.__name__] = info\n def has_info(self):\n return self.saved_results.has_key(self.__class__.__name__)\n", + "added_lines": 1, + "deleted_lines": 3, + "source_code": "#!/usr/bin/env python\n\"\"\"\nThis file defines a set of system_info classes for getting\ninformation about various resources (libraries, library directories,\ninclude directories, etc.) in the system. Currently, the following\nclasses are available:\n atlas_info\n fftw_info\n x11_info\n\nUsage:\n info_dict = get_info()\n where is a string 'atlas','x11','fftw'.\n\n Returned info_dict is a dictionary which is compatible with\n distutils.setup keyword arguments. If info_dict == {}, then the\n asked resource is not available (or system_info could not find it).\n\nGlobal parameters:\n system_info.static_first - a flag for indicating that static\n libraries are searched first than shared ones.\n system_info.verbose - show the results if set.\n\nThe file 'site.cfg' in the same directory as this module is read\nfor configuration options. The format is that used by ConfigParser (i.e.,\nWindows .INI style). The section DEFAULT has options that are the default\nfor each section. The available sections are fftw, atlas, and x11. Appropiate\ndefaults are used if nothing is specified.\n\nExample:\n----------\n[DEFAULT]\nlib_dir = /usr/lib:/usr/local/lib:/opt/lib\ninclude_dir = /usr/include:/usr/local/include:/opt/include\n# use static libraries in preference to shared ones\nstatic_first = 1\n\n[fftw]\nfftw_libs = fftw, rfftw\nfftw_opt_libs = fftw_threaded, rfftw_threaded\n# if the above aren't found, look for {s,d}fftw_libs and {s,d}fftw_opt_libs\n\n[atlas]\nlib_dir = /usr/lib/3dnow:/usr/lib/3dnow/atlas\n# for overriding the names of the atlas libraries\natlas_libs = f77blas, cblas, atlas\nlapack_libs = lapack\n\n[x11]\nlib_dir = /usr/X11R6/lib\ninclude_dir = /usr/X11R6/include\n----------\n\nAuthors:\n Pearu Peterson , February 2002\n David M. Cooke , April 2002\nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\"\"\"\n\nimport sys,os,re,types\nfrom distutils.errors import DistutilsError\nfrom glob import glob\nimport ConfigParser\n\nfrom distutils.sysconfig import get_config_vars\n\nif sys.platform == 'win32':\n default_lib_dirs = ['C:\\\\'] # probably not very helpful...\n default_include_dirs = []\n default_x11_lib_dirs = []\n default_x11_include_dirs = []\nelse:\n default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib']\n default_include_dirs = ['/usr/local/include',\n '/opt/include', '/usr/include']\n default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib']\n default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include']\n\nif os.path.join(sys.prefix, 'lib') not in default_lib_dirs:\n default_lib_dirs.append(os.path.join(sys.prefix, 'lib'))\n default_include_dirs.append(os.path.join(sys.prefix, 'include'))\ndefault_lib_dirs = filter(os.path.isdir, default_lib_dirs)\ndefault_include_dirs = filter(os.path.isdir, default_include_dirs)\n\nso_ext = get_config_vars('SO')[0] or ''\n\ndef get_info(name):\n cl = {'atlas':atlas_info,\n 'x11':x11_info,\n 'fftw':fftw_info}.get(name.lower(),system_info)\n return cl().get_info()\n\nclass NotFoundError(DistutilsError):\n \"\"\"Some third-party program or library is not found.\"\"\"\n\nclass AtlasNotFoundError(NotFoundError):\n \"\"\"\n Atlas (http://math-atlas.sourceforge.net/) libraries not found.\n Either install them in /usr/local/lib/atlas or /usr/lib/atlas\n and retry setup.py. One can use also ATLAS environment variable\n to indicate the location of Atlas libraries.\"\"\"\n\nclass FFTWNotFoundError(NotFoundError):\n \"\"\"\n FFTW (http://www.fftw.org/) libraries not found.\n Either install them in /usr/local/lib or /usr/lib and retry setup.py.\n One can use also FFTW environment variable to indicate\n the location of FFTW libraries.\"\"\"\n\nclass F2pyNotFoundError(NotFoundError):\n \"\"\"\n f2py2e (http://cens.ioc.ee/projects/f2py2e/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass NumericNotFoundError(NotFoundError):\n \"\"\"\n Numeric (http://www.numpy.org/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass X11NotFoundError(NotFoundError):\n \"\"\"X11 libraries not found.\"\"\"\n\nclass system_info:\n\n \"\"\" get_info() is the only public method. Don't use others.\n \"\"\"\n section = 'DEFAULT'\n\n static_first = 1\n verbose = 1\n need_refresh = 1\n saved_results = {}\n\n def __init__ (self,\n default_lib_dirs=default_lib_dirs,\n default_include_dirs=default_include_dirs,\n ):\n self.__class__.info = {}\n self.local_prefixes = []\n defaults = {}\n defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)\n defaults['include_dir'] = os.pathsep.join(default_include_dirs)\n defaults['static_first'] = '1'\n self.cp = ConfigParser.ConfigParser(defaults)\n cf = os.path.join(os.path.split(os.path.abspath(__file__))[0],\n 'site.cfg')\n self.cp.read([cf])\n if not self.cp.has_section(self.section):\n self.cp.add_section(self.section)\n self.static_first = self.cp.getboolean(self.section, 'static_first')\n\n def set_info(self,**info):\n self.saved_results[self.__class__.__name__] = info\n def has_info(self):\n return self.saved_results.has_key(self.__class__.__name__)\n def get_info(self):\n \"\"\" Return a dictonary with items that are compatible\n with scipy_distutils.setup keyword arguments.\n \"\"\"\n flag = 0\n if not self.has_info():\n flag = 1\n if self.verbose:\n print self.__class__.__name__ + ':'\n if hasattr(self, 'calc_info'):\n self.calc_info()\n if self.verbose:\n if not self.has_info():\n print ' NOT AVAILABLE'\n self.set_info()\n else:\n print ' FOUND:'\n res = self.saved_results.get(self.__class__.__name__)\n if self.verbose and flag:\n for k,v in res.items():\n print ' %s = %s'%(k,v)\n print\n return res\n\n def calc_info_template(self,prefix):\n \"\"\" Calculate info dictionary. \"\"\"\n\n def get_paths(self, section, key):\n dirs = self.cp.get(section, key).split(os.pathsep)\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs.extend(default_dirs)\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def get_lib_dirs(self, key='lib_dir'):\n return self.get_paths(self.section, key)\n def get_include_dirs(self, key='include_dir'):\n return self.get_paths(self.section, key)\n\n def get_libs(self, key, default):\n try:\n libs = self.cp.get(self.section, key)\n except ConfigParser.NoOptionError:\n return default\n return [a.strip() for a in libs.split(',')]\n\n def check_libs(self,lib_dir,libs,opt_libs =[]):\n \"\"\" If static or shared libraries are available then return\n their info dictionary. \"\"\"\n mths = [self.check_static_libs,self.check_shared_libs]\n if not self.static_first:\n mths.reverse() # if one prefers shared libraries\n for m in mths:\n info = m(lib_dir,libs,opt_libs)\n if info is not None: return info\n\n def check_static_libs(self,lib_dir,libs,opt_libs =[]):\n #XXX: what are .lib and .dll files under win32?\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs])) == len(libs):\n info = {'libraries':libs,'library_dirs':[lib_dir]}\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs]))\\\n ==len(opt_libs):\n info['libraries'].extend(opt_libs)\n return info\n\n def check_shared_libs(self,lib_dir,libs,opt_libs =[]):\n shared_libs = []\n for l in libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: shared_libs.append(p)\n if len(shared_libs) == len(libs):\n info = {'extra_objects':shared_libs}\n opt_shared_libs = []\n for l in opt_libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: opt_shared_libs.append(p)\n info['extra_objects'].extend(opt_shared_libs)\n return info\n\n\nclass fftw_info(system_info):\n section = 'fftw'\n\n def __init__(self):\n system_info.__init__(self)\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n incl_dirs = self.get_include_dirs()\n incl_dir = None\n\n libs = self.get_libs('fftw_libs', ['fftw','rfftw'])\n opt_libs = self.get_libs('fftw_opt_libs',\n ['fftw_threads','rfftw_threads'])\n info = None\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['fftw.h','rfftw.h']))==2:\n dict_append(info,include_dirs=[d])\n flag = 1\n incl_dirs = [d]\n incl_dir = d\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_FFTW_H',1)])\n else:\n info = None\n\n if info is None:\n libs = self.get_libs('dfftw_libs', ['dfftw', 'drfftw'])\n opt_libs = self.get_libs('dfftw_opt_libs',\n ['dfftw_threads', 'drfftw_threads'])\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['dfftw.h','drfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n incl_dirs = [d]\n incl_dir = d\n flag = 1\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_DFFTW_H',1)])\n else:\n info = None\n\n libs = self.get_libs('sfftw_libs', ['sfftw', 'srfftw'])\n opt_libs = self.get_libs('sfftw_opt_libs',\n ['sfftw_threads', 'srfftw_threads'])\n flag = 0\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n if info is None: info = r\n else: dict_append(info,**r)\n flag = 1\n break\n if info is not None and flag:\n for d in incl_dirs:\n if len(combine_paths(d,['sfftw.h','srfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n dict_append(info,define_macros=[('SCIPY_SFFTW_H',1)])\n break\n if info is not None:\n self.set_info(**info)\n\n\nclass atlas_info(system_info):\n section = 'atlas'\n\n def get_paths(self, section, key):\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs = []\n for d in self.cp.get(section, key).split(os.pathsep) + default_dirs:\n dirs.extend([d]+combine_paths(d,['atlas*','ATLAS*']))\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n\n h = (combine_paths(lib_dirs+include_dirs,'cblas.h') or [None])[0]\n if h: h = os.path.dirname(h)\n info = None\n # lapack must appear before atlas\n lapack_libs = self.get_libs('lapack_libs', ['lapack'])\n for d in lib_dirs:\n lapack = self.check_libs(d,lapack_libs,[])\n if lapack is not None:\n info = lapack \n break\n else:\n return\n atlas_libs = self.get_libs('atlas_libs', ['f77blas', 'cblas', 'atlas'])\n for d in lib_dirs:\n atlas = self.check_libs(d,atlas_libs,[])\n if atlas is not None:\n dict_append(info, **atlas)\n break\n else:\n return\n\n if h: dict_append(info,include_dirs=[h])\n self.set_info(**info)\n\n## class blas_info(system_info):\n## # For Fortran or optimized blas, not atlas.\n## pass\n\n\n## class lapack_info(system_info):\n## # For Fortran or optimized lapack, not atlas\n## pass\n\n\nclass x11_info(system_info):\n section = 'x11'\n\n def __init__(self):\n system_info.__init__(self,\n default_lib_dirs=default_x11_lib_dirs,\n default_include_dirs=default_x11_include_dirs)\n\n def calc_info(self):\n if sys.platform == 'win32':\n return\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n x11_libs = self.get_libs('x11_libs', ['X11'])\n for lib_dir in lib_dirs:\n info = self.check_libs(lib_dir, x11_libs, [])\n if info is not None:\n break\n else:\n return\n inc_dir = None\n for d in include_dirs:\n if combine_paths(d, 'X11/X.h'):\n inc_dir = d\n break\n if inc_dir is not None:\n dict_append(info, include_dirs=[inc_dir])\n self.set_info(**info)\n\ndef shortest_path(pths):\n pths.sort()\n if pths: return pths[0]\n\ndef combine_paths(*args):\n \"\"\" Return a list of existing paths composed by all combinations of\n items from arguments.\n \"\"\"\n r = []\n for a in args:\n if not a: continue\n if type(a) is types.StringType:\n a = [a]\n r.append(a)\n args = r\n if not args: return []\n if len(args)==1:\n result = reduce(lambda a,b:a+b,map(glob,args[0]),[])\n elif len (args)==2:\n result = []\n for a0 in args[0]:\n for a1 in args[1]:\n result.extend(glob(os.path.join(a0,a1)))\n else:\n result = combine_paths(*(combine_paths(args[0],args[1])+args[2:]))\n return result\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 show_all():\n import system_info\n import pprint\n match_info = re.compile(r'.*?_info').match\n for n in filter(match_info,dir(system_info)):\n if n in ['system_info','get_info']: continue\n c = getattr(system_info,n)()\n r = c.get_info()\n\nif __name__ == \"__main__\":\n show_all()\n", + "source_code_before": "#!/usr/bin/env python\n\"\"\"\nThis file defines a set of system_info classes for getting\ninformation about various resources (libraries, library directories,\ninclude directories, etc.) in the system. Currently, the following\nclasses are available:\n atlas_info\n fftw_info\n x11_info\n\nUsage:\n info_dict = get_info()\n where is a string 'atlas','x11','fftw'.\n\n Returned info_dict is a dictionary which is compatible with\n distutils.setup keyword arguments. If info_dict == {}, then the\n asked resource is not available (or system_info could not find it).\n\nGlobal parameters:\n system_info.static_first - a flag for indicating that static\n libraries are searched first than shared ones.\n system_info.verbose - show the results if set.\n\nThe file 'site.cfg' in the same directory as this module is read\nfor configuration options. The format is that used by ConfigParser (i.e.,\nWindows .INI style). The section DEFAULT has options that are the default\nfor each section. The available sections are fftw, atlas, and x11. Appropiate\ndefaults are used if nothing is specified.\n\nExample:\n----------\n[DEFAULT]\nlib_dir = /usr/lib:/usr/local/lib:/opt/lib\ninclude_dir = /usr/include:/usr/local/include:/opt/include\n# use static libraries in preference to shared ones\nstatic_first = 1\n\n[fftw]\nfftw_libs = fftw, rfftw\nfftw_opt_libs = fftw_threaded, rfftw_threaded\n# if the above aren't found, look for {s,d}fftw_libs and {s,d}fftw_opt_libs\n\n[atlas]\nlib_dir = /usr/lib/3dnow:/usr/lib/3dnow/atlas\n# for overriding the names of the atlas libraries\natlas_libs = f77blas, cblas, atlas\nlapack_libs = lapack\n\n[x11]\nlib_dir = /usr/X11R6/lib\ninclude_dir = /usr/X11R6/include\n----------\n\nAuthors:\n Pearu Peterson , February 2002\n David M. Cooke , April 2002\nPermission to use, modify, and distribute this software is given under the\nterms of the LGPL. See http://www.fsf.org\nNO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\"\"\"\n\nimport sys,os,re,types\nfrom distutils.errors import DistutilsError\nfrom glob import glob\nimport ConfigParser\n\nfrom distutils.sysconfig import get_config_vars\n\nif sys.platform == 'win32':\n default_lib_dirs = ['C:\\\\'] # probably not very helpful...\n default_include_dirs = []\n default_x11_lib_dirs = []\n default_x11_include_dirs = []\nelse:\n default_lib_dirs = ['/usr/local/lib', '/opt/lib', '/usr/lib']\n default_include_dirs = ['/usr/local/include',\n '/opt/include', '/usr/include']\n default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib']\n default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include']\n\nif os.path.join(sys.prefix, 'lib') not in default_lib_dirs:\n default_lib_dirs.append(os.path.join(sys.prefix, 'lib'))\n default_include_dirs.append(os.path.join(sys.prefix, 'include'))\ndefault_lib_dirs = filter(os.path.isdir, default_lib_dirs)\ndefault_include_dirs = filter(os.path.isdir, default_include_dirs)\n\nso_ext = get_config_vars('SO')[0] or ''\n\ndef get_info(name):\n cl = {'atlas':atlas_info,\n 'x11':x11_info,\n 'fftw':fftw_info}.get(name.lower(),system_info)\n return cl().get_info()\n\nclass NotFoundError(DistutilsError):\n \"\"\"Some third-party program or library is not found.\"\"\"\n\nclass AtlasNotFoundError(NotFoundError):\n \"\"\"\n Atlas (http://math-atlas.sourceforge.net/) libraries not found.\n Either install them in /usr/local/lib/atlas or /usr/lib/atlas\n and retry setup.py. One can use also ATLAS environment variable\n to indicate the location of Atlas libraries.\"\"\"\n\nclass FFTWNotFoundError(NotFoundError):\n \"\"\"\n FFTW (http://www.fftw.org/) libraries not found.\n Either install them in /usr/local/lib or /usr/lib and retry setup.py.\n One can use also FFTW environment variable to indicate\n the location of FFTW libraries.\"\"\"\n\nclass F2pyNotFoundError(NotFoundError):\n \"\"\"\n f2py2e (http://cens.ioc.ee/projects/f2py2e/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass NumericNotFoundError(NotFoundError):\n \"\"\"\n Numeric (http://pfdubois.com/numpy/) module not found.\n Get it from above location, install it, and retry setup.py.\"\"\"\n\nclass X11NotFoundError(NotFoundError):\n \"\"\"X11 libraries not found.\"\"\"\n\nclass system_info:\n\n \"\"\" get_info() is the only public method. Don't use others.\n \"\"\"\n section = 'DEFAULT'\n\n static_first = 1\n verbose = 1\n need_refresh = 1\n saved_results = {}\n\n def __init__ (self,\n default_lib_dirs=default_lib_dirs,\n default_include_dirs=default_include_dirs,\n ):\n self.__class__.info = {}\n #self.__class__.need_refresh = not self.info\n self.local_prefixes = []\n defaults = {}\n defaults['lib_dir'] = os.pathsep.join(default_lib_dirs)\n defaults['include_dir'] = os.pathsep.join(default_include_dirs)\n defaults['static_first'] = '1'\n self.cp = ConfigParser.ConfigParser(defaults)\n cf = os.path.join(os.path.split(os.path.abspath(__file__))[0],\n 'site.cfg')\n self.cp.read([cf])\n if not self.cp.has_section(self.section):\n self.cp.add_section(self.section)\n self.static_first = self.cp.getboolean(self.section, 'static_first')\n\n def set_info(self,**info):\n #self.__class__.info = info\n self.saved_results[self.__class__.__name__] = info\n def has_info(self):\n return self.saved_results.has_key(self.__class__.__name__)\n def get_info(self):\n \"\"\" Return a dictonary with items that are compatible\n with scipy_distutils.setup keyword arguments.\n \"\"\"\n flag = 0\n if not self.has_info():\n flag = 1\n if self.verbose:\n print self.__class__.__name__ + ':'\n if hasattr(self, 'calc_info'):\n self.calc_info()\n if self.verbose:\n if not self.has_info():\n print ' NOT AVAILABLE'\n self.set_info()\n else:\n print ' FOUND:'\n res = self.saved_results.get(self.__class__.__name__)\n if self.verbose and flag:\n for k,v in res.items():\n print ' %s = %s'%(k,v)\n print\n return res\n\n def calc_info_template(self,prefix):\n \"\"\" Calculate info dictionary. \"\"\"\n\n def get_paths(self, section, key):\n dirs = self.cp.get(section, key).split(os.pathsep)\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs.extend(default_dirs)\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def get_lib_dirs(self, key='lib_dir'):\n return self.get_paths(self.section, key)\n def get_include_dirs(self, key='include_dir'):\n return self.get_paths(self.section, key)\n\n def get_libs(self, key, default):\n try:\n libs = self.cp.get(self.section, key)\n except ConfigParser.NoOptionError:\n return default\n return [a.strip() for a in libs.split(',')]\n\n def check_libs(self,lib_dir,libs,opt_libs =[]):\n \"\"\" If static or shared libraries are available then return\n their info dictionary. \"\"\"\n mths = [self.check_static_libs,self.check_shared_libs]\n if not self.static_first:\n mths.reverse() # if one prefers shared libraries\n for m in mths:\n info = m(lib_dir,libs,opt_libs)\n if info is not None: return info\n\n def check_static_libs(self,lib_dir,libs,opt_libs =[]):\n #XXX: what are .lib and .dll files under win32?\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs])) == len(libs):\n info = {'libraries':libs,'library_dirs':[lib_dir]}\n if len(combine_paths(lib_dir,['lib'+l+'.a' for l in libs]))\\\n ==len(opt_libs):\n info['libraries'].extend(opt_libs)\n return info\n\n def check_shared_libs(self,lib_dir,libs,opt_libs =[]):\n shared_libs = []\n for l in libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: shared_libs.append(p)\n if len(shared_libs) == len(libs):\n info = {'extra_objects':shared_libs}\n opt_shared_libs = []\n for l in opt_libs:\n p = shortest_path(combine_paths(lib_dir,'lib'+l+so_ext+'*'))\n if p is not None: opt_shared_libs.append(p)\n info['extra_objects'].extend(opt_shared_libs)\n return info\n\n\nclass fftw_info(system_info):\n section = 'fftw'\n\n def __init__(self):\n system_info.__init__(self)\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n incl_dirs = self.get_include_dirs()\n incl_dir = None\n\n libs = self.get_libs('fftw_libs', ['fftw','rfftw'])\n opt_libs = self.get_libs('fftw_opt_libs',\n ['fftw_threads','rfftw_threads'])\n info = None\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['fftw.h','rfftw.h']))==2:\n dict_append(info,include_dirs=[d])\n flag = 1\n incl_dirs = [d]\n incl_dir = d\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_FFTW_H',1)])\n else:\n info = None\n\n if info is None:\n libs = self.get_libs('dfftw_libs', ['dfftw', 'drfftw'])\n opt_libs = self.get_libs('dfftw_opt_libs',\n ['dfftw_threads', 'drfftw_threads'])\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n info = r\n break\n if info is not None:\n flag = 0\n for d in incl_dirs:\n if len(combine_paths(d,['dfftw.h','drfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n incl_dirs = [d]\n incl_dir = d\n flag = 1\n break\n if flag:\n dict_append(info,define_macros=[('SCIPY_DFFTW_H',1)])\n else:\n info = None\n\n libs = self.get_libs('sfftw_libs', ['sfftw', 'srfftw'])\n opt_libs = self.get_libs('sfftw_opt_libs',\n ['sfftw_threads', 'srfftw_threads'])\n flag = 0\n for d in lib_dirs:\n r = self.check_libs(d,libs,opt_libs)\n if r is not None:\n if info is None: info = r\n else: dict_append(info,**r)\n flag = 1\n break\n if info is not None and flag:\n for d in incl_dirs:\n if len(combine_paths(d,['sfftw.h','srfftw.h']))==2:\n if incl_dir is None:\n dict_append(info,include_dirs=[d])\n dict_append(info,define_macros=[('SCIPY_SFFTW_H',1)])\n break\n if info is not None:\n self.set_info(**info)\n\n\nclass atlas_info(system_info):\n section = 'atlas'\n\n def get_paths(self, section, key):\n default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)\n dirs = []\n for d in self.cp.get(section, key).split(os.pathsep) + default_dirs:\n dirs.extend([d]+combine_paths(d,['atlas*','ATLAS*']))\n return [ d for d in dirs if os.path.isdir(d) ]\n\n def calc_info(self):\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n\n h = (combine_paths(lib_dirs+include_dirs,'cblas.h') or [None])[0]\n if h: h = os.path.dirname(h)\n info = None\n # lapack must appear before atlas\n lapack_libs = self.get_libs('lapack_libs', ['lapack'])\n for d in lib_dirs:\n lapack = self.check_libs(d,lapack_libs,[])\n if lapack is not None:\n info = lapack \n break\n else:\n return\n atlas_libs = self.get_libs('atlas_libs', ['f77blas', 'cblas', 'atlas'])\n for d in lib_dirs:\n atlas = self.check_libs(d,atlas_libs,[])\n if atlas is not None:\n dict_append(info, **atlas)\n break\n else:\n return\n\n if h: dict_append(info,include_dirs=[h])\n self.set_info(**info)\n\n## class blas_info(system_info):\n## # For Fortran or optimized blas, not atlas.\n## pass\n\n\n## class lapack_info(system_info):\n## # For Fortran or optimized lapack, not atlas\n## pass\n\n\nclass x11_info(system_info):\n section = 'x11'\n\n def __init__(self):\n system_info.__init__(self,\n default_lib_dirs=default_x11_lib_dirs,\n default_include_dirs=default_x11_include_dirs)\n\n def calc_info(self):\n if sys.platform == 'win32':\n return\n lib_dirs = self.get_lib_dirs()\n include_dirs = self.get_include_dirs()\n x11_libs = self.get_libs('x11_libs', ['X11'])\n for lib_dir in lib_dirs:\n info = self.check_libs(lib_dir, x11_libs, [])\n if info is not None:\n break\n else:\n return\n inc_dir = None\n for d in include_dirs:\n if combine_paths(d, 'X11/X.h'):\n inc_dir = d\n break\n if inc_dir is not None:\n dict_append(info, include_dirs=[inc_dir])\n self.set_info(**info)\n\ndef shortest_path(pths):\n pths.sort()\n if pths: return pths[0]\n\ndef combine_paths(*args):\n \"\"\" Return a list of existing paths composed by all combinations of\n items from arguments.\n \"\"\"\n r = []\n for a in args:\n if not a: continue\n if type(a) is types.StringType:\n a = [a]\n r.append(a)\n args = r\n if not args: return []\n if len(args)==1:\n result = reduce(lambda a,b:a+b,map(glob,args[0]),[])\n elif len (args)==2:\n result = []\n for a0 in args[0]:\n for a1 in args[1]:\n result.extend(glob(os.path.join(a0,a1)))\n else:\n result = combine_paths(*(combine_paths(args[0],args[1])+args[2:]))\n return result\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 show_all():\n import system_info\n import pprint\n match_info = re.compile(r'.*?_info').match\n for n in filter(match_info,dir(system_info)):\n if n in ['system_info','get_info']: continue\n c = getattr(system_info,n)()\n r = c.get_info()\n\nif __name__ == \"__main__\":\n show_all()\n", + "methods": [ + { + "name": "get_info", + "long_name": "get_info( name )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "name" + ], + "start_line": 89, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 152, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 17, + "top_nesting_level": 1 + }, + { + "name": "set_info", + "long_name": "set_info( self , ** info )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "info" + ], + "start_line": 154, + "end_line": 155, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "has_info", + "long_name": "has_info( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 156, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_info", + "long_name": "get_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 9, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 180, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "calc_info_template", + "long_name": "calc_info_template( self , prefix )", + "filename": "system_info.py", + "nloc": 1, + "complexity": 1, + "token_count": 8, + "parameters": [ + "self", + "prefix" + ], + "start_line": 182, + "end_line": 183, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 70, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 185, + "end_line": 189, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_lib_dirs", + "long_name": "get_lib_dirs( self , key = 'lib_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 191, + "end_line": 192, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_include_dirs", + "long_name": "get_include_dirs( self , key = 'include_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 193, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_libs", + "long_name": "get_libs( self , key , default )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self", + "key", + "default" + ], + "start_line": 196, + "end_line": 201, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_libs", + "long_name": "check_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 4, + "token_count": 60, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 203, + "end_line": 211, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_static_libs", + "long_name": "check_static_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 5, + "token_count": 91, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 213, + "end_line": 220, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_shared_libs", + "long_name": "check_shared_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 13, + "complexity": 6, + "token_count": 119, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 222, + "end_line": 234, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 240, + "end_line": 241, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 69, + "complexity": 24, + "token_count": 443, + "parameters": [ + "self" + ], + "start_line": 243, + "end_line": 314, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 4, + "token_count": 91, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 320, + "end_line": 325, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 24, + "complexity": 8, + "token_count": 168, + "parameters": [ + "self" + ], + "start_line": 327, + "end_line": 353, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 368, + "end_line": 371, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 7, + "token_count": 110, + "parameters": [ + "self" + ], + "start_line": 373, + "end_line": 392, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "shortest_path", + "long_name": "shortest_path( pths )", + "filename": "system_info.py", + "nloc": 3, + "complexity": 2, + "token_count": 18, + "parameters": [ + "pths" + ], + "start_line": 394, + "end_line": 396, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "combine_paths", + "long_name": "combine_paths( * args )", + "filename": "system_info.py", + "nloc": 19, + "complexity": 9, + "token_count": 162, + "parameters": [ + "args" + ], + "start_line": 398, + "end_line": 419, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 421, + "end_line": 426, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "show_all", + "long_name": "show_all( )", + "filename": "system_info.py", + "nloc": 8, + "complexity": 3, + "token_count": 59, + "parameters": [], + "start_line": 428, + "end_line": 435, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "methods_before": [ + { + "name": "get_info", + "long_name": "get_info( name )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 1, + "token_count": 39, + "parameters": [ + "name" + ], + "start_line": 89, + "end_line": 93, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 0 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + }, + { + "name": "set_info", + "long_name": "set_info( self , ** info )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "info" + ], + "start_line": 155, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "has_info", + "long_name": "has_info( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 18, + "parameters": [ + "self" + ], + "start_line": 158, + "end_line": 159, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_info", + "long_name": "get_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 9, + "token_count": 113, + "parameters": [ + "self" + ], + "start_line": 160, + "end_line": 182, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 23, + "top_nesting_level": 1 + }, + { + "name": "calc_info_template", + "long_name": "calc_info_template( self , prefix )", + "filename": "system_info.py", + "nloc": 1, + "complexity": 1, + "token_count": 8, + "parameters": [ + "self", + "prefix" + ], + "start_line": 184, + "end_line": 185, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 5, + "complexity": 3, + "token_count": 70, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 187, + "end_line": 191, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 5, + "top_nesting_level": 1 + }, + { + "name": "get_lib_dirs", + "long_name": "get_lib_dirs( self , key = 'lib_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 193, + "end_line": 194, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_include_dirs", + "long_name": "get_include_dirs( self , key = 'include_dir' )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "key" + ], + "start_line": 195, + "end_line": 196, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "get_libs", + "long_name": "get_libs( self , key , default )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 49, + "parameters": [ + "self", + "key", + "default" + ], + "start_line": 198, + "end_line": 203, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "check_libs", + "long_name": "check_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 4, + "token_count": 60, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 205, + "end_line": 213, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 9, + "top_nesting_level": 1 + }, + { + "name": "check_static_libs", + "long_name": "check_static_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 7, + "complexity": 5, + "token_count": 91, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 215, + "end_line": 222, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 1 + }, + { + "name": "check_shared_libs", + "long_name": "check_shared_libs( self , lib_dir , libs , opt_libs = [ ] )", + "filename": "system_info.py", + "nloc": 13, + "complexity": 6, + "token_count": 119, + "parameters": [ + "self", + "lib_dir", + "libs", + "opt_libs" + ], + "start_line": 224, + "end_line": 236, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 13, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 11, + "parameters": [ + "self" + ], + "start_line": 242, + "end_line": 243, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 2, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 69, + "complexity": 24, + "token_count": 443, + "parameters": [ + "self" + ], + "start_line": 245, + "end_line": 316, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 72, + "top_nesting_level": 1 + }, + { + "name": "get_paths", + "long_name": "get_paths( self , section , key )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 4, + "token_count": 91, + "parameters": [ + "self", + "section", + "key" + ], + "start_line": 322, + "end_line": 327, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 24, + "complexity": 8, + "token_count": 168, + "parameters": [ + "self" + ], + "start_line": 329, + "end_line": 355, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 27, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self )", + "filename": "system_info.py", + "nloc": 4, + "complexity": 1, + "token_count": 19, + "parameters": [ + "self" + ], + "start_line": 370, + "end_line": 373, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 4, + "top_nesting_level": 1 + }, + { + "name": "calc_info", + "long_name": "calc_info( self )", + "filename": "system_info.py", + "nloc": 20, + "complexity": 7, + "token_count": 110, + "parameters": [ + "self" + ], + "start_line": 375, + "end_line": 394, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 20, + "top_nesting_level": 1 + }, + { + "name": "shortest_path", + "long_name": "shortest_path( pths )", + "filename": "system_info.py", + "nloc": 3, + "complexity": 2, + "token_count": 18, + "parameters": [ + "pths" + ], + "start_line": 396, + "end_line": 398, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 0 + }, + { + "name": "combine_paths", + "long_name": "combine_paths( * args )", + "filename": "system_info.py", + "nloc": 19, + "complexity": 9, + "token_count": 162, + "parameters": [ + "args" + ], + "start_line": 400, + "end_line": 421, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 22, + "top_nesting_level": 0 + }, + { + "name": "dict_append", + "long_name": "dict_append( d , ** kws )", + "filename": "system_info.py", + "nloc": 6, + "complexity": 3, + "token_count": 44, + "parameters": [ + "d", + "kws" + ], + "start_line": 423, + "end_line": 428, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 6, + "top_nesting_level": 0 + }, + { + "name": "show_all", + "long_name": "show_all( )", + "filename": "system_info.py", + "nloc": 8, + "complexity": 3, + "token_count": 59, + "parameters": [], + "start_line": 430, + "end_line": 437, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 8, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "set_info", + "long_name": "set_info( self , ** info )", + "filename": "system_info.py", + "nloc": 2, + "complexity": 1, + "token_count": 20, + "parameters": [ + "self", + "info" + ], + "start_line": 155, + "end_line": 157, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 3, + "top_nesting_level": 1 + }, + { + "name": "__init__", + "long_name": "__init__( self , default_lib_dirs = default_lib_dirs , default_include_dirs = default_include_dirs , )", + "filename": "system_info.py", + "nloc": 17, + "complexity": 2, + "token_count": 152, + "parameters": [ + "self", + "default_lib_dirs", + "default_include_dirs" + ], + "start_line": 136, + "end_line": 153, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 18, + "top_nesting_level": 1 + } + ], + "nloc": 371, + "complexity": 100, + "token_count": 2195, + "diff_parsed": { + "added": [ + " Numeric (http://www.numpy.org/) module not found." + ], + "deleted": [ + " Numeric (http://pfdubois.com/numpy/) module not found.", + " #self.__class__.need_refresh = not self.info", + " #self.__class__.info = info" + ] + } + }, + { + "old_path": "scipy_distutils/x11_info.py", + "new_path": null, + "filename": "x11_info.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,41 +0,0 @@\n-\n-import sys, os, glob\n-\n-def get_x11_info():\n- if sys.platform == 'win32':\n- return {}\n-\n- #XXX: add other combinations if needed\n- libs = ['X11']\n- prefixes = ['/usr','/usr/local','/opt']\n- x11_names = ['X11R6','X11']\n- header_files = ['X.h','X11/X.h']\n-\n- x11_lib,x11_lib_dir,x11_inc_dir = None,None,None\n- for p in prefixes:\n- for n in x11_names:\n- d = os.path.join(p,n)\n- if not os.path.exists(d): continue\n- if x11_lib is None:\n- # Find library and its location\n- for l in libs:\n- if glob.glob(os.path.join(d,'lib','lib%s.*' % l)):\n- x11_lib = l\n- x11_lib_dir = os.path.join(d,'lib')\n- break\n- if x11_inc_dir is None:\n- # Find the location of header file\n- for h in header_files:\n- if os.path.exists(os.path.join(d,'include',h)):\n- x11_inc_dir = os.path.join(d,'include')\n- break\n- if None not in [x11_lib,x11_inc_dir]:\n- break\n- if None in [x11_lib,x11_inc_dir]:\n- return {}\n- info = {}\n- info['libraries'] = [x11_lib]\n- info['library_dirs'] = [x11_lib_dir]\n- info['include_dirs'] = [x11_inc_dir]\n- return info\n-\n", + "added_lines": 0, + "deleted_lines": 41, + "source_code": null, + "source_code_before": "\nimport sys, os, glob\n\ndef get_x11_info():\n if sys.platform == 'win32':\n return {}\n\n #XXX: add other combinations if needed\n libs = ['X11']\n prefixes = ['/usr','/usr/local','/opt']\n x11_names = ['X11R6','X11']\n header_files = ['X.h','X11/X.h']\n\n x11_lib,x11_lib_dir,x11_inc_dir = None,None,None\n for p in prefixes:\n for n in x11_names:\n d = os.path.join(p,n)\n if not os.path.exists(d): continue\n if x11_lib is None:\n # Find library and its location\n for l in libs:\n if glob.glob(os.path.join(d,'lib','lib%s.*' % l)):\n x11_lib = l\n x11_lib_dir = os.path.join(d,'lib')\n break\n if x11_inc_dir is None:\n # Find the location of header file\n for h in header_files:\n if os.path.exists(os.path.join(d,'include',h)):\n x11_inc_dir = os.path.join(d,'include')\n break\n if None not in [x11_lib,x11_inc_dir]:\n break\n if None in [x11_lib,x11_inc_dir]:\n return {}\n info = {}\n info['libraries'] = [x11_lib]\n info['library_dirs'] = [x11_lib_dir]\n info['include_dirs'] = [x11_inc_dir]\n return info\n\n", + "methods": [], + "methods_before": [ + { + "name": "get_x11_info", + "long_name": "get_x11_info( )", + "filename": "x11_info.py", + "nloc": 32, + "complexity": 13, + "token_count": 231, + "parameters": [], + "start_line": 4, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_x11_info", + "long_name": "get_x11_info( )", + "filename": "x11_info.py", + "nloc": 32, + "complexity": 13, + "token_count": 231, + "parameters": [], + "start_line": 4, + "end_line": 40, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 37, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "", + "import sys, os, glob", + "", + "def get_x11_info():", + " if sys.platform == 'win32':", + " return {}", + "", + " #XXX: add other combinations if needed", + " libs = ['X11']", + " prefixes = ['/usr','/usr/local','/opt']", + " x11_names = ['X11R6','X11']", + " header_files = ['X.h','X11/X.h']", + "", + " x11_lib,x11_lib_dir,x11_inc_dir = None,None,None", + " for p in prefixes:", + " for n in x11_names:", + " d = os.path.join(p,n)", + " if not os.path.exists(d): continue", + " if x11_lib is None:", + " # Find library and its location", + " for l in libs:", + " if glob.glob(os.path.join(d,'lib','lib%s.*' % l)):", + " x11_lib = l", + " x11_lib_dir = os.path.join(d,'lib')", + " break", + " if x11_inc_dir is None:", + " # Find the location of header file", + " for h in header_files:", + " if os.path.exists(os.path.join(d,'include',h)):", + " x11_inc_dir = os.path.join(d,'include')", + " break", + " if None not in [x11_lib,x11_inc_dir]:", + " break", + " if None in [x11_lib,x11_inc_dir]:", + " return {}", + " info = {}", + " info['libraries'] = [x11_lib]", + " info['library_dirs'] = [x11_lib_dir]", + " info['include_dirs'] = [x11_inc_dir]", + " return info", + "" + ] + } + } + ] + }, + { + "hash": "d7c565a17f40072c37ac746e46fae0e9d493731d", + "msg": "Removing obsolete hooks", + "author": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "committer": { + "name": "Pearu Peterson", + "email": "pearu.peterson@gmail.com" + }, + "author_date": "2002-04-07T15:09:48+00:00", + "author_timezone": 0, + "committer_date": "2002-04-07T15:09:48+00:00", + "committer_timezone": 0, + "branches": [ + "main" + ], + "in_main_branch": true, + "merge": false, + "parents": [ + "8a040fa109cca999a40726422eadbd18a7310a89" + ], + "project_name": "repo_copy", + "project_path": "/tmp/tmpie985msg/repo_copy", + "deletions": 18, + "insertions": 0, + "lines": 18, + "files": 1, + "dmm_unit_size": 0.0, + "dmm_unit_complexity": 0.0, + "dmm_unit_interfacing": 0.0, + "modified_files": [ + { + "old_path": "scipy_distutils/fftw_info.py", + "new_path": null, + "filename": "fftw_info.py", + "extension": "py", + "change_type": "DELETE", + "diff": "@@ -1,18 +0,0 @@\n-import os\n-\n-def get_fftw_info():\n- # FFTW (requires FFTW libraries to be previously installed)\n- double_libraries = ['fftw_threads','rfftw_threads','fftw','rfftw']\n- float_libraries = map(lambda x: 's'+x,double_libraries)\n-\n- if os.name == 'nt':\n- fftw_dirs = ['c:\\\\fftw']\n- else:\n- base_dir = os.environ.get('FFTW')\n- if base_dir is None:\n- base_dir = os.environ['HOME']\n- fftw_dirs = [os.path.join(base_dir,'lib')]\n- double_libraries += ['pthread']\n- float_libraries += ['pthread']\n-\n- return float_libraries, double_libraries, fftw_dirs\n", + "added_lines": 0, + "deleted_lines": 18, + "source_code": null, + "source_code_before": "import os\n\ndef get_fftw_info():\n # FFTW (requires FFTW libraries to be previously installed)\n double_libraries = ['fftw_threads','rfftw_threads','fftw','rfftw']\n float_libraries = map(lambda x: 's'+x,double_libraries)\n\n if os.name == 'nt':\n fftw_dirs = ['c:\\\\fftw']\n else:\n base_dir = os.environ.get('FFTW')\n if base_dir is None:\n base_dir = os.environ['HOME']\n fftw_dirs = [os.path.join(base_dir,'lib')]\n double_libraries += ['pthread']\n float_libraries += ['pthread']\n\n return float_libraries, double_libraries, fftw_dirs\n", + "methods": [], + "methods_before": [ + { + "name": "get_fftw_info", + "long_name": "get_fftw_info( )", + "filename": "fftw_info.py", + "nloc": 13, + "complexity": 3, + "token_count": 95, + "parameters": [], + "start_line": 3, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + } + ], + "changed_methods": [ + { + "name": "get_fftw_info", + "long_name": "get_fftw_info( )", + "filename": "fftw_info.py", + "nloc": 13, + "complexity": 3, + "token_count": 95, + "parameters": [], + "start_line": 3, + "end_line": 18, + "fan_in": 0, + "fan_out": 0, + "general_fan_out": 0, + "length": 16, + "top_nesting_level": 0 + } + ], + "nloc": null, + "complexity": null, + "token_count": null, + "diff_parsed": { + "added": [], + "deleted": [ + "import os", + "", + "def get_fftw_info():", + " # FFTW (requires FFTW libraries to be previously installed)", + " double_libraries = ['fftw_threads','rfftw_threads','fftw','rfftw']", + " float_libraries = map(lambda x: 's'+x,double_libraries)", + "", + " if os.name == 'nt':", + " fftw_dirs = ['c:\\\\fftw']", + " else:", + " base_dir = os.environ.get('FFTW')", + " if base_dir is None:", + " base_dir = os.environ['HOME']", + " fftw_dirs = [os.path.join(base_dir,'lib')]", + " double_libraries += ['pthread']", + " float_libraries += ['pthread']", + "", + " return float_libraries, double_libraries, fftw_dirs" + ] + } + } + ] + } +] \ No newline at end of file