code: def get_runs(
      repo: str,
      branch: Optional[str] = None,
      user: Optional[str] = None,
      statuses: Iterable[str] = ("queued", "in_progress"),
      events: Iterable[str] = ("pull_request", "push"),
  ) -> list[dict[str, Any]]:
      """Get workflow runs associated with the given branch"""
      return [
          item
          for event in events
          for status in statuses
          for item in list_runs(
              repo, {"event": event, "status": status}
          )
          if (branch is None or (branch == item["head_branch"]))
          and (
              user is None
              or (user == item["head_repository"]["owner"]["login"])
          )
      ]
  
file_path: superset/scripts/cancel_github_workflows.py
imports: import os
  from collections.abc import Iterable, Iterator
  from typing import Any, Literal, Optional, Union
  import click
  import requests
  from click.exceptions import ClickException
  from dateutil import parser
label_desc: Use image node_id 5 for calling a global function with example usage: get_runs(repo, branch, user, statuses, events) and returns: unknown