code: def get_matching_version(
      assets: list[ThemeAsset], expression: str | None
  ) -> ThemeAsset | None:
      expression = expression or "*"
  
      # Return most recent version that matches
      matching_version = semantic_version.SimpleSpec(expression).select(
          [a.version for a in assets]
      )
  
      return next(
          (a for a in assets if a.version == matching_version), None
      )
  
file_path: gradio/gradio/themes/utils/semver_match.py
imports: from __future__ import annotations
  from dataclasses import dataclass, field
  import huggingface_hub
  import semantic_version
  import semantic_version
label_desc: Use image node_id 2 for calling a global function with example usage: get_matching_version(assets, expression) and returns: next