code: def update_max_version(src, key, new_max_version, category):
      """
      Examples
      ========
      >>> src = '''
      ... sklearn:
      ...   ...
      ...   models:
      ...     minimum: "0.0.0"
      ...     maximum: "0.0.0"
      ... xgboost:
      ...   ...
      ...   autologging:
      ...     minimum: "1.1.1"
      ...     maximum: "1.1.1"
      ... '''.strip()
      >>> new_src = update_max_version(src, "sklearn", "0.1.0", "models")
      >>> new_src = update_max_version(new_src, "xgboost", "1.2.1", "autologging")
      >>> print(new_src)
      sklearn:
        ...
        models:
          minimum: "0.0.0"
          maximum: "0.1.0"
      xgboost:
        ...
        autologging:
          minimum: "1.1.1"
          maximum: "1.2.1"
      """
      pattern = r"((^|\n){key}:.+?{category}:.+?maximum: )\".+?\"".format(  # noqa: UP032
          key=re.escape(key), category=category
      )
      # Matches the following pattern:
      #
      # <key>:
      #   ...
      #   <category>:
      #     ...
      #     maximum: "1.2.3"
      return re.sub(
          pattern, rf'\g<1>"{new_max_version}"', src, flags=re.DOTALL
      )
  
file_path: mlflow/dev/update_ml_package_versions.py
imports: import json
  import re
  import urllib.request
  from pathlib import Path
  import yaml
  from packaging.version import Version
label_desc: Use image node_id 5 for calling a global function with example usage: update_max_version(src, key, new_max_version, category) and returns: re