There are major issues in the code, and it should not be used in its current state. I suggest you investigate https://bitbucket.org/chchrsc/python-fmask instead
Python version of the FMask Landsat Cloud Masking code
Install the Python requirements listed in requirements.txt, and also ensure that you have GDAL installed (with Python bindings)
This code is licensed under the GPL v2, see the LICENSE.md file for more details.
The code was taken from https://github.com/ceholden/config_fmask and modified slightly (with most modifications contributed back to this project). That code, in turn, was taken from a near-literal port of the original Matlab FMask code by Mitchell Wheeler and Josh Sixsmith