import functools
import warnings


def suppress_warning(func):
	"""Runs a function with warnings suppressed"""

	@functools.wraps(func)
	def bad_func(*args, **kwargs):
		"""Wraps a function in try-except"""
		theOutput = None
		with warnings.catch_warnings():
			warnings.filterwarnings("ignore", message=".*", module="piaplib*")
			theOutput = func(*args, **kwargs)
		return theOutput

	return bad_func