code: def test_var_names_filter(var_args):
      """Test var_names filter with partial naming or regular expressions."""
      samples = np.random.randn(10)
      data = dict_to_dataset(
          {
              "alpha": samples,
              "beta1": samples,
              "beta2": samples,
              "p1": samples,
              "p2": samples,
              "phi": samples,
              "theta": samples,
              "theta_t": samples,
          }
      )
      var_names, expected, filter_vars = var_args
      assert _var_names(var_names, data, filter_vars) == expected
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  import scipy.stats
  from ...data import dict_to_dataset, from_dict, load_arviz_data
  from ...stats.density_utils import _circular_mean, _normalize_angle, _find_hdi_contours
  from ...utils import _stack, _subset_list, _var_names, expand_dims, flatten_inference_data_to_dict, one_de, two_de
  from ..helpers import TestRandomVariable
label_desc: Use image node_id 7 for calling a global function with example usage: test_var_names_filter(var_args) without return types