gurudesh/pytracebugs huggingface dataset:
# Buggy code
def _create_empty_module(self, name):
    ir_module = lc.Module(name)
    ir_module.triple = CUDA_TRIPLE[utils.MACHINE_BITS]
    if self._data_layout:
        ir_module.data_layout = self._data_layout
    return ir_module


# Traceback (numba.cuda.cudadrv.error.NvvmError)
Traceback (most recent call last):
File "repro.py", line 6, in <module>
cuda.compile_ptx_for_current_device(f, [], device=True, debug=True)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 124, in compile_ptx_for_current_device
return compile_ptx(pyfunc, args, debug=-debug, device=device,
File "/home/gmarkall/numbadev/numba/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 114, in compile_ptx
ptx = nvvm.llvm_to_ptx(llvmir, opt=opt, arch=arch, **options)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 669, in llvm_to_ptx
ptx = cu.compile(**opts)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 265, in compile
self._try_error(err, 'Failed to compile\n')
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 283, in _try_error
self.driver.check_error(err, "%s\n%s" % (msg, self.get_log()))
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 173, in check_error
raise exc
numba.cuda.cudadrv.error.NvvmError: Failed to compile

DBG version 1.0 incompatible with current version 3.0
<unnamed>: error: incompatible IR detected. Possible mix of compiler/IR from different releases.
NVVM_ERROR_IR_VERSION_MISMATCH

# Fixed code
def _create_empty_module(self, name):
    ir_module = lc.Module(name)
    ir_module.triple = CUDA_TRIPLE[utils.MACHINE_BITS]
    if self._data_layout:
        ir_module.data_layout = self._data_layout
    nvvm.add_ir_version(ir_module)
    return ir_module
# Buggy code
def compile_cuda(pyfunc, return_type, args, debug=False, inline=False):
    # First compilation will trigger the initialization of the CUDA backend.
    from .descriptor import CUDATargetDesc

    typingctx = CUDATargetDesc.typingctx
    targetctx = CUDATargetDesc.targetctx
    # TODO handle debug flag
    flags = compiler.Flags()
    # Do not compile (generate native code), just lower (to LLVM)
    flags.set("no_compile")
    flags.set("no_cpython_wrapper")
    flags.set("no_cfunc_wrapper")
    if debug:
        flags.set("debuginfo")
    if inline:
        flags.set("forceinline")
    # Run compilation pipeline
    cres = compiler.compile_extra(
        typingctx=typingctx,
        targetctx=targetctx,
        func=pyfunc,
        args=args,
        return_type=return_type,
        flags=flags,
        locals={},
    )

    library = cres.library
    library.finalize()

    return cres


# Traceback (numba.cuda.cudadrv.error.NvvmError)
Traceback (most recent call last):
File "repro.py", line 6, in <module>
cuda.compile_ptx_for_current_device(f, [], device=True, debug=True)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 124, in compile_ptx_for_current_device
return compile_ptx(pyfunc, args, debug=-debug, device=device,
File "/home/gmarkall/numbadev/numba/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 114, in compile_ptx
ptx = nvvm.llvm_to_ptx(llvmir, opt=opt, arch=arch, **options)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 669, in llvm_to_ptx
ptx = cu.compile(**opts)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 265, in compile
self._try_error(err, 'Failed to compile\n')
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 283, in _try_error
self.driver.check_error(err, "%s\n%s" % (msg, self.get_log()))
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 173, in check_error
raise exc
numba.cuda.cudadrv.error.NvvmError: Failed to compile

DBG version 1.0 incompatible with current version 3.0
<unnamed>: error: incompatible IR detected. Possible mix of compiler/IR from different releases.
NVVM_ERROR_IR_VERSION_MISMATCH

# Fixed code
def compile_cuda(pyfunc, return_type, args, debug=False, inline=False):
    from .descriptor import cuda_target

    typingctx = cuda_target.typingctx
    targetctx = cuda_target.targetctx

    flags = compiler.Flags()
    # Do not compile (generate native code), just lower (to LLVM)
    flags.set("no_compile")
    flags.set("no_cpython_wrapper")
    flags.set("no_cfunc_wrapper")
    if debug:
        flags.set("debuginfo")
    if inline:
        flags.set("forceinline")
    # Run compilation pipeline
    cres = compiler.compile_extra(
        typingctx=typingctx,
        targetctx=targetctx,
        func=pyfunc,
        args=args,
        return_type=return_type,
        flags=flags,
        locals={},
    )

    library = cres.library
    library.finalize()

    return cres
# Buggy code
def declare_device_function(name, restype, argtypes):
    from .descriptor import CUDATargetDesc

    typingctx = CUDATargetDesc.typingctx
    targetctx = CUDATargetDesc.targetctx
    sig = typing.signature(restype, *argtypes)
    extfn = ExternFunction(name, sig)

    class device_function_template(ConcreteTemplate):
        key = extfn
        cases = [sig]

    fndesc = funcdesc.ExternalFunctionDescriptor(
        name=name, restype=restype, argtypes=argtypes
    )
    typingctx.insert_user_function(extfn, device_function_template)
    targetctx.insert_user_function(extfn, fndesc)
    return extfn


# Traceback (numba.cuda.cudadrv.error.NvvmError)
Traceback (most recent call last):
File "repro.py", line 6, in <module>
cuda.compile_ptx_for_current_device(f, [], device=True, debug=True)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 124, in compile_ptx_for_current_device
return compile_ptx(pyfunc, args, debug=-debug, device=device,
File "/home/gmarkall/numbadev/numba/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 114, in compile_ptx
ptx = nvvm.llvm_to_ptx(llvmir, opt=opt, arch=arch, **options)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 669, in llvm_to_ptx
ptx = cu.compile(**opts)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 265, in compile
self._try_error(err, 'Failed to compile\n')
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 283, in _try_error
self.driver.check_error(err, "%s\n%s" % (msg, self.get_log()))
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 173, in check_error
raise exc
numba.cuda.cudadrv.error.NvvmError: Failed to compile

DBG version 1.0 incompatible with current version 3.0
<unnamed>: error: incompatible IR detected. Possible mix of compiler/IR from different releases.
NVVM_ERROR_IR_VERSION_MISMATCH

# Fixed code
def declare_device_function(name, restype, argtypes):
    from .descriptor import cuda_target

    typingctx = cuda_target.typingctx
    targetctx = cuda_target.targetctx
    sig = typing.signature(restype, *argtypes)
    extfn = ExternFunction(name, sig)

    class device_function_template(ConcreteTemplate):
        key = extfn
        cases = [sig]

    fndesc = funcdesc.ExternalFunctionDescriptor(
        name=name, restype=restype, argtypes=argtypes
    )
    typingctx.insert_user_function(extfn, device_function_template)
    targetctx.insert_user_function(extfn, fndesc)
    return extfn
# Buggy code
def set_cuda_kernel(lfunc):
    from llvmlite.llvmpy.core import MetaData, MetaDataString, Constant, Type

    m = lfunc.module

    ops = lfunc, MetaDataString.get(m, "kernel"), Constant.int(Type.int(), 1)
    md = MetaData.get(m, ops)

    nmd = m.get_or_insert_named_metadata("nvvm.annotations")
    nmd.add(md)

    # Set NVVM IR version
    i32 = ir.IntType(32)
    if NVVM().is_nvvm70:
        # NVVM IR 1.6, DWARF 3.0
        ir_versions = [i32(1), i32(6), i32(3), i32(0)]
    else:
        # NVVM IR 1.1, DWARF 2.0
        ir_versions = [i32(1), i32(2), i32(2), i32(0)]

    md_ver = m.add_metadata(ir_versions)
    m.add_named_metadata("nvvmir.version", md_ver)


# Traceback (numba.cuda.cudadrv.error.NvvmError)
Traceback (most recent call last):
File "repro.py", line 6, in <module>
cuda.compile_ptx_for_current_device(f, [], device=True, debug=True)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 124, in compile_ptx_for_current_device
return compile_ptx(pyfunc, args, debug=-debug, device=device,
File "/home/gmarkall/numbadev/numba/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
File "/home/gmarkall/numbadev/numba/numba/cuda/compiler.py", line 114, in compile_ptx
ptx = nvvm.llvm_to_ptx(llvmir, opt=opt, arch=arch, **options)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 669, in llvm_to_ptx
ptx = cu.compile(**opts)
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 265, in compile
self._try_error(err, 'Failed to compile\n')
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 283, in _try_error
self.driver.check_error(err, "%s\n%s" % (msg, self.get_log()))
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/nvvm.py", line 173, in check_error
raise exc
numba.cuda.cudadrv.error.NvvmError: Failed to compile

DBG version 1.0 incompatible with current version 3.0
<unnamed>: error: incompatible IR detected. Possible mix of compiler/IR from different releases.
NVVM_ERROR_IR_VERSION_MISMATCH

# Fixed code
def set_cuda_kernel(lfunc):
    from llvmlite.llvmpy.core import MetaData, MetaDataString, Constant, Type

    mod = lfunc.module

    ops = lfunc, MetaDataString.get(mod, "kernel"), Constant.int(Type.int(), 1)
    md = MetaData.get(mod, ops)

    nmd = mod.get_or_insert_named_metadata("nvvm.annotations")
    nmd.add(md)
# Buggy code
def np_asfarray(a, dtype=np.float64):
    dtype = as_dtype(dtype)
    if not np.issubdtype(dtype, np.inexact):
        dx = types.float64
    else:
        dx = dtype

    def impl(a, dtype=np.float64):
        return np.asarray(a, dx)

    return impl


# Traceback (NotImplementedError)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function asfarray at 0x7ff2ebd55ef0>) found for signature:

>>> asfarray(array(float64, 1d, C))

There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'np_asfarray': File: numba/np/arraymath.py: Line 4089.
With argument(s): '(array(float64, 1d, C))':
Rejected as the implementation raised a specific error:
NotImplementedError: <class 'numpy.float64'> cannot be represented as a Numpy dtype
Traceback (most recent call last):
File "<path>/numba/core/typing/templates.py", line 677, in _get_impl
impl, args = self._impl_cache[cache_key]
KeyError: (<numba.core.typing.context.Context object at 0x7ff2dccf0050>, (array(float64, 1d, C),), ())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<path>/numba/core/types/functions.py", line 298, in get_call_type
sig = temp.apply(nolitargs, nolitkws)
File "<path>/numba/core/typing/templates.py", line 345, in apply
sig = generic(args, kws)
File "<path>/numba/core/typing/templates.py", line 597, in generic
disp, new_args = self._get_impl(args, kws)
File "<path>/numba/core/typing/templates.py", line 679, in _get_impl
impl, args = self._build_impl(cache_key, args, kws)
File "<path>/numba/core/typing/templates.py", line 710, in _build_impl
ovf_result = self._overload_func(*args, **kws)
File "<path>/numba/np/arraymath.py", line 4091, in np_asfarray
dtype = as_dtype(dtype)
File "<path>/numba/np/numpy_support.py", line 152, in as_dtype
% (nbtype,))
NotImplementedError: <class 'numpy.float64'> cannot be represented as a Numpy dtype
raised from <path>/numba/np/numpy_support.py:152

During: resolving callee type: Function(<function asfarray at 0x7ff2ebd55ef0>)
During: typing of call at test_farray.py (6)


File "test_farray.py", line 6:
def foo():
np.asfarray(np.zeros(4,))
^

# Fixed code
def np_asfarray(a, dtype=np.float64):
    # convert numba dtype types into NumPy dtype
    if isinstance(dtype, types.Type):
        dtype = as_dtype(dtype)
    if not np.issubdtype(dtype, np.inexact):
        dx = types.float64
    else:
        dx = dtype

    def impl(a, dtype=np.float64):
        return np.asarray(a, dx)

    return impl
# Buggy code
def np_cross(a, b):
    if not type_can_asarray(a) or not type_can_asarray(b):
        raise TypingError("Inputs must be array-like.")

    def impl(a, b):
        a_ = np.asarray(a)
        b_ = np.asarray(b)
        if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3):
            raise ValueError(
                (
                    "Incompatible dimensions for cross product\n"
                    "(dimension must be 2 or 3)"
                )
            )

        if a_.shape[-1] == 3 or b_.shape[-1] == 3:
            return _cross_impl(a_, b_)
        else:
            raise ValueError(
                (
                    "Dimensions for both inputs is 2.\n"
                    "Please replace your numpy.cross(a, b) call with "
                    "numba.numpy_extensions.cross2d(a, b)."
                )
            )

    return impl


# Traceback (ValueError)
is_convex(polygon)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-dc4c8f71d7e1> in <module>
----> 1 is_convex(polygon)

~/.local/lib/python3.6/site-packages/numba/np/arraymath.py in impl()
4380         else:
4381             raise ValueError((
-> 4382                 "Dimensions for both inputs is 2.\n"
4383                 "Please replace your numpy.cross(a, b) call with "
4384                 "numba.numpy_extensions.cross2d(a, b)."

ValueError: Dimensions for both inputs is 2.
Please replace your numpy.cross(a, b) call with numba.numpy_extensions.cross2d(a, b).

# Fixed code
def np_cross(a, b):
    if not type_can_asarray(a) or not type_can_asarray(b):
        raise TypingError("Inputs must be array-like.")

    def impl(a, b):
        a_ = np.asarray(a)
        b_ = np.asarray(b)
        if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3):
            raise ValueError(
                (
                    "Incompatible dimensions for cross product\n"
                    "(dimension must be 2 or 3)"
                )
            )

        if a_.shape[-1] == 3 or b_.shape[-1] == 3:
            return _cross_impl(a_, b_)
        else:
            raise ValueError(
                (
                    "Dimensions for both inputs is 2.\n"
                    "Please replace your numpy.cross(a, b) call with "
                    "a call to `cross2d(a, b)` from `numba.np.extensions`."
                )
            )

    return impl
# Buggy code
def impl(a, b):
    a_ = np.asarray(a)
    b_ = np.asarray(b)
    if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3):
        raise ValueError(
            ("Incompatible dimensions for cross product\n(dimension must be 2 or 3)")
        )

    if a_.shape[-1] == 3 or b_.shape[-1] == 3:
        return _cross_impl(a_, b_)
    else:
        raise ValueError(
            (
                "Dimensions for both inputs is 2.\n"
                "Please replace your numpy.cross(a, b) call with "
                "numba.numpy_extensions.cross2d(a, b)."
            )
        )


# Traceback (ValueError)
is_convex(polygon)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-dc4c8f71d7e1> in <module>
----> 1 is_convex(polygon)

~/.local/lib/python3.6/site-packages/numba/np/arraymath.py in impl()
4380         else:
4381             raise ValueError((
-> 4382                 "Dimensions for both inputs is 2.\n"
4383                 "Please replace your numpy.cross(a, b) call with "
4384                 "numba.numpy_extensions.cross2d(a, b)."

ValueError: Dimensions for both inputs is 2.
Please replace your numpy.cross(a, b) call with numba.numpy_extensions.cross2d(a, b).

# Fixed code
def impl(a, b):
    a_ = np.asarray(a)
    b_ = np.asarray(b)
    if a_.shape[-1] not in (2, 3) or b_.shape[-1] not in (2, 3):
        raise ValueError(
            ("Incompatible dimensions for cross product\n(dimension must be 2 or 3)")
        )

    if a_.shape[-1] == 3 or b_.shape[-1] == 3:
        return _cross_impl(a_, b_)
    else:
        raise ValueError(
            (
                "Dimensions for both inputs is 2.\n"
                "Please replace your numpy.cross(a, b) call with "
                "a call to `cross2d(a, b)` from `numba.np.extensions`."
            )
        )
# Buggy code
def unify(self, typingctx, other):
    if isinstance(other, List):
        dtype = typingctx.unify_pairs(self.dtype, other.dtype)
        reflected = self.reflected or other.reflected
        if dtype is not None:
            siv = self.initial_value
            oiv = other.initial_value
            if siv is not None and oiv is not None:
                use = siv
                if siv is None:
                    use = oiv
                return List(dtype, reflected, use.initial_value)
            else:
                return List(dtype, reflected)


# Traceback (TypingError)
In [7]: numba.__version__
Out[7]: '0.51.0dev0+497.g4aceb2727'

In [8]: numba.njit(lambda: [[1, 2, 3, 4, 5], [1, 2, 3, 4, 6]])()
---------------------------------------------------------------------------
TypingError                               Traceback (most recent call last)
<ipython-input-8-7fdc3277fbc9> in <module>
----> 1 numba.njit(lambda: [[1, 2, 3, 4, 5], [1, 2, 3, 4, 6]])()

~/dev/numba/numba/core/dispatcher.py in _compile_for_args(self, *args, **kws)
413                 e.patch_message(msg)
414
--> 415             error_rewrite(e, 'typing')
416         except errors.UnsupportedError as e:
417             # Something unsupported is present in the user code, add help info

~/dev/numba/numba/core/dispatcher.py in error_rewrite(e, issue_type)
356                 raise e
357             else:
--> 358                 reraise(type(e), e, None)
359
360         argtypes = []

~/dev/numba/numba/core/utils.py in reraise(tp, value, tb)
78         value = tp()
79     if value.__traceback__ is not tb:
---> 80         raise value.with_traceback(tb)
81     raise value
82

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Internal error at <numba.core.typeinfer.BuildListConstraint object at 0x7fd342d54f70>.
'list' object has no attribute 'initial_value'
During: typing of <class 'numba.core.types.containers.List'> at <ipython-input-8-7fdc3277fbc9> (1)
Enable logging at debug level for details.

File "<ipython-input-8-7fdc3277fbc9>", line 1:
numba.njit(lambda: [[1, 2, 3, 4, 5], [1, 2, 3, 4, 6]])()
^

# Fixed code
def unify(self, typingctx, other):
    if isinstance(other, List):
        dtype = typingctx.unify_pairs(self.dtype, other.dtype)
        reflected = self.reflected or other.reflected
        if dtype is not None:
            siv = self.initial_value
            oiv = other.initial_value
            if siv is not None and oiv is not None:
                use = siv
                if siv is None:
                    use = oiv
                return List(dtype, reflected, use)
            else:
                return List(dtype, reflected)
# Buggy code
def _reduce_function(func, globs):
    """
    Reduce a Python function and its globals to picklable components.
    If there are cell variables (i.e. references to a closure), their
    values will be frozen.
    """
    if func.__closure__:
        cells = [cell.cell_contents for cell in func.__closure__]
    else:
        cells = None
    return _reduce_code(func.__code__), globs, func.__name__, cells


# Traceback (TypeError)
[2, 3, 4]
2
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
TypeError: not enough arguments: expected 2, got 1
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "smpe_paper/numba_test.py", line 18, in <module>
print(p.map(add2, [1, 2, 3]))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: not enough arguments: expected 2, got 1
(smpe-paper) root@5b798e37487d:/smpe-paper# python smpe_paper/numba_test.py
[2, 3, 4]
2
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
TypeError: not enough arguments: expected 2, got 1
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "smpe_paper/numba_test.py", line 18, in <module>
print(p.map(add2, [1, 2, 3]))  # TypeError
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: not enough arguments: expected 2, got 1

# Fixed code
def _reduce_function(func, globs):
    """
    Reduce a Python function and its globals to picklable components.
    If there are cell variables (i.e. references to a closure), their
    values will be frozen.
    """
    if func.__closure__:
        cells = [cell.cell_contents for cell in func.__closure__]
    else:
        cells = None
    return _reduce_code(func.__code__), globs, func.__name__, cells, func.__defaults__
# Buggy code
def _rebuild_function(code_reduced, globals, name, cell_values):
    """
    Rebuild a function from its _reduce_function() results.
    """
    if cell_values:
        cells = tuple(_dummy_closure(v).__closure__[0] for v in cell_values)
    else:
        cells = ()
    code = _rebuild_code(*code_reduced)
    modname = globals["__name__"]
    try:
        _rebuild_module(modname)
    except ImportError:
        # If the module can't be found, avoid passing it (it would produce
        # errors when lowering).
        del globals["__name__"]
    return FunctionType(code, globals, name, (), cells)


# Traceback (TypeError)
[2, 3, 4]
2
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
TypeError: not enough arguments: expected 2, got 1
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "smpe_paper/numba_test.py", line 18, in <module>
print(p.map(add2, [1, 2, 3]))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: not enough arguments: expected 2, got 1
(smpe-paper) root@5b798e37487d:/smpe-paper# python smpe_paper/numba_test.py
[2, 3, 4]
2
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
TypeError: not enough arguments: expected 2, got 1
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "smpe_paper/numba_test.py", line 18, in <module>
print(p.map(add2, [1, 2, 3]))  # TypeError
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/root/.pyenv/versions/3.7.3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
TypeError: not enough arguments: expected 2, got 1

# Fixed code
def _rebuild_function(code_reduced, globals, name, cell_values, defaults):
    """
    Rebuild a function from its _reduce_function() results.
    """
    if cell_values:
        cells = tuple(_dummy_closure(v).__closure__[0] for v in cell_values)
    else:
        cells = ()
    code = _rebuild_code(*code_reduced)
    modname = globals["__name__"]
    try:
        _rebuild_module(modname)
    except ImportError:
        # If the module can't be found, avoid passing it (it would produce
        # errors when lowering).
        del globals["__name__"]
    return FunctionType(code, globals, name, defaults, cells)
# Buggy code
def __str__(self):
    if self.exc_class is None:
        return "raise"
    elif self.exc_args is None:
        return "raise %s" % (self.exc_class,)
    else:
        return "raise %s(%s)" % (self.exc_class, ", ".join(map(repr, self.exc_args)))


# Traceback (ValueError)
Traceback (most recent call last):
File "test_inline.py", line 14, in <module>
print(fn())
File "numba\numba\dispatcher.py", line 420, in _compile_for_args
raise e
File "numba\numba\dispatcher.py", line 353, in _compile_for_args
return self.compile(tuple(argtypes))
File "numba\numba\compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "numba\numba\dispatcher.py", line 768, in compile
cres = self._compiler.compile(args, return_type)
File "numba\numba\dispatcher.py", line 77, in compile
status, retval = self._compile_cached(args, return_type)
File "numba\numba\dispatcher.py", line 91, in _compile_cached
retval = self._compile_core(args, return_type)
File "numba\numba\dispatcher.py", line 109, in _compile_core
pipeline_class=self.pipeline_class)
File "numba\numba\compiler.py", line 551, in compile_extra
return pipeline.compile_extra(func)
File "numba\numba\compiler.py", line 331, in compile_extra
return self._compile_bytecode()
File "numba\numba\compiler.py", line 393, in _compile_bytecode
return self._compile_core()
File "numba\numba\compiler.py", line 373, in _compile_core
raise e
File "numba\numba\compiler.py", line 364, in _compile_core
pm.run(self.state)
File "numba\numba\compiler_machinery.py", line 347, in run
raise patched_exception
File "numba\numba\compiler_machinery.py", line 338, in run
self._runPass(idx, pass_inst, state)
File "numba\numba\compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "numba\numba\compiler_machinery.py", line 302, in _runPass
mutated |= check(pss.run_pass, internal_state)
File "numba\numba\compiler_machinery.py", line 275, in check
mangled = func(compiler_state)
File "numba\numba\untyped_passes.py", line 312, in run_pass
state.func_ir.blocks = simplify_CFG(state.func_ir.blocks)
File "numba\numba\ir_utils.py", line 1237, in simplify_CFG
return rename_labels(blocks)
File "numba\numba\ir_utils.py", line 1188, in rename_labels
topo_order.remove(return_label)
ValueError: Failed in nopython mode pipeline (step: inline inlinable functions)
list.remove(x): x not in list

# Fixed code
def __str__(self):
    if self.exc_class is None:
        return "<static> raise"
    elif self.exc_args is None:
        return "<static> raise %s" % (self.exc_class,)
    else:
        return "<static> raise %s(%s)" % (
            self.exc_class,
            ", ".join(map(repr, self.exc_args)),
        )
# Buggy code
def __call__(self, typeinfer):
    with new_error_context("typing of argument at {0}", self.loc):
        typevars = typeinfer.typevars
        src = typevars[self.src]
        if not src.defined:
            return
        ty = src.getone()
        if isinstance(ty, types.Omitted):
            ty = typeinfer.context.resolve_value_type(ty.value)
        if not ty.is_precise():
            raise TypingError("non-precise type {}".format(ty))
        typeinfer.add_type(self.dst, ty, loc=self.loc)


# Traceback (numba.core.errors.TypingError)
Traceback (most recent call last):
File "./test.py", line 24, in <module>
f()
File ".../numba/core/dispatcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File ".../numba/core/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File ".../numba/core/utils.py", line 79, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function my_func at 0x7ff222b79f70>) with argument(s) of type(s): ()
* parameterized
In definition 0:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function inner at 0x7ff23f0ab700>) with argument(s) of type(s): (unicode_type)
* parameterized
In definition 0:
All templates rejected with literals.
In definition 1:
All templates rejected without literals.
This error is usually caused by passing an argument of a type that is unsupported by the named function.

# Fixed code
def __call__(self, typeinfer):
    with new_error_context("typing of argument at {0}", self.loc):
        typevars = typeinfer.typevars
        src = typevars[self.src]
        if not src.defined:
            return
        ty = src.getone()
        if isinstance(ty, types.Omitted):
            ty = typeinfer.context.resolve_value_type_prefer_literal(
                ty.value,
            )
        if not ty.is_precise():
            raise TypingError("non-precise type {}".format(ty))
        typeinfer.add_type(self.dst, ty, loc=self.loc)
# Buggy code
def __init__(self, value):
    self.value = value
    super(Omitted, self).__init__("omitted(default=%r)" % (value,))


# Traceback (numba.core.errors.TypingError)
Traceback (most recent call last):
File "./test.py", line 24, in <module>
f()
File ".../numba/core/dispatcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File ".../numba/core/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File ".../numba/core/utils.py", line 79, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function my_func at 0x7ff222b79f70>) with argument(s) of type(s): ()
* parameterized
In definition 0:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function inner at 0x7ff23f0ab700>) with argument(s) of type(s): (unicode_type)
* parameterized
In definition 0:
All templates rejected with literals.
In definition 1:
All templates rejected without literals.
This error is usually caused by passing an argument of a type that is unsupported by the named function.

