code: def _add_measurement(m, layer_str, config):
      """Updates ``layer_str`` with the ``m`` measurement."""
      if m.mv is not None:
          return _add_cwire_measurement(m, layer_str, config)
  
      layer_str = _add_grouping_symbols(m, layer_str, config)
  
      if m.obs is None:
          obs_label = None
      else:
          obs_label = m.obs.label(
              decimals=config.decimals, cache=config.cache
          ).replace("\n", "")
      if m.return_type in measurement_label_map:
          meas_label = measurement_label_map[m.return_type](obs_label)
      else:
          meas_label = m.return_type.value
  
      if len(m.wires) == 0:  # state or probability across all wires
          for i, s in enumerate(layer_str):
              layer_str[i] = s + meas_label
  
      for w in m.wires:
          layer_str[config.wire_map[w]] += meas_label
      return layer_str
  
file_path: pennylane/pennylane/drawer/tape_text.py
imports: from dataclasses import dataclass
  from typing import Optional
  import pennylane
  from pennylane.measurements import Expectation, Probability, Sample, Variance, State, Counts, MidMeasureMP
  from .drawable_layers import drawable_layers
  from .utils import convert_wire_order, unwrap_controls, cwire_connections, default_bit_map
label_desc: Use image node_id 8 for calling a global function with example usage: _add_measurement(m, layer_str, config) and returns: layer_str, _add_cwire_measurement