def create_validator(data_struct_dict, name=None):
if name is None:<EOL><INDENT>name = '<STR_LIT>'<EOL><DEDENT>attrs = {}<EOL>for field_name, field_info in six.iteritems(data_struct_dict):<EOL><INDENT>field_type = field_info['<STR_LIT:type>']<EOL>if field_type == DictField.FIELD_TYPE_NAME and isinstance(field_info.get('<STR_LIT>'), dict):<EOL><INDENT>field_info['<STR_LIT>'] = create_validator(field_info['<STR_LIT>'])<EOL><DEDENT>attrs[field_name] = create_field(field_info)<EOL><DEDENT>name = force_str(name)<EOL>return type(name, (Validator, ), attrs)<EOL>
create a Validator instance from data_struct_dict

:param data_struct_dict: a dict describe validator's fields, like the dict `to_dict()` method returned.
:param name: name of Validator class 

:return: Validator instance