We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
numpy.pad() issues on version 1.16
## 🐛 Bug

I had numpy version 1.16 and the `test_viewer.py` tests were failing because `np.pad()` was missing the `mode` positional argument (see below). I noticed that in [v1.17, `mode` is optional](https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.html) and when I upgraded numpy (1.17.3), the tests passed.

## To Reproduce

Steps to reproduce the behavior:

1. Install numpy version 1.16
2. run the tests in `/napari/tests/test_viewer.py`
3. Receive the following error

```python
self = <napari._vispy.vispy_shapes_layer.VispyShapesLayer object at 0x149450f28>

    def _on_data_change(self):
        faces = self.layer._data_view._mesh.displayed_triangles
        colors = self.layer._data_view._mesh.displayed_triangles_colors
        vertices = self.layer._data_view._mesh.vertices

        # Note that the indicies of the vertices need to be resversed to
        # go from numpy style to xyz
        if vertices is not None:
            vertices = vertices[:, ::-1] + 0.5

        if len(vertices) == 0 or len(faces) == 0:
            vertices = np.zeros((3, self.layer.dims.ndisplay))
            faces = np.array([[0, 1, 2]])
            colors = np.array([[0, 0, 0, 0]])

        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:
>           vertices = np.pad(vertices, ((0, 0), (0, 1)))
E           TypeError: pad() missing 1 required positional argument: 'mode'

../_vispy/vispy_shapes_layer.py:47: TypeError
```

## Expected behavior

Currently, the requirements specifty numpy >= 1.10.0, so I think we should bump to 1.17 (or the oldest version that passes).



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `napari/_vispy/vispy_vectors_layer.py`
Content:
```
1 from vispy.scene.visuals import Mesh as MeshNode
2 from .vispy_base_layer import VispyBaseLayer
3 import numpy as np
4 
5 
6 class VispyVectorsLayer(VispyBaseLayer):
7     def __init__(self, layer):
8         node = MeshNode()
9         super().__init__(layer, node)
10 
11         self.layer.events.edge_color.connect(lambda e: self._on_data_change())
12 
13         self._reset_base()
14         self._on_data_change()
15 
16     def _on_data_change(self):
17         if (
18             len(self.layer._view_vertices) == 0
19             or len(self.layer._view_faces) == 0
20         ):
21             vertices = np.zeros((3, self.layer.dims.ndisplay))
22             faces = np.array([[0, 1, 2]])
23         else:
24             vertices = self.layer._view_vertices[:, ::-1] + 0.5
25             faces = self.layer._view_faces
26 
27         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:
28             vertices = np.pad(vertices, ((0, 0), (0, 1)))
29 
30         self.node.set_data(
31             vertices=vertices, faces=faces, color=self.layer.edge_color
32         )
33         self.node.update()
34
```

