code: def v_factors(xcol, ymatr):
      """xcol is (Nobservations,1) column vector of grouping values
          (in terms of dose curve it may be Dose).
      ymatr is (Nobservations, Nmeasures) matrix, where rows correspond to
          observations and columns corresponds to different measures.
  
       Calculate the V factor = 1-6 * mean standard deviation / range
      """
      xs, avers, stds = loc_shrink_mean_std(xcol, ymatr)
      #
      # Range of averages per label
      #
      vrange = numpy.max(avers, 0) - numpy.min(avers, 0)
      #
      # Special handling for labels that have no ranges
      #
      vstd = numpy.zeros(len(vrange))
      vstd[vrange == 0] = 1
      vstd[vrange != 0] = numpy.mean(stds[:, vrange != 0], 0)
      vrange[vrange == 0] = 0.000001
      v = 1 - 6 * (vstd / vrange)
      return v
  
imports: import functools
  import os
  import numpy
  import scipy.optimize
  from cellprofiler_core.constants.measurement import EXPERIMENT
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.constants.measurement import NEIGHBORS
  from cellprofiler_core.constants.module import IO_FOLDER_CHOICE_HELP_TEXT, IO_WITH_METADATA_HELP_TEXT
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import ABSOLUTE_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_INPUT_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_INPUT_SUBFOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_FOLDER_NAME
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_SUBFOLDER_NAME
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.do_something import DoSomething
  from cellprofiler_core.setting.do_something import RemoveSettingButton
  from cellprofiler_core.setting.text import Directory
  from cellprofiler_core.setting.text import Text
label_desc: Use image node_id 2 for calling a global function with example usage: v_factors(xcol, ymatr) and returns: v