code: def loc_shrink_mean_std(xcol, ymatr):
      """Compute mean and standard deviation per label
  
      xcol - column of image labels or doses
      ymatr - a matrix with rows of values per image and columns
              representing different measurements
  
      returns xs - a vector of unique doses
              avers - the average value per label
              stds - the standard deviation per label
      """
      ncols = ymatr.shape[1]
      labels, labnum, xs = loc_vector_labels(xcol)
      avers = numpy.zeros((labnum, ncols))
      stds = avers.copy()
      for ilab in range(labnum):
          labinds = labels == ilab
          labmatr = ymatr[labinds, :]
          if labmatr.shape[0] == 1:
              avers[ilab, :] = labmatr[0, :]
          else:
              avers[ilab, :] = numpy.mean(labmatr, 0)
              stds[ilab, :] = numpy.std(labmatr, 0)
      return xs, avers, stds
  
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 3 for calling a global function with example usage: loc_shrink_mean_std(xcol, ymatr) and returns: xs,  avers,  stds