code: def get_pattern():
      run_id_pattern = r"(?P<overwrite>\d{1,12})"
      port1_pattern = r"(?P<port1>\d{1,5})"
      port2_pattern = r"(?P<port2>\d{1,5})"
      priority_pattern = r"(?P<priority>-?\d+)?"
      db_name_pattern = (
          r"(?P<db_name>[_A-Za-z]"
          r"[0-9A-Za-z#%&'()+\-;=@\[\]^_{}]{0,63})"
      )
      coll_name_pattern = (
          r"(?P<collection>[_A-Za-z]"
          r"[0-9A-Za-z#%&'()+\-;=@\[\]^_{}]{0,63})"
      )
      hostname1_pattern = (
          r"(?P<host1>"
          r"[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?"
          r"(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}"
          r"[0-9A-Za-z])?)*)"
      )
      hostname2_pattern = (
          r"(?P<host2>"
          r"[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?"
          r"(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}"
          r"[0-9A-Za-z])?)*)"
      )
  
      host_only = r"^(?:{host}:{port})$".format(
          host=hostname1_pattern, port=port1_pattern
      )
      full = (
          r"^(?:{host}:{port}:)?{db}(?:\.{collection}(?::{rid})?)?"
          r"(?:!{priority})?$".format(
              host=hostname2_pattern,
              port=port2_pattern,
              db=db_name_pattern,
              collection=coll_name_pattern,
              rid=run_id_pattern,
              priority=priority_pattern,
          )
      )
  
      return r"{host_only}|{full}".format(
          host_only=host_only, full=full
      )
  
imports: from typing import Optional, Union
  import mimetypes
  import os.path
  import pickle
  import re
  import sys
  import time
  from tempfile import NamedTemporaryFile
  import warnings
  import sacred.optional
  from sacred.commandline_options import cli_option
  from sacred.dependencies import get_digest
  from sacred.observers.base import RunObserver
  from sacred.observers.queue import QueueObserver
  from sacred.serializer import flatten
  from sacred.utils import ObserverError, PathType
  import pkg_resources
label_desc: Use image node_id 4 for calling a global function with example usage: get_pattern() and returns: str