code: def test_mesh_normals_length_scalar():
      size = (45, 40)
      with TestingCanvas(size=size, bgcolor="k") as c:
          v = c.central_widget.add_view(border_width=0)
          v.camera = "arcball"
          # Create visual.
          mdata = create_sphere(radius=1.0)
          mesh = scene.visuals.Mesh(
              meshdata=mdata, shading=None, color=(0.1, 0.1, 0.1, 1.0)
          )
          v.add(mesh)
  
          length = 0.5
          normals_0_5 = scene.visuals.MeshNormals(
              mdata, color=(1, 0, 0), length=length
          )
          normals_0_5.parent = mesh
          rendered_length_0_5 = c.render()
          normals_0_5.parent = None
  
          length = 1.0
          normals_1_0 = scene.visuals.MeshNormals(
              mdata, color=(1, 0, 0), length=length
          )
          normals_1_0.parent = mesh
          rendered_length_1_0 = c.render()
          normals_1_0.parent = None
  
          # There should be more red pixels with the longer normals.
          n_pixels_0_5 = np.sum(rendered_length_0_5[..., 0] > 128)
          n_pixels_1_0 = np.sum(rendered_length_1_0[..., 0] > 128)
          assert n_pixels_1_0 > n_pixels_0_5
  
file_path: vispy/vispy/visuals/tests/test_mesh_normals.py
imports: import numpy
  import pytest
  from vispy import scene
  from vispy.geometry import create_sphere
  from vispy.testing import TestingCanvas, requires_application, run_tests_if_main, requires_pyopengl
label_desc: Use image node_id 2 for calling a global function with example usage: test_mesh_normals_length_scalar() without return types