@contextmanager
def flock(filename=None):
    with open(filename, 'a') as fh:
        _flock(fh, LOCK_EX)
        yield
        _flock(fh, LOCK_UN)
This will be inserted into the page context's sections variable
dataset/ETHPy150Open Netflix/aminator/aminator/util/linux.py/flock--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/styleguide/views/__init__.py/BaseStyleGuideArticleView.sections