prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Support numpy 1.10
  numpy 1.10.0 is released on 2015/10/07
  
  https://pypi.python.org/pypi/numpy/1.10.0
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `cupy/creation/ranges.py`
  Content:
  ```
  1 import numpy
  2 
  3 import cupy
  4 from cupy import core
  5 
  6 
  7 def arange(start, stop=None, step=1, dtype=None):
  8     """Rerurns an array with evenly spaced values within a given interval.
  9 
  10     Values are generated within the half-open interval [start, stop). The first
  11     three arguments are mapped like the ``range`` built-in function, i.e. start
  12     and step are optional.
  13 
  14     Args:
  15         start: Start of the interval.
  16         stop: End of the interval.
  17         step: Step width between each pair of consecutive values.
  18         dtype: Data type specifier. It is inferred from other arguments by
  19             default.
  20 
  21     Returns:
  22         cupy.ndarray: The 1-D array of range values.
  23 
  24     .. seealso:: :func:`numpy.arange`
  25 
  26     """
  27     if dtype is None:
  28         if any(numpy.dtype(type(val)).kind == 'f'
  29                for val in (start, stop, step)):
  30             dtype = float
  31         else:
  32             dtype = int
  33 
  34     if stop is None:
  35         stop = start
  36         start = 0
  37     size = int(numpy.ceil((stop - start) / step))
  38     if size <= 0:
  39         return cupy.empty((0,), dtype=dtype)
  40 
  41     ret = cupy.empty((size,), dtype=dtype)
  42     typ = numpy.dtype(dtype).type
  43     _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
  44     return ret
  45 
  46 
  47 def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
  48     """Returns an array with evenly-spaced values within a given interval.
  49 
  50     Instead of specifying the step width like :func:`cupy.arange`, this
  51     function requires the total number of elements specified.
  52 
  53     Args:
  54         start: Start of the interval.
  55         stop: End of the interval.
  56         num: Number of elements.
  57         endpoint (bool): If True, the stop value is included as the last
  58             element. Otherwise, the stop value is omitted.
  59         retstep (bool): If True, this function returns (array, step).
  60             Otherwise, it returns only the array.
  61         dtype: Data type specifier. It is inferred from the start and stop
  62             arguments by default.
  63 
  64     Returns:
  65         cupy.ndarray: The 1-D array of ranged values.
  66 
  67     """
  68     if num < 0:
  69         raise ValueError('linspace with num<0 is not supported')
  70 
  71     if dtype is None:
  72         # In actual implementation, only float is used
  73         dtype = float
  74 
  75     ret = cupy.empty((num,), dtype=dtype)
  76     if num == 0:
  77         step = float('nan')
  78     elif num == 1:
  79         ret.fill(start)
  80         step = float('nan')
  81     else:
  82         div = (num - 1) if endpoint else num
  83         step = float(stop - start) / div
  84         stop = float(stop)
  85 
  86         if step == 0.0:
  87             # for underflow
  88             _linspace_ufunc_underflow(start, stop - start, div, ret)
  89         else:
  90             _linspace_ufunc(start, step, ret)
  91 
  92         if endpoint:
  93             ret[-1] = stop
  94 
  95     if retstep:
  96         return ret, step
  97     else:
  98         return ret
  99 
  100 
  101 # TODO(okuta): Implement logspace
  102 
  103 
  104 # TODO(okuta): Implement meshgrid
  105 
  106 
  107 # mgrid
  108 # ogrid
  109 
  110 
  111 _arange_ufunc = core.create_ufunc(
  112     'cupy_arange',
  113     ('bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',
  114      'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d'),
  115     'out0 = in0 + i * in1')
  116 
  117 
  118 _linspace_ufunc = core.create_ufunc(
  119     'cupy_linspace',
  120     ('dd->d',),
  121     'out0 = in0 + i * in1')
  122 
  123 _linspace_ufunc_underflow = core.create_ufunc(
  124     'cupy_linspace',
  125     ('ddd->d',),
  126     'out0 = in0 + i * in1 / in2')
  127
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/cupy/creation/ranges.py b/cupy/creation/ranges.py
  --- a/cupy/creation/ranges.py
  +++ b/cupy/creation/ranges.py
  @@ -85,9 +85,10 @@
   
           if step == 0.0:
               # for underflow
  -            _linspace_ufunc_underflow(start, stop - start, div, ret)
  +            _linspace_ufunc_underflow(start, stop - start, div, ret,
  +                                      casting='unsafe')
           else:
  -            _linspace_ufunc(start, step, ret)
  +            _linspace_ufunc(start, step, ret, casting='unsafe')
   
           if endpoint:
               ret[-1] = stop
  
verification_info: {"golden_diff": "diff --git a/cupy/creation/ranges.py b/cupy/creation/ranges.py\n--- a/cupy/creation/ranges.py\n+++ b/cupy/creation/ranges.py\n@@ -85,9 +85,10 @@\n \n         if step == 0.0:\n             # for underflow\n-            _linspace_ufunc_underflow(start, stop - start, div, ret)\n+            _linspace_ufunc_underflow(start, stop - start, div, ret,\n+                                      casting='unsafe')\n         else:\n-            _linspace_ufunc(start, step, ret)\n+            _linspace_ufunc(start, step, ret, casting='unsafe')\n \n         if endpoint:\n             ret[-1] = stop\n", "issue": "Support numpy 1.10\nnumpy 1.10.0 is released on 2015/10/07\n\nhttps://pypi.python.org/pypi/numpy/1.10.0\n\n", "before_files": [{"content": "import numpy\n\nimport cupy\nfrom cupy import core\n\n\ndef arange(start, stop=None, step=1, dtype=None):\n    \"\"\"Rerurns an array with evenly spaced values within a given interval.\n\n    Values are generated within the half-open interval [start, stop). The first\n    three arguments are mapped like the ``range`` built-in function, i.e. start\n    and step are optional.\n\n    Args:\n        start: Start of the interval.\n        stop: End of the interval.\n        step: Step width between each pair of consecutive values.\n        dtype: Data type specifier. It is inferred from other arguments by\n            default.\n\n    Returns:\n        cupy.ndarray: The 1-D array of range values.\n\n    .. seealso:: :func:`numpy.arange`\n\n    \"\"\"\n    if dtype is None:\n        if any(numpy.dtype(type(val)).kind == 'f'\n               for val in (start, stop, step)):\n            dtype = float\n        else:\n            dtype = int\n\n    if stop is None:\n        stop = start\n        start = 0\n    size = int(numpy.ceil((stop - start) / step))\n    if size <= 0:\n        return cupy.empty((0,), dtype=dtype)\n\n    ret = cupy.empty((size,), dtype=dtype)\n    typ = numpy.dtype(dtype).type\n    _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)\n    return ret\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):\n    \"\"\"Returns an array with evenly-spaced values within a given interval.\n\n    Instead of specifying the step width like :func:`cupy.arange`, this\n    function requires the total number of elements specified.\n\n    Args:\n        start: Start of the interval.\n        stop: End of the interval.\n        num: Number of elements.\n        endpoint (bool): If True, the stop value is included as the last\n            element. Otherwise, the stop value is omitted.\n        retstep (bool): If True, this function returns (array, step).\n            Otherwise, it returns only the array.\n        dtype: Data type specifier. It is inferred from the start and stop\n            arguments by default.\n\n    Returns:\n        cupy.ndarray: The 1-D array of ranged values.\n\n    \"\"\"\n    if num < 0:\n        raise ValueError('linspace with num<0 is not supported')\n\n    if dtype is None:\n        # In actual implementation, only float is used\n        dtype = float\n\n    ret = cupy.empty((num,), dtype=dtype)\n    if num == 0:\n        step = float('nan')\n    elif num == 1:\n        ret.fill(start)\n        step = float('nan')\n    else:\n        div = (num - 1) if endpoint else num\n        step = float(stop - start) / div\n        stop = float(stop)\n\n        if step == 0.0:\n            # for underflow\n            _linspace_ufunc_underflow(start, stop - start, div, ret)\n        else:\n            _linspace_ufunc(start, step, ret)\n\n        if endpoint:\n            ret[-1] = stop\n\n    if retstep:\n        return ret, step\n    else:\n        return ret\n\n\n# TODO(okuta): Implement logspace\n\n\n# TODO(okuta): Implement meshgrid\n\n\n# mgrid\n# ogrid\n\n\n_arange_ufunc = core.create_ufunc(\n    'cupy_arange',\n    ('bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',\n     'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d'),\n    'out0 = in0 + i * in1')\n\n\n_linspace_ufunc = core.create_ufunc(\n    'cupy_linspace',\n    ('dd->d',),\n    'out0 = in0 + i * in1')\n\n_linspace_ufunc_underflow = core.create_ufunc(\n    'cupy_linspace',\n    ('ddd->d',),\n    'out0 = in0 + i * in1 / in2')\n", "path": "cupy/creation/ranges.py"}], "after_files": [{"content": "import numpy\n\nimport cupy\nfrom cupy import core\n\n\ndef arange(start, stop=None, step=1, dtype=None):\n    \"\"\"Rerurns an array with evenly spaced values within a given interval.\n\n    Values are generated within the half-open interval [start, stop). The first\n    three arguments are mapped like the ``range`` built-in function, i.e. start\n    and step are optional.\n\n    Args:\n        start: Start of the interval.\n        stop: End of the interval.\n        step: Step width between each pair of consecutive values.\n        dtype: Data type specifier. It is inferred from other arguments by\n            default.\n\n    Returns:\n        cupy.ndarray: The 1-D array of range values.\n\n    .. seealso:: :func:`numpy.arange`\n\n    \"\"\"\n    if dtype is None:\n        if any(numpy.dtype(type(val)).kind == 'f'\n               for val in (start, stop, step)):\n            dtype = float\n        else:\n            dtype = int\n\n    if stop is None:\n        stop = start\n        start = 0\n    size = int(numpy.ceil((stop - start) / step))\n    if size <= 0:\n        return cupy.empty((0,), dtype=dtype)\n\n    ret = cupy.empty((size,), dtype=dtype)\n    typ = numpy.dtype(dtype).type\n    _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)\n    return ret\n\n\ndef linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):\n    \"\"\"Returns an array with evenly-spaced values within a given interval.\n\n    Instead of specifying the step width like :func:`cupy.arange`, this\n    function requires the total number of elements specified.\n\n    Args:\n        start: Start of the interval.\n        stop: End of the interval.\n        num: Number of elements.\n        endpoint (bool): If True, the stop value is included as the last\n            element. Otherwise, the stop value is omitted.\n        retstep (bool): If True, this function returns (array, step).\n            Otherwise, it returns only the array.\n        dtype: Data type specifier. It is inferred from the start and stop\n            arguments by default.\n\n    Returns:\n        cupy.ndarray: The 1-D array of ranged values.\n\n    \"\"\"\n    if num < 0:\n        raise ValueError('linspace with num<0 is not supported')\n\n    if dtype is None:\n        # In actual implementation, only float is used\n        dtype = float\n\n    ret = cupy.empty((num,), dtype=dtype)\n    if num == 0:\n        step = float('nan')\n    elif num == 1:\n        ret.fill(start)\n        step = float('nan')\n    else:\n        div = (num - 1) if endpoint else num\n        step = float(stop - start) / div\n        stop = float(stop)\n\n        if step == 0.0:\n            # for underflow\n            _linspace_ufunc_underflow(start, stop - start, div, ret,\n                                      casting='unsafe')\n        else:\n            _linspace_ufunc(start, step, ret, casting='unsafe')\n\n        if endpoint:\n            ret[-1] = stop\n\n    if retstep:\n        return ret, step\n    else:\n        return ret\n\n\n# TODO(okuta): Implement logspace\n\n\n# TODO(okuta): Implement meshgrid\n\n\n# mgrid\n# ogrid\n\n\n_arange_ufunc = core.create_ufunc(\n    'cupy_arange',\n    ('bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I', 'll->l', 'LL->L',\n     'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d'),\n    'out0 = in0 + i * in1')\n\n\n_linspace_ufunc = core.create_ufunc(\n    'cupy_linspace',\n    ('dd->d',),\n    'out0 = in0 + i * in1')\n\n_linspace_ufunc_underflow = core.create_ufunc(\n    'cupy_linspace',\n    ('ddd->d',),\n    'out0 = in0 + i * in1 / in2')\n", "path": "cupy/creation/ranges.py"}]}