code: def test_get_indices_sizes():
      sizes = OrderedDict([("a", 2), ("b", 2), ("c", 2)])
      assert_equal(
          get_indices(["b"], sizes=sizes), torch.tensor([2, 3])
      )
      assert_equal(
          get_indices(["b", "c"], sizes=sizes),
          torch.tensor([2, 3, 4, 5]),
      )
      tensors = OrderedDict(
          [
              ("a", torch.ones(2)),
              ("b", torch.ones(2)),
              ("c", torch.ones(2)),
          ]
      )
      assert_equal(
          get_indices(["b"], tensors=tensors), torch.tensor([2, 3])
      )
      assert_equal(
          get_indices(["b", "c"], tensors=tensors),
          torch.tensor([2, 3, 4, 5]),
      )
  
file_path: pyro/tests/contrib/test_util.py
imports: from collections import OrderedDict
  import pytest
  import torch
  from pyro.contrib.util import get_indices, lexpand, rdiag, rexpand, rmv, rtril, rvv, tensor_to_dict
  from tests.common import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_indices_sizes() without return types