code: def expand_config(config):
      matrix = set()
      for name, cfgs in config.items():
          flavor = get_flavor(name)
          package_info = PackageInfo(**cfgs.pop("package_info"))
          all_versions = get_released_versions(package_info.pip_release)
          for category, cfg in cfgs.items():
              cfg = TestConfig(**cfg)
              versions = filter_versions(
                  all_versions,
                  cfg.minimum,
                  cfg.maximum,
                  cfg.unsupported or [],
                  allow_unreleased_max_version=cfg.allow_unreleased_max_version
                  or False,
              )
              versions = get_latest_micro_versions(versions)
  
              # Always test the minimum version
              if cfg.minimum not in versions:
                  versions.append(cfg.minimum)
  
              for ver in versions:
                  requirements = [f"{package_info.pip_release}=={ver}"]
                  requirements.extend(
                      get_matched_requirements(
                          cfg.requirements or {}, str(ver)
                      )
                  )
                  install = make_pip_install_command(requirements)
                  run = remove_comments(cfg.run)
  
                  matrix.add(
                      MatrixItem(
                          name=name,
                          flavor=flavor,
                          category=category,
                          job_name=f"{name} / {category} / {ver}",
                          install=install,
                          run=run,
                          package=package_info.pip_release,
                          version=ver,
                          supported=ver <= cfg.maximum,
                      )
                  )
  
              if package_info.install_dev:
                  install_dev = remove_comments(
                      package_info.install_dev
                  )
                  requirements = get_matched_requirements(
                      cfg.requirements or {}, DEV_VERSION
                  )
                  if requirements:
                      install = (
                          make_pip_install_command(requirements)
                          + "\n"
                          + install_dev
                      )
                  else:
                      install = install_dev
  
                  run = remove_comments(cfg.run)
                  dev_version = Version.create_dev()
                  matrix.add(
                      MatrixItem(
                          name=name,
                          flavor=flavor,
                          category=category,
                          job_name=f"{name} / {category} / {dev_version}",
                          install=install,
                          run=run,
                          package=package_info.pip_release,
                          version=dev_version,
                          supported=False,
                      )
                  )
      return matrix
  
imports: import argparse
  import functools
  import json
  import os
  import re
  import shutil
  import sys
  import typing
  from collections import defaultdict
  import requests
  import yaml
  from packaging.specifiers import SpecifierSet
  from packaging.version import InvalidVersion
  from packaging.version import Version
  from pydantic import BaseModel, validator
label_desc: Use image node_id 13 for calling a global function with example usage: expand_config(config) and returns: matrix