# Path: qubricks/utility/text.py
# def colour_text(text, colour_name='WHITE', bold=False):
#     if colour_name in COLOURS:
#         return '\033[{0};{1}m{2}\033[0m'.format(
#             int(bold), COLOURS.index(colour_name) + 30, text)
#     sys.stderr.write('ERROR: "{0}" is not a valid colour.\n'.format(colour_name))
#     sys.stderr.write('VALID COLOURS: {0}.\n'.format(', '.join(COLOURS)))


from abc import ABCMeta, abstractmethod
from ..utility.text import colour_text as coloured
import sys
import traceback
				return args[0]
			else:
				return args
		elif len(args) == 0:
			return kwargs
		else:
			return args, kwargs
	
	def wrap(f):
		fname = f.__name__
		if fname.startswith('__'):
			fname = fname[2:]
		
		def wrapped(self, *args, **kwargs):
			
			# If arguments provided, use them
			if len(args) > 0 or len(kwargs) > 0:
				return f(self, *args, **kwargs)
			
			# Otherwise, use the existing results, generating them as required
			if not private(self, '__%s'%fname, False):
				if dependency is not None:
					dependency_f = getattr(self, dependency, None)
					if dependency_f is None:
						raise ValueError("Unknown method: %s" % dependency)
					
					if private(self, '__%s'%dependency) is None:
						dependency_f()
				
				if message is not None:

# Path: qubricks/utility/text.py
# def colour_text(text, colour_name='WHITE', bold=False):
#     if colour_name in COLOURS:
#         return '\033[{0};{1}m{2}\033[0m'.format(
#             int(bold), COLOURS.index(colour_name) + 30, text)
#     sys.stderr.write('ERROR: "{0}" is not a valid colour.\n'.format(colour_name))
#     sys.stderr.write('VALID COLOURS: {0}.\n'.format(', '.join(COLOURS)))


# Path: qubricks/analysis/model.py
from abc import ABCMeta, abstractmethod
from ..utility.text import colour_text as coloured
import sys
import traceback

				return args[0]
			else:
				return args
		elif len(args) == 0:
			return kwargs
		else:
			return args, kwargs
	
	def wrap(f):
		fname = f.__name__
		if fname.startswith('__'):
			fname = fname[2:]
		
		def wrapped(self, *args, **kwargs):
			
			# If arguments provided, use them
			if len(args) > 0 or len(kwargs) > 0:
				return f(self, *args, **kwargs)
			
			# Otherwise, use the existing results, generating them as required
			if not private(self, '__%s'%fname, False):
				if dependency is not None:
					dependency_f = getattr(self, dependency, None)
					if dependency_f is None:
						raise ValueError("Unknown method: %s" % dependency)
					
					if private(self, '__%s'%dependency) is None:
						dependency_f()
				
				if message is not None:

					print coloured(message, "YELLOW", True),