# Fixed code
def __init__(self, value):
    self._value = value
    super(Omitted, self).__init__("omitted(default=%r)" % (value,))
# Buggy code
def key(self):
    return type(self.value), id(self.value)


# Traceback (numba.core.errors.TypingError)
Traceback (most recent call last):
File "./test.py", line 24, in <module>
f()
File ".../numba/core/dispatcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File ".../numba/core/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File ".../numba/core/utils.py", line 79, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function my_func at 0x7ff222b79f70>) with argument(s) of type(s): ()
* parameterized
In definition 0:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function inner at 0x7ff23f0ab700>) with argument(s) of type(s): (unicode_type)
* parameterized
In definition 0:
All templates rejected with literals.
In definition 1:
All templates rejected without literals.
This error is usually caused by passing an argument of a type that is unsupported by the named function.

# Fixed code
def key(self):
    return type(self._value), id(self._value)
# Buggy code
def generic(self, args, kws):
    assert not kws
    if len(args) == 1:
        # One-argument type() -> return the __class__
        classty = self.context.resolve_getattr(args[0], "__class__")
        if classty is not None:
            return signature(classty, *args)


# Traceback (numba.core.errors.TypingError)
Traceback (most recent call last):
File "./test.py", line 24, in <module>
f()
File ".../numba/core/dispatcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File ".../numba/core/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File ".../numba/core/utils.py", line 79, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function my_func at 0x7ff222b79f70>) with argument(s) of type(s): ()
* parameterized
In definition 0:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function inner at 0x7ff23f0ab700>) with argument(s) of type(s): (unicode_type)
* parameterized
In definition 0:
All templates rejected with literals.
In definition 1:
All templates rejected without literals.
This error is usually caused by passing an argument of a type that is unsupported by the named function.

