code: def test_expand_indices_moved_subspaces(A_parts, indices):
      A = pt.stack(A_parts)
      at_indices = [as_index_constant(idx) for idx in indices]
      full_indices = expand_indices(at_indices, shape_tuple(A))
      assert len(full_indices) == A.ndim
      exp_res = A[indices].eval()
      res = A[full_indices].eval()
      assert np.array_equal(res, exp_res)
  
imports: import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  import scipy.stats.distributions
  from pytensor import function
  from pytensor.graph.basic import Variable
  from pytensor.ifelse import ifelse
  from pytensor.tensor.random.basic import CategoricalRV
  from pytensor.tensor.shape import shape_tuple
  from pytensor.tensor.subtensor import AdvancedSubtensor, AdvancedSubtensor1, Subtensor, as_index_constant
  from pymc.logprob.abstract import MeasurableVariable
  from pymc.logprob.basic import conditional_logp, logp
  from pymc.logprob.mixture import MeasurableSwitchMixture, expand_indices
  from pymc.logprob.rewriting import construct_ir_fgraph
  from pymc.logprob.utils import dirac_delta
  from pymc.testing import assert_no_rvs
  from tests.logprob.utils import scipy_logprob
label_desc: Use image node_id 6 for calling a global function with example usage: test_expand_indices_moved_subspaces(A_parts, indices) without return types