def type_cast_value(self, ctx, value):
if self.type.is_composite:<EOL><INDENT>if self.nargs <= <NUM_LIT:1>:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % self.nargs)<EOL><DEDENT>if self.multiple:<EOL><INDENT>return tuple(self.type(x or (), self, ctx) for x in value or ())<EOL><DEDENT>return self.type(value or (), self, ctx)<EOL><DEDENT>def _convert(value, level):<EOL><INDENT>if level == <NUM_LIT:0>:<EOL><INDENT>return self.type(value, self, ctx)<EOL><DEDENT>return tuple(_convert(x, level - <NUM_LIT:1>) for x in value or ())<EOL><DEDENT>return _convert(value, (self.nargs != <NUM_LIT:1>) + bool(self.multiple))<EOL>
Given a value this runs it properly through the type system.
        This automatically handles things like `nargs` and `multiple` as
        well as composite types.