# Fixed code
def generic(self, args, kws):
    assert not kws
    if len(args) == 1:
        # One-argument type() -> return the __class__
        # Avoid literal types
        arg = types.unliteral(args[0])
        classty = self.context.resolve_getattr(arg, "__class__")
        if classty is not None:
            return signature(classty, *args)
# Buggy code
def match(self, func_ir, block, typemap, calltypes):
    """
    Detect all getitem expressions and find which ones have
    string literal indexes
    """
    self.getitems = getitems = {}
    self.block = block
    for expr in block.find_exprs(op="getitem"):
        if expr.op == "getitem":
            index_ty = typemap[expr.index.name]
            if isinstance(index_ty, types.StringLiteral):
                getitems[expr] = (expr.index, index_ty.literal_value)

    return len(getitems) > 0


# Traceback (KeyError)
Traceback (most recent call last):
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\errors.py", line 801, in new_error_context
yield
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 267, in lower_block
self.lower_inst(inst)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 364, in lower_inst
val = self.lower_assign(ty, inst)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 538, in lower_assign
return self.lower_expr(ty, value)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 1183, in lower_expr
signature = self.fndesc.calltypes[expr]
KeyError: static_getitem(value=$8call_method.3, index=C, index_var=col_name)

# Fixed code
def match(self, func_ir, block, typemap, calltypes):
    """
    Detect all getitem expressions and find which ones have
    string literal indexes
    """
    self.getitems = getitems = {}
    self.block = block
    self.calltypes = calltypes
    for expr in block.find_exprs(op="getitem"):
        if expr.op == "getitem":
            index_ty = typemap[expr.index.name]
            if isinstance(index_ty, types.StringLiteral):
                getitems[expr] = (expr.index, index_ty.literal_value)

    return len(getitems) > 0
