Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def fit(files):
HMM_FILE = os.path.join(os.path.dirname(__file__), 'barlines_hmm.pkl')
model = hmm.BernoulliMultiHMM(n_components=100)
staves = []
for filename in files:
try:
pages = moonshine.open(filename)
except Exception:
import traceback
traceback.print_exc()
continue
if not (0 < len(pages) <= 100):
continue
print filename
for page in pages:
gc.collect()
page.preprocess()
if type(page.staff_dist) is not int: