import pickle


def load(filename):
	"""
	Loads an item from filename.
	Returns the object that was saved in filename.
	Throws IOError if File DNE.
	Throws PickleError is file cannot be opened via pickle.
	"""
	obj = None
	try:
		with open(filename, 'rb') as reader:
			obj = pickle.load(reader)
	except IOError:
		raise Exception("Exception while reading the file %s." % filename)
	except pickle.PickleError:
		raise Exception("Exception while loading pickle.")
	return obj