# Buggy code
def apply(self):
    """
    Rewrite all matching getitems as static_getitems where the index
    is the literal value of the string.
    """
    new_block = self.block.copy()
    new_block.clear()
    for inst in self.block.body:
        if isinstance(inst, ir.Assign):
            expr = inst.value
            if expr in self.getitems:
                const, lit_val = self.getitems[expr]
                new_expr = ir.Expr.static_getitem(
                    value=expr.value, index=lit_val, index_var=expr.index, loc=expr.loc
                )
                inst = ir.Assign(value=new_expr, target=inst.target, loc=inst.loc)
        new_block.append(inst)
    return new_block


# Traceback (KeyError)
Traceback (most recent call last):
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\errors.py", line 801, in new_error_context
yield
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 267, in lower_block
self.lower_inst(inst)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 364, in lower_inst
val = self.lower_assign(ty, inst)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 538, in lower_assign
return self.lower_expr(ty, value)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\core\lowering.py", line 1183, in lower_expr
signature = self.fndesc.calltypes[expr]
KeyError: static_getitem(value=$8call_method.3, index=C, index_var=col_name)

# Fixed code
def apply(self):
    """
    Rewrite all matching getitems as static_getitems where the index
    is the literal value of the string.
    """
    new_block = self.block.copy()
    new_block.clear()
    for inst in self.block.body:
        if isinstance(inst, ir.Assign):
            expr = inst.value
            if expr in self.getitems:
                const, lit_val = self.getitems[expr]
                new_expr = ir.Expr.static_getitem(
                    value=expr.value, index=lit_val, index_var=expr.index, loc=expr.loc
                )
                self.calltypes[new_expr] = self.calltypes[expr]
                inst = ir.Assign(value=new_expr, target=inst.target, loc=inst.loc)
        new_block.append(inst)
    return new_block
