code: def page_sort_key(script_path: Path) -> Tuple[float, str]:
      matches = re.findall(PAGE_FILENAME_REGEX, script_path.name)
  
      # Failing this assert should only be possible if script_path isn't a Python
      # file, which should never happen.
      assert len(matches) > 0, f"{script_path} is not a Python file"
  
      [(number, label)] = matches
      label = label.lower()
  
      if number == "":
          return (float("inf"), label)
  
      return (float(number), label)
  
file_path: streamlit/lib/streamlit/source_util.py
imports: import re
  import threading
  from pathlib import Path
  from typing import Any, Callable, Dict, Optional, Tuple, cast
  from blinker import Signal
  from streamlit.logger import get_logger
  from streamlit.string_util import extract_leading_emoji
  from streamlit.util import calc_md5
label_desc: Use image node_id 2 for calling a global function with example usage: page_sort_key(script_path) and returns: float,  label, float,  label