def _instantiate_data_type(self, data_type_class, data_type_args, loc):
assert issubclass(data_type_class, DataType),'<STR_LIT>' % data_type_class<EOL>argspec = inspect.getargspec(data_type_class.__init__)  <EOL>argspec.args.remove('<STR_LIT>')<EOL>num_args = len(argspec.args)<EOL>num_defaults = len(argspec.defaults or ())<EOL>pos_args, kw_args = data_type_args<EOL>if (num_args - num_defaults) > len(pos_args):<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' %<EOL>(quote(argspec.args[len(pos_args)]),<EOL>quote(data_type_class.__name__)),<EOL>*loc)<EOL><DEDENT>elif (num_args - num_defaults) < len(pos_args):<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>' %<EOL>quote(data_type_class.__name__),<EOL>*loc)<EOL><DEDENT>args = {}<EOL>for i, key in enumerate(argspec.args):<EOL><INDENT>args[key] = (i >= num_args - num_defaults)<EOL><DEDENT>for key in kw_args:<EOL><INDENT>if key not in args:<EOL><INDENT>raise InvalidSpec('<STR_LIT>' %<EOL>(quote(key), quote(data_type_class.__name__)),<EOL>*loc)<EOL><DEDENT>if not args[key]:<EOL><INDENT>raise InvalidSpec(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % quote(key),<EOL>*loc)<EOL><DEDENT>del args[key]<EOL><DEDENT>try:<EOL><INDENT>return data_type_class(*pos_args, **kw_args)<EOL><DEDENT>except ParameterError as e:<EOL><INDENT>raise InvalidSpec('<STR_LIT>' %<EOL>(quote(data_type_class.__name__), e.args[<NUM_LIT:0>]),<EOL>*loc)<EOL><DEDENT>
Responsible for instantiating a data type with additional attributes.
This method ensures that the specified attributes are valid.

Args:
    data_type_class (DataType): The class to instantiate.
    data_type_attrs (dict): A map from str -> values of attributes.
        These will be passed into the constructor of data_type_class
        as keyword arguments.

Returns:
    stone.data_type.DataType: A parameterized instance.