code: def _get_spec_width(
      spec_full_regex: str,
      spec_name: str,
      split: example_gen_pb2.Input.Split,
  ) -> Optional[str]:
      """Returns width modifier of a spec, if it exists."""
      result = re.search(spec_full_regex, split.pattern)
      assert result, "No %s found in split %s" % (
          spec_name,
          split.pattern,
      )
      width_str = result.group("width")
      if width_str:
          try:
              width_int = int(width_str)
              if width_int <= 0:
                  raise ValueError("Not a positive integer.")
          except ValueError:
              raise ValueError(
                  "Width modifier in %s spec is not a positive integer: %s"
                  % (spec_name, split.pattern)
              )
      return width_str
  
imports: import datetime
  import os
  import re
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  from absl import logging
  import numpy
  from tfx.dsl.io import fileio
  from tfx.proto import example_gen_pb2
  from tfx.proto import range_config_pb2
  from tfx.utils import io_utils
  from google.protobuf import json_format
  from tensorflow.core.example import example_pb2
  from tensorflow.core.example import feature_pb2
label_desc: Use image node_id 14 for calling a global function with example usage: _get_spec_width(spec_full_regex, spec_name, split) and returns: width_str