def _determine_validator_type(self, data_type, value, has_default):
data_type, nullable = unwrap_nullable(data_type)<EOL>validator = None<EOL>if is_list_type(data_type):<EOL><INDENT>item_validator = self._determine_validator_type(<EOL>data_type.data_type, value, False)<EOL>item_validator = item_validator if item_validator else '<STR_LIT>'<EOL>validator = '<STR_LIT>'.format(<EOL>fmt_validator(data_type),<EOL>fmt_func_args([<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.min_items)<EOL>if data_type.min_items else '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.max_items)<EOL>if data_type.max_items else '<STR_LIT>'),<EOL>('<STR_LIT>', item_validator),<EOL>]))<EOL><DEDENT>elif is_map_type(data_type):<EOL><INDENT>item_validator = self._determine_validator_type(<EOL>data_type.value_data_type, value, False)<EOL>item_validator = item_validator if item_validator else '<STR_LIT>'<EOL>validator = '<STR_LIT>'.format(<EOL>fmt_validator(data_type),<EOL>fmt_func_args([<EOL>('<STR_LIT>', item_validator),<EOL>]))<EOL><DEDENT>elif is_numeric_type(data_type):<EOL><INDENT>if data_type.min_value or data_type.max_value:<EOL><INDENT>validator = '<STR_LIT>'.format(<EOL>fmt_validator(data_type),<EOL>fmt_func_args([<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.min_value)<EOL>if data_type.min_value else '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.max_value)<EOL>if data_type.max_value else '<STR_LIT>'),<EOL>]))<EOL><DEDENT><DEDENT>elif is_string_type(data_type):<EOL><INDENT>if data_type.pattern or data_type.min_length or data_type.max_length:<EOL><INDENT>pattern = data_type.pattern.encode('<STR_LIT>').replace(<EOL>"<STR_LIT>", "<STR_LIT>") if data_type.pattern else None<EOL>validator = '<STR_LIT>'.format(<EOL>fmt_validator(data_type),<EOL>fmt_func_args([<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.min_length)<EOL>if data_type.min_length else '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>'.format(data_type.max_length)<EOL>if data_type.max_length else '<STR_LIT>'),<EOL>('<STR_LIT>', '<STR_LIT>'.format(pattern)<EOL>if pattern else '<STR_LIT>'),<EOL>]))<EOL><DEDENT><DEDENT>if nullable:<EOL><INDENT>if validator:<EOL><INDENT>validator = fmt_func_call(<EOL>caller='<STR_LIT>', callee=validator)<EOL>validator = fmt_func_call(<EOL>caller='<STR_LIT>',<EOL>callee='<STR_LIT>',<EOL>args=validator)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if validator:<EOL><INDENT>validator = fmt_func_call(<EOL>caller='<STR_LIT>', callee=validator)<EOL><DEDENT>else:<EOL><INDENT>validator = '<STR_LIT>'<EOL><DEDENT>if not has_default:<EOL><INDENT>validator = fmt_func_call(<EOL>caller='<STR_LIT>',<EOL>callee='<STR_LIT>',<EOL>args=validator)<EOL><DEDENT>else:<EOL><INDENT>validator = None<EOL><DEDENT><DEDENT>return validator<EOL>
Returns validator string for given data type, else None.