common/misc.py
def validate(keyword, target):
	"""
	validation method to reduce malformed querys and unnecessary connection attempts
	:param keyword: used keyword
	:param target: provided target
	:return: true if valid
	"""
	# if keyword in domain_keywords list
	if keyword in StaticAnswers().keys('domain_keywords'):
		# if target is a domain / email return True
		if validators.domain(target) or validators.email(target):
			return True

	# check if keyword is in number_keyword list
	elif keyword in StaticAnswers().keys('number_keywords'):
		# prevent AttributeError if target is NoneType
		if target is not None:
			# if target only consists of digits return True
			return target.isdigit()

	# if keyword is in no_arg_keywords list return True
	elif keyword in StaticAnswers().keys("no_arg_keywords"):
		return True

	# if the target could not be validated until this return False
	return False

	validation method to reduce malformed querys and unnecessary connection attempts
	:param keyword: used keyword
	:param target: provided target
	:return: true if valid
	
validation method to reduce malformed querys and unnecessary connection attempts
validation method to reduce malformed querys and unnecessary connection attempts
def validate(keyword, target):
	if keyword in StaticAnswers().keys('domain_keywords'):
		if validators.domain(target) or validators.email(target):
			return True
	elif keyword in StaticAnswers().keys('number_keywords'):
		if target is not None:
			return target.isdigit()
	elif keyword in StaticAnswers().keys("no_arg_keywords"):
		return True
	return False
def validate ( keyword , target ) : if keyword in StaticAnswers ( ) . keys ( 'domain_keywords' ) : if validators . domain ( target ) or validators . email ( target ) : return True elif keyword in StaticAnswers ( ) . keys ( 'number_keywords' ) : if target is not None : return target . isdigit ( ) elif keyword in StaticAnswers ( ) . keys ( "no_arg_keywords" ) : return True return False
validation method to reduce malformed querys and unnecessary connection attempts
validation method to reduce malformed querys and unnecessary connection attempts
"""
	validation method to reduce malformed querys and unnecessary connection attempts
	:param keyword: used keyword
	:param target: provided target
	:return: true if valid
	""" # if keyword in domain_keywords list # if target is a domain / email return True # check if keyword is in number_keyword list # prevent AttributeError if target is NoneType # if target only consists of digits return True # if keyword is in no_arg_keywords list return True # if the target could not be validated until this return False
true if valid
true if valid
keyword
None
target
None