Path: `napari/_vispy/vispy_shapes_layer.py`
Content:
```
1 from vispy.scene.visuals import Line, Mesh, Compound
2 from .markers import Markers
3 from .vispy_base_layer import VispyBaseLayer
4 import numpy as np
5 
6 
7 class VispyShapesLayer(VispyBaseLayer):
8     def __init__(self, layer):
9         # Create a compound visual with the following four subvisuals:
10         # Markers: corresponding to the vertices of the interaction box or the
11         # shapes that are used for highlights.
12         # Lines: The lines of the interaction box used for highlights.
13         # Mesh: The mesh of the outlines for each shape used for highlights.
14         # Mesh: The actual meshes of the shape faces and edges
15         node = Compound([Mesh(), Mesh(), Line(), Markers()])
16 
17         super().__init__(layer, node)
18 
19         self.layer.events.edge_width.connect(lambda e: self._on_data_change())
20         self.layer.events.edge_color.connect(lambda e: self._on_data_change())
21         self.layer.events.face_color.connect(lambda e: self._on_data_change())
22         self.layer.events.opacity.connect(lambda e: self._on_data_change())
23         self.layer.events.highlight.connect(
24             lambda e: self._on_highlight_change()
25         )
26 
27         self._reset_base()
28         self._on_data_change()
29         self._on_highlight_change()
30 
31     def _on_data_change(self):
32         faces = self.layer._data_view._mesh.displayed_triangles
33         colors = self.layer._data_view._mesh.displayed_triangles_colors
34         vertices = self.layer._data_view._mesh.vertices
35 
36         # Note that the indicies of the vertices need to be resversed to
37         # go from numpy style to xyz
38         if vertices is not None:
39             vertices = vertices[:, ::-1] + 0.5
40 
41         if len(vertices) == 0 or len(faces) == 0:
42             vertices = np.zeros((3, self.layer.dims.ndisplay))
43             faces = np.array([[0, 1, 2]])
44             colors = np.array([[0, 0, 0, 0]])
45 
46         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:
47             vertices = np.pad(vertices, ((0, 0), (0, 1)))
48 
49         self.node._subvisuals[0].set_data(
50             vertices=vertices, faces=faces, face_colors=colors
51         )
52         self.node.update()
53 
54     def _on_highlight_change(self):
55         # Compute the vertices and faces of any shape outlines
56         vertices, faces = self.layer._outline_shapes()
57 
58         if vertices is None or len(vertices) == 0 or len(faces) == 0:
59             vertices = np.zeros((3, self.layer.dims.ndisplay))
60             faces = np.array([[0, 1, 2]])
61         else:
62             vertices = vertices + 0.5
63 
64         self.node._subvisuals[1].set_data(
65             vertices=vertices, faces=faces, color=self.layer._highlight_color
66         )
67 
68         # Compute the location and properties of the vertices and box that
69         # need to get rendered
70         (
71             vertices,
72             face_color,
73             edge_color,
74             pos,
75             width,
76         ) = self.layer._compute_vertices_and_box()
77 
78         if vertices is None or len(vertices) == 0:
79             vertices = np.zeros((1, self.layer.dims.ndisplay))
80             size = 0
81         else:
82             vertices = vertices + 0.5
83             size = self.layer._vertex_size
84 
85         self.node._subvisuals[3].set_data(
86             vertices,
87             size=size,
88             face_color=face_color,
89             edge_color=edge_color,
90             edge_width=1.5,
91             symbol='square',
92             scaling=False,
93         )
94 
95         if pos is None or len(pos) == 0:
96             pos = np.zeros((1, self.layer.dims.ndisplay))
97             width = 0
98         else:
99             pos = pos + 0.5
100 
101         self.node._subvisuals[2].set_data(
102             pos=pos, color=edge_color, width=width
103         )
104 
105     def _on_opacity_change(self):
106         pass
107
```
--- 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()