# Buggy code
def call(cls, func, args, kws, loc, vararg=None):
    assert isinstance(func, (Var, Intrinsic))
    assert isinstance(loc, Loc)
    op = "call"
    return cls(op=op, loc=loc, func=func, args=args, kws=kws, vararg=vararg)


# Traceback (AssertionError)
======================================================================
FAIL: test_set_registers_57 (numba.cuda.tests.cudadrv.test_linker.TestLinker)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/devices.py", line 224, in _require_cuda_context
return fn(*args, **kws)
File "/home/gmarkall/numbadev/numba/numba/cuda/tests/cudadrv/test_linker.py", line 92, in test_set_registers_57
self.assertEquals(57, compiled._func.get().attrs.regs)
AssertionError: 57 != 56

# Fixed code
def call(cls, func, args, kws, loc, vararg=None):
    assert isinstance(func, Var)
    assert isinstance(loc, Loc)
    op = "call"
    return cls(op=op, loc=loc, func=func, args=args, kws=kws, vararg=vararg)
# Buggy code
def _lower_call_normal(self, fnty, expr, signature):
    # Normal function resolution
    self.debug_print("# calling normal function: {0}".format(fnty))
    self.debug_print("# signature: {0}".format(signature))
    if isinstance(expr.func, ir.Intrinsic) or isinstance(fnty, types.ObjModeDispatcher):
        argvals = expr.func.args
    else:
        argvals = self.fold_call_args(
            fnty,
            signature,
            expr.args,
            expr.vararg,
            expr.kws,
        )
    impl = self.context.get_function(fnty, signature)
    if signature.recvr:
        # The "self" object is passed as the function object
        # for bounded function
        the_self = self.loadvar(expr.func.name)
        # Prepend the self reference
        argvals = [the_self] + list(argvals)

    res = impl(self.builder, argvals, self.loc)
    return res


