code: def filtered_runs(
      filter,
      root=None,
      sort=None,
      base_filter=None,
      force_root=False,
      index=None,
      base_runs=None,
  ):
      runs = var.runs(
          root=root,
          sort=sort,
          filter=base_filter,
          force_root=force_root,
          base_runs=base_runs,
      )
      if not filter:
          return runs
      if isinstance(filter, str):
          filter = filterlib.parser().parse(filter)
      index = index or indexlib.RunIndex()
      index.refresh(runs, _index_refresh_types(filter))
      return [run for run in runs if _filter_run(filter, run, index)]
  
file_path: guildai/guild/filter_util.py
imports: from guild import filter
  from guild import index
  from guild import var
label_desc: Use image node_id 3 for calling a global function with example usage: filtered_runs(filter, root, sort, base_filter, force_root, index, base_runs) and returns: unknown, runs