# Path: checkpy/entities/path.py
# class Path(object):
# 	def __init__(self, path):
# 	def fileName(self):
# 	def folderName(self):
# 	def containingFolder(self):
# 	def isPythonFile(self):
# 	def absolutePath(self):
# 	def exists(self):
# 	def walk(self):
# 	def copyTo(self, destination):
# 	def pathFromFolder(self, folderName):
# 	def __add__(self, other):
# 	def __sub__(self, other):
# 	def __iter__(self):
# 	def __hash__(self):
# 	def __eq__(self, other):
# 	def __contains__(self, item):
# 	def __len__(self):
# 	def __str__(self):
# 	def __repr__(self):
# 	def _join(self, drive, items):
# def current():
# CHECKPYPATH = Path(os.path.abspath(os.path.dirname(__file__))[:-len("/entities")])
# 
# Path: checkpy/entities/exception.py
# class CheckpyError(Exception):
# class SourceException(CheckpyError):
# class InputError(CheckpyError):
# class TestError(CheckpyError):
# class DownloadError(CheckpyError):
# class ExitError(CheckpyError):
# class PathError(CheckpyError):
# 	def __init__(self, exception = None, message = "", output = "", stacktrace = ""):
# 	def output(self):
# 	def stacktrace(self):
# 	def __str__(self):
# 	def __repr__(self):
# 
# Path: checkpy/entities/function.py
# class Function(object):
# class _Stream(io.StringIO):
# class _StreamListener(object):
# 	def __init__(self, function):
# 	def __call__(self, *args, **kwargs):
# 	def name(self):
# 	def arguments(self):
# 	def printOutput(self):
# 	def _captureStdout(self):
# 	def __init__(self, *args, **kwargs):
# 	def register(self, listener):
# 	def unregister(self, listener):
# 	def write(self, text):
# 	def writelines(self, sequence):
# 	def _onUpdate(self, content):
# 	def __init__(self, stream):
# 	def start(self):
# 	def stop(self):
# 	def update(self, content):
# 	def content(self):
# 	def stream(self):
# 
# Path: checkpy/caches.py
# class _Cache(dict):
# 	def __init__(self, *args, **kwargs):
# def cache(*keys):
# 	def cacheWrapper(func):
# 		def cachedFuncWrapper(*args, **kwargs):
# def clearAllCaches():


import sys
import re
	import StringIO
	import io as StringIO
import contextlib
import importlib
import imp
import tokenize
import traceback
import requests
from checkpy.entities import path
from checkpy.entities import exception
from checkpy.entities import function
from checkpy import caches
try:
	# Python 2
except:
	# Python 3

def require(fileName, source = None):
	if source:
		download(fileName, source)
		return

	filePath = path.userPath + fileName

	if not fileExists(str(filePath)):

# Path: checkpy/entities/path.py
# class Path(object):
# 	def __init__(self, path):
# 	def fileName(self):
# 	def folderName(self):
# 	def containingFolder(self):
# 	def isPythonFile(self):
# 	def absolutePath(self):
# 	def exists(self):
# 	def walk(self):
# 	def copyTo(self, destination):
# 	def pathFromFolder(self, folderName):
# 	def __add__(self, other):
# 	def __sub__(self, other):
# 	def __iter__(self):
# 	def __hash__(self):
# 	def __eq__(self, other):
# 	def __contains__(self, item):
# 	def __len__(self):
# 	def __str__(self):
# 	def __repr__(self):
# 	def _join(self, drive, items):
# def current():
# CHECKPYPATH = Path(os.path.abspath(os.path.dirname(__file__))[:-len("/entities")])
# 
# Path: checkpy/entities/exception.py
# class CheckpyError(Exception):
# class SourceException(CheckpyError):
# class InputError(CheckpyError):
# class TestError(CheckpyError):
# class DownloadError(CheckpyError):
# class ExitError(CheckpyError):
# class PathError(CheckpyError):
# 	def __init__(self, exception = None, message = "", output = "", stacktrace = ""):
# 	def output(self):
# 	def stacktrace(self):
# 	def __str__(self):
# 	def __repr__(self):
# 
# Path: checkpy/entities/function.py
# class Function(object):
# class _Stream(io.StringIO):
# class _StreamListener(object):
# 	def __init__(self, function):
# 	def __call__(self, *args, **kwargs):
# 	def name(self):
# 	def arguments(self):
# 	def printOutput(self):
# 	def _captureStdout(self):
# 	def __init__(self, *args, **kwargs):
# 	def register(self, listener):
# 	def unregister(self, listener):
# 	def write(self, text):
# 	def writelines(self, sequence):
# 	def _onUpdate(self, content):
# 	def __init__(self, stream):
# 	def start(self):
# 	def stop(self):
# 	def update(self, content):
# 	def content(self):
# 	def stream(self):
# 
# Path: checkpy/caches.py
# class _Cache(dict):
# 	def __init__(self, *args, **kwargs):
# def cache(*keys):
# 	def cacheWrapper(func):
# 		def cachedFuncWrapper(*args, **kwargs):
# def clearAllCaches():


# Path: checkpy/lib/basic.py
import sys
import re
	import StringIO
	import io as StringIO
import contextlib
import importlib
import imp
import tokenize
import traceback
import requests
from checkpy.entities import path
from checkpy.entities import exception
from checkpy.entities import function
from checkpy import caches

try:
	# Python 2
except:
	# Python 3

def require(fileName, source = None):
	if source:
		download(fileName, source)
		return

	filePath = path.userPath + fileName

	if not fileExists(str(filePath)):

		raise exception.CheckpyError("Required file {} does not exist".format(fileName))