code: def _glob_to_regex(glob_pattern: str) -> str:
      """Changes glob pattern to regex pattern."""
      regex_pattern = glob_pattern
      regex_pattern = regex_pattern.replace("\\", "\\\\")
      regex_pattern = regex_pattern.replace(".", r"\.")
      regex_pattern = regex_pattern.replace("+", r"\+")
      regex_pattern = regex_pattern.replace("*", r"[^\\/]*")
      regex_pattern = regex_pattern.replace("?", r"[^\\/]")
      regex_pattern = regex_pattern.replace("(", r"\(")
      regex_pattern = regex_pattern.replace(")", r"\)")
      return regex_pattern
  
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 6 for calling a global function with example usage: _glob_to_regex(glob_pattern) and returns: regex_pattern