class SolutionMissingError(Exception):
    def __init__(self):
        Exception.__init__(self,"You need to complete the solution for this code to work!")
def REPLACE_WITH_YOUR_SOLUTION():
    raise SolutionMissingError
REMOVE_THIS_LINE = REPLACE_WITH_YOUR_SOLUTION

"""
Explanation: This notebook is developed as part of the KIPAC/StatisticalMethods course, (c) 2019 Adam Mantz, licensed under the GPLv2.
What's the deal with REPLACE_WITH_YOUR_SOLUTION?
Tutorial notebooks from KIPAC/StatisticalMethods will all start with these definitions:
End of explanation
"""


# Set x equal to something
try:
    exec(open('solutions/setx.py').read())
except IOError:
    x = REPLACE_WITH_YOUR_SOLUTION()

"""
Explanation: You'll then see cells that look something like this:
End of explanation
"""


# Set x equal to something
x = 5.0

"""
Explanation: Go ahead and try to run it. You'll get an error traceback, the end of which points out that you've neglected to provide a solution to the posed problem. This is our preferred method of providing incomplete code, since an alternative like
python
x = # set x equal to something
will throw a different and less informative error if you accidentally run the cell before completing it.
The try-except wrapper is there so that we, the developers, can easily verify that the entire notebook runs if provided with a correct solution. There is no need for you to write solutions for each cell in separate files, and doing so will just make this notebook harder for you to use later. Instead, we suggest removing the try-except construction entirely, so your completed notebook cell would look like
End of explanation
"""


# Define a function that does stuff
try:
    exec(open('solutions/func.py').read())
except IOError:
    REMOVE_THIS_LINE()
    def myfunc(a, b):
        c = REPLACE_WITH_YOUR_SOLUTION()
        return REPLACE_WITH_YOUR_SOLUTION()

"""
Explanation: You'll also see cells in this format:
End of explanation
"""


