code: def test_slice_unknown_dims(self):
      class MD(DataSetFamily):
          extra_dims = [
              ("dim_0", {"a", "b", "c"}),
              ("dim_1", {"c", "d", "e"}),
          ]
  
      def expect_slice_fails(*args, **kwargs):
          expected_msg = kwargs.pop("expected_msg")
  
          with assert_raises_str(TypeError, expected_msg):
              MD.slice(*args, **kwargs)
  
      # insufficient positional
      expect_slice_fails(
          expected_msg=(
              "no coordinate provided to MD for the following dimensions:"
              " dim_0, dim_1"
          ),
      )
      expect_slice_fails(
          "a",
          expected_msg=(
              "no coordinate provided to MD for the following dimension:"
              " dim_1"
          ),
      )
  
      # too many positional
      expect_slice_fails(
          "a",
          "b",
          "c",
          expected_msg="MD has 2 extra dimensions but 3 were given",
      )
  
      # mismatched keys
      expect_slice_fails(
          dim_2="??",
          expected_msg=(
              "MD does not have the following dimension: dim_2\n"
              "Valid dimensions are: dim_0, dim_1"
          ),
      )
      expect_slice_fails(
          dim_1="??",
          dim_2="??",
          expected_msg=(
              "MD does not have the following dimension: dim_2\n"
              "Valid dimensions are: dim_0, dim_1"
          ),
      )
      expect_slice_fails(
          dim_0="??",
          dim_1="??",
          dim_2="??",
          expected_msg=(
              "MD does not have the following dimension: dim_2\n"
              "Valid dimensions are: dim_0, dim_1"
          ),
      )
  
      # the extra keyword dims should be sorted
      expect_slice_fails(
          dim_3="??",
          dim_2="??",
          expected_msg=(
              "MD does not have the following dimensions: dim_2, dim_3\n"
              "Valid dimensions are: dim_0, dim_1"
          ),
      )
  
file_path: zipline/tests/pipeline/test_multidimensional_dataset.py
imports: from collections import OrderedDict
  import itertools
  from textwrap import dedent
  from nose_parameterized import parameterized
  import numpy
  from zipline.pipeline.data import Column, DataSetFamily, DataSetFamilySlice
  from zipline.testing import ZiplineTestCase
  from zipline.testing.predicates import assert_equal, assert_is, assert_is_not, assert_is_subclass, assert_raises_str
label_desc: Use image node_id 6 for calling the TestDataSetFamily obj's underlying member method code with example usage: obj.test_slice_unknown_dims() without return types