# Traceback (AssertionError)
======================================================================
FAIL: test_set_registers_57 (numba.cuda.tests.cudadrv.test_linker.TestLinker)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/devices.py", line 224, in _require_cuda_context
return fn(*args, **kws)
File "/home/gmarkall/numbadev/numba/numba/cuda/tests/cudadrv/test_linker.py", line 92, in test_set_registers_57
self.assertEquals(57, compiled._func.get().attrs.regs)
AssertionError: 57 != 56

# Fixed code
def _lower_call_normal(self, fnty, expr, signature):
    # Normal function resolution
    self.debug_print("# calling normal function: {0}".format(fnty))
    self.debug_print("# signature: {0}".format(signature))
    if isinstance(fnty, types.ObjModeDispatcher):
        argvals = expr.func.args
    else:
        argvals = self.fold_call_args(
            fnty,
            signature,
            expr.args,
            expr.vararg,
            expr.kws,
        )
    impl = self.context.get_function(fnty, signature)
    if signature.recvr:
        # The "self" object is passed as the function object
        # for bounded function
        the_self = self.loadvar(expr.func.name)
        # Prepend the self reference
        argvals = [the_self] + list(argvals)

    res = impl(self.builder, argvals, self.loc)
    return res
# Buggy code
def resolve_array(self, mod):
    return types.Macro(Hsa_shared_array)


