import base64


def readDataOrPath(dataStr):
	"""
	Reads in either base64 data or a path.
	"""
	if dataStr.startswith('base64:'):
		dataPath = None
		dataContents = base64.b64decode(dataStr[7:])
	else:
		dataPath = dataStr
		with open(dataStr, 'rb') as stream:
			dataContents = stream.read()
	return dataPath, dataContents