in muss/utils/helpers.py [0:0]
def yield_lines(filepath, gzipped=False, n_lines=None):
filepath = Path(filepath)
open_function = open
if gzipped or filepath.name.endswith('.gz'):
open_function = gzip.open
with open_function(filepath, 'rt', encoding='utf-8') as f:
for i, l in enumerate(f):
if n_lines is not None and i >= n_lines:
break
yield l.rstrip('\n')