# Traceback (AssertionError)
======================================================================
FAIL: test_set_registers_57 (numba.cuda.tests.cudadrv.test_linker.TestLinker)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gmarkall/numbadev/numba/numba/cuda/cudadrv/devices.py", line 224, in _require_cuda_context
return fn(*args, **kws)
File "/home/gmarkall/numbadev/numba/numba/cuda/tests/cudadrv/test_linker.py", line 92, in test_set_registers_57
self.assertEquals(57, compiled._func.get().attrs.regs)
AssertionError: 57 != 56

# Fixed code
def resolve_array(self, mod):
    return types.Function(Hsa_shared_array)
# Buggy code
def new_list(item, allocated=0):
    """Construct a new list. (Not implemented in the interpreter yet)

    Parameters
    ----------
    item: TypeRef
        Item type of the new list.
    allocated: int
        number of items to pre-allocate

    """
    # With JIT disabled, ignore all arguments and return a Python list.
    return list()


# Traceback (numba.errors.TypingError)
======================================================================
ERROR: test_numba_typed_list_allocated (sdc.tests.test_series.TestSeries)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\akozlov\AppData\Local\Continuum\anaconda3\hpat\sdc\tests\test_series.py
", line 6817, in test_numba_typed_list_allocated
print(jitted())
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\disp
atcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\disp
atcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\six.
py", line 668, in reraise
raise value.with_traceback(tb)
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function typedlist_empty at 0x0000015A9C481550>) with argument(
s) of type(s): (typeref[<class 'numba.types.containers.ListType'>], class(int64), int64)

* parameterized
In definition 0:
TypeError: typedlist_empty() takes 2 positional arguments but 3 were given
raised from c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\nu
mba\typing\templates.py:539
In definition 1:
TypeError: typedlist_empty() takes 2 positional arguments but 3 were given
raised from c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\nu
mba\typing\templates.py:539
This error is usually caused by passing an argument of a type that is unsupported by the
named function.
[1] During: resolving callee type: BoundFunction((<class 'numba.types.abstract.TypeRef'>
, 'empty_list') for typeref[<class 'numba.types.containers.ListType'>])
[2] During: typing of call at C:\Users\akozlov\AppData\Local\Continuum\anaconda3\hpat\sd
c\tests\test_series.py (6813)


File "sdc\tests\test_series.py", line 6813:
def test_impl():
<source elided>
# problem in overload of empty_list in typedlist.py
alloc_list = List.empty_list(types.int64, 10)
^


----------------------------------------------------------------------
Ran 1 test in 0.075s

FAILED (errors=1)

# Fixed code
def new_list(item, allocated=DEFAULT_ALLOCATED):
    """Construct a new list. (Not implemented in the interpreter yet)

    Parameters
    ----------
    item: TypeRef
        Item type of the new list.
    allocated: int
        number of items to pre-allocate

    """
    # With JIT disabled, ignore all arguments and return a Python list.
    return list()
# Buggy code
def imp(item, allocated=0):
    if allocated < 0:
        raise RuntimeError("expecting *allocated* to be >= 0")
    lp = _list_new(itemty, allocated)
    _list_set_method_table(lp, itemty)
    l = _make_list(itemty, lp)
    return l


# Traceback (numba.errors.TypingError)
======================================================================
ERROR: test_numba_typed_list_allocated (sdc.tests.test_series.TestSeries)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\akozlov\AppData\Local\Continuum\anaconda3\hpat\sdc\tests\test_series.py
", line 6817, in test_numba_typed_list_allocated
print(jitted())
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\disp
atcher.py", line 401, in _compile_for_args
error_rewrite(e, 'typing')
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\disp
atcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File "c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\numba\six.
py", line 668, in reraise
raise value.with_traceback(tb)
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of Function(<function typedlist_empty at 0x0000015A9C481550>) with argument(
s) of type(s): (typeref[<class 'numba.types.containers.ListType'>], class(int64), int64)

* parameterized
In definition 0:
TypeError: typedlist_empty() takes 2 positional arguments but 3 were given
raised from c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\nu
mba\typing\templates.py:539
In definition 1:
TypeError: typedlist_empty() takes 2 positional arguments but 3 were given
raised from c:\users\akozlov\appdata\local\continuum\anaconda3\numba_master\numba\nu
mba\typing\templates.py:539
This error is usually caused by passing an argument of a type that is unsupported by the
named function.
[1] During: resolving callee type: BoundFunction((<class 'numba.types.abstract.TypeRef'>
, 'empty_list') for typeref[<class 'numba.types.containers.ListType'>])
[2] During: typing of call at C:\Users\akozlov\AppData\Local\Continuum\anaconda3\hpat\sd
c\tests\test_series.py (6813)


File "sdc\tests\test_series.py", line 6813:
def test_impl():
<source elided>
# problem in overload of empty_list in typedlist.py
alloc_list = List.empty_list(types.int64, 10)
^


----------------------------------------------------------------------
Ran 1 test in 0.075s

FAILED (errors=1)

# Fixed code
def imp(item, allocated=DEFAULT_ALLOCATED):
    if allocated < 0:
        raise RuntimeError("expecting *allocated* to be >= 0")
    lp = _list_new(itemty, allocated)
    _list_set_method_table(lp, itemty)
    l = _make_list(itemty, lp)
    return l