```

diff --git a/napari/_vispy/vispy_shapes_layer.py b/napari/_vispy/vispy_shapes_layer.py
--- a/napari/_vispy/vispy_shapes_layer.py
+++ b/napari/_vispy/vispy_shapes_layer.py
@@ -44,7 +44,7 @@
             colors = np.array([[0, 0, 0, 0]])
 
         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:
-            vertices = np.pad(vertices, ((0, 0), (0, 1)))
+            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')
 
         self.node._subvisuals[0].set_data(
             vertices=vertices, faces=faces, face_colors=colors
diff --git a/napari/_vispy/vispy_vectors_layer.py b/napari/_vispy/vispy_vectors_layer.py
--- a/napari/_vispy/vispy_vectors_layer.py
+++ b/napari/_vispy/vispy_vectors_layer.py
@@ -25,7 +25,7 @@
             faces = self.layer._view_faces
 
         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:
-            vertices = np.pad(vertices, ((0, 0), (0, 1)))
+            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')
 
         self.node.set_data(
             vertices=vertices, faces=faces, color=self.layer.edge_color

{"golden_diff": "diff --git a/napari/_vispy/vispy_shapes_layer.py b/napari/_vispy/vispy_shapes_layer.py\n--- a/napari/_vispy/vispy_shapes_layer.py\n+++ b/napari/_vispy/vispy_shapes_layer.py\n@@ -44,7 +44,7 @@\n             colors = np.array([[0, 0, 0, 0]])\n \n         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n-            vertices = np.pad(vertices, ((0, 0), (0, 1)))\n+            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')\n \n         self.node._subvisuals[0].set_data(\n             vertices=vertices, faces=faces, face_colors=colors\ndiff --git a/napari/_vispy/vispy_vectors_layer.py b/napari/_vispy/vispy_vectors_layer.py\n--- a/napari/_vispy/vispy_vectors_layer.py\n+++ b/napari/_vispy/vispy_vectors_layer.py\n@@ -25,7 +25,7 @@\n             faces = self.layer._view_faces\n \n         if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n-            vertices = np.pad(vertices, ((0, 0), (0, 1)))\n+            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')\n \n         self.node.set_data(\n             vertices=vertices, faces=faces, color=self.layer.edge_color\n", "issue": "numpy.pad() issues on version 1.16\n## \ud83d\udc1b Bug\r\n\r\nI had numpy version 1.16 and the `test_viewer.py` tests were failing because `np.pad()` was missing the `mode` positional argument (see below). I noticed that in [v1.17, `mode` is optional](https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.html) and when I upgraded numpy (1.17.3), the tests passed.\r\n\r\n## To Reproduce\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Install numpy version 1.16\r\n2. run the tests in `/napari/tests/test_viewer.py`\r\n3. Receive the following error\r\n\r\n```python\r\nself = <napari._vispy.vispy_shapes_layer.VispyShapesLayer object at 0x149450f28>\r\n\r\n    def _on_data_change(self):\r\n        faces = self.layer._data_view._mesh.displayed_triangles\r\n        colors = self.layer._data_view._mesh.displayed_triangles_colors\r\n        vertices = self.layer._data_view._mesh.vertices\r\n\r\n        # Note that the indicies of the vertices need to be resversed to\r\n        # go from numpy style to xyz\r\n        if vertices is not None:\r\n            vertices = vertices[:, ::-1] + 0.5\r\n\r\n        if len(vertices) == 0 or len(faces) == 0:\r\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\r\n            faces = np.array([[0, 1, 2]])\r\n            colors = np.array([[0, 0, 0, 0]])\r\n\r\n        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\r\n>           vertices = np.pad(vertices, ((0, 0), (0, 1)))\r\nE           TypeError: pad() missing 1 required positional argument: 'mode'\r\n\r\n../_vispy/vispy_shapes_layer.py:47: TypeError\r\n```\r\n\r\n## Expected behavior\r\n\r\nCurrently, the requirements specifty numpy >= 1.10.0, so I think we should bump to 1.17 (or the oldest version that passes).\r\n\r\n\n", "before_files": [{"content": "from vispy.scene.visuals import Mesh as MeshNode\nfrom .vispy_base_layer import VispyBaseLayer\nimport numpy as np\n\n\nclass VispyVectorsLayer(VispyBaseLayer):\n    def __init__(self, layer):\n        node = MeshNode()\n        super().__init__(layer, node)\n\n        self.layer.events.edge_color.connect(lambda e: self._on_data_change())\n\n        self._reset_base()\n        self._on_data_change()\n\n    def _on_data_change(self):\n        if (\n            len(self.layer._view_vertices) == 0\n            or len(self.layer._view_faces) == 0\n        ):\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n        else:\n            vertices = self.layer._view_vertices[:, ::-1] + 0.5\n            faces = self.layer._view_faces\n\n        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n            vertices = np.pad(vertices, ((0, 0), (0, 1)))\n\n        self.node.set_data(\n            vertices=vertices, faces=faces, color=self.layer.edge_color\n        )\n        self.node.update()\n", "path": "napari/_vispy/vispy_vectors_layer.py"}, {"content": "from vispy.scene.visuals import Line, Mesh, Compound\nfrom .markers import Markers\nfrom .vispy_base_layer import VispyBaseLayer\nimport numpy as np\n\n\nclass VispyShapesLayer(VispyBaseLayer):\n    def __init__(self, layer):\n        # Create a compound visual with the following four subvisuals:\n        # Markers: corresponding to the vertices of the interaction box or the\n        # shapes that are used for highlights.\n        # Lines: The lines of the interaction box used for highlights.\n        # Mesh: The mesh of the outlines for each shape used for highlights.\n        # Mesh: The actual meshes of the shape faces and edges\n        node = Compound([Mesh(), Mesh(), Line(), Markers()])\n\n        super().__init__(layer, node)\n\n        self.layer.events.edge_width.connect(lambda e: self._on_data_change())\n        self.layer.events.edge_color.connect(lambda e: self._on_data_change())\n        self.layer.events.face_color.connect(lambda e: self._on_data_change())\n        self.layer.events.opacity.connect(lambda e: self._on_data_change())\n        self.layer.events.highlight.connect(\n            lambda e: self._on_highlight_change()\n        )\n\n        self._reset_base()\n        self._on_data_change()\n        self._on_highlight_change()\n\n    def _on_data_change(self):\n        faces = self.layer._data_view._mesh.displayed_triangles\n        colors = self.layer._data_view._mesh.displayed_triangles_colors\n        vertices = self.layer._data_view._mesh.vertices\n\n        # Note that the indicies of the vertices need to be resversed to\n        # go from numpy style to xyz\n        if vertices is not None:\n            vertices = vertices[:, ::-1] + 0.5\n\n        if len(vertices) == 0 or len(faces) == 0:\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n            colors = np.array([[0, 0, 0, 0]])\n\n        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n            vertices = np.pad(vertices, ((0, 0), (0, 1)))\n\n        self.node._subvisuals[0].set_data(\n            vertices=vertices, faces=faces, face_colors=colors\n        )\n        self.node.update()\n\n    def _on_highlight_change(self):\n        # Compute the vertices and faces of any shape outlines\n        vertices, faces = self.layer._outline_shapes()\n\n        if vertices is None or len(vertices) == 0 or len(faces) == 0:\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n        else:\n            vertices = vertices + 0.5\n\n        self.node._subvisuals[1].set_data(\n            vertices=vertices, faces=faces, color=self.layer._highlight_color\n        )\n\n        # Compute the location and properties of the vertices and box that\n        # need to get rendered\n        (\n            vertices,\n            face_color,\n            edge_color,\n            pos,\n            width,\n        ) = self.layer._compute_vertices_and_box()\n\n        if vertices is None or len(vertices) == 0:\n            vertices = np.zeros((1, self.layer.dims.ndisplay))\n            size = 0\n        else:\n            vertices = vertices + 0.5\n            size = self.layer._vertex_size\n\n        self.node._subvisuals[3].set_data(\n            vertices,\n            size=size,\n            face_color=face_color,\n            edge_color=edge_color,\n            edge_width=1.5,\n            symbol='square',\n            scaling=False,\n        )\n\n        if pos is None or len(pos) == 0:\n            pos = np.zeros((1, self.layer.dims.ndisplay))\n            width = 0\n        else:\n            pos = pos + 0.5\n\n        self.node._subvisuals[2].set_data(\n            pos=pos, color=edge_color, width=width\n        )\n\n    def _on_opacity_change(self):\n        pass\n", "path": "napari/_vispy/vispy_shapes_layer.py"}], "after_files": [{"content": "from vispy.scene.visuals import Mesh as MeshNode\nfrom .vispy_base_layer import VispyBaseLayer\nimport numpy as np\n\n\nclass VispyVectorsLayer(VispyBaseLayer):\n    def __init__(self, layer):\n        node = MeshNode()\n        super().__init__(layer, node)\n\n        self.layer.events.edge_color.connect(lambda e: self._on_data_change())\n\n        self._reset_base()\n        self._on_data_change()\n\n    def _on_data_change(self):\n        if (\n            len(self.layer._view_vertices) == 0\n            or len(self.layer._view_faces) == 0\n        ):\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n        else:\n            vertices = self.layer._view_vertices[:, ::-1] + 0.5\n            faces = self.layer._view_faces\n\n        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')\n\n        self.node.set_data(\n            vertices=vertices, faces=faces, color=self.layer.edge_color\n        )\n        self.node.update()\n", "path": "napari/_vispy/vispy_vectors_layer.py"}, {"content": "from vispy.scene.visuals import Line, Mesh, Compound\nfrom .markers import Markers\nfrom .vispy_base_layer import VispyBaseLayer\nimport numpy as np\n\n\nclass VispyShapesLayer(VispyBaseLayer):\n    def __init__(self, layer):\n        # Create a compound visual with the following four subvisuals:\n        # Markers: corresponding to the vertices of the interaction box or the\n        # shapes that are used for highlights.\n        # Lines: The lines of the interaction box used for highlights.\n        # Mesh: The mesh of the outlines for each shape used for highlights.\n        # Mesh: The actual meshes of the shape faces and edges\n        node = Compound([Mesh(), Mesh(), Line(), Markers()])\n\n        super().__init__(layer, node)\n\n        self.layer.events.edge_width.connect(lambda e: self._on_data_change())\n        self.layer.events.edge_color.connect(lambda e: self._on_data_change())\n        self.layer.events.face_color.connect(lambda e: self._on_data_change())\n        self.layer.events.opacity.connect(lambda e: self._on_data_change())\n        self.layer.events.highlight.connect(\n            lambda e: self._on_highlight_change()\n        )\n\n        self._reset_base()\n        self._on_data_change()\n        self._on_highlight_change()\n\n    def _on_data_change(self):\n        faces = self.layer._data_view._mesh.displayed_triangles\n        colors = self.layer._data_view._mesh.displayed_triangles_colors\n        vertices = self.layer._data_view._mesh.vertices\n\n        # Note that the indicies of the vertices need to be resversed to\n        # go from numpy style to xyz\n        if vertices is not None:\n            vertices = vertices[:, ::-1] + 0.5\n\n        if len(vertices) == 0 or len(faces) == 0:\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n            colors = np.array([[0, 0, 0, 0]])\n\n        if self.layer.dims.ndisplay == 3 and self.layer.dims.ndim == 2:\n            vertices = np.pad(vertices, ((0, 0), (0, 1)), mode='constant')\n\n        self.node._subvisuals[0].set_data(\n            vertices=vertices, faces=faces, face_colors=colors\n        )\n        self.node.update()\n\n    def _on_highlight_change(self):\n        # Compute the vertices and faces of any shape outlines\n        vertices, faces = self.layer._outline_shapes()\n\n        if vertices is None or len(vertices) == 0 or len(faces) == 0:\n            vertices = np.zeros((3, self.layer.dims.ndisplay))\n            faces = np.array([[0, 1, 2]])\n        else:\n            vertices = vertices + 0.5\n\n        self.node._subvisuals[1].set_data(\n            vertices=vertices, faces=faces, color=self.layer._highlight_color\n        )\n\n        # Compute the location and properties of the vertices and box that\n        # need to get rendered\n        (\n            vertices,\n            face_color,\n            edge_color,\n            pos,\n            width,\n        ) = self.layer._compute_vertices_and_box()\n\n        if vertices is None or len(vertices) == 0:\n            vertices = np.zeros((1, self.layer.dims.ndisplay))\n            size = 0\n        else:\n            vertices = vertices + 0.5\n            size = self.layer._vertex_size\n\n        self.node._subvisuals[3].set_data(\n            vertices,\n            size=size,\n            face_color=face_color,\n            edge_color=edge_color,\n            edge_width=1.5,\n            symbol='square',\n            scaling=False,\n        )\n\n        if pos is None or len(pos) == 0:\n            pos = np.zeros((1, self.layer.dims.ndisplay))\n            width = 0\n        else:\n            pos = pos + 0.5\n\n        self.node._subvisuals[2].set_data(\n            pos=pos, color=edge_color, width=width\n        )\n\n    def _on_opacity_change(self):\n        pass\n", "path": "napari/_vispy/vispy_shapes_layer.py"}]}