@contextlib.contextmanager
def completion(completer=None):
    delims = "()[]{} "
    if not completer:
        completer = Completer()

    if docomplete:
        readline.set_completer(completer.complete)
        readline.set_completer_delims(delims)

        history = os.path.expanduser("~/.hy-history")
        readline.parse_and_bind("set blink-matching-paren on")

        try:
            readline.read_history_file(history)
        except __HOLE__:
            open(history, 'a').close()

        readline.parse_and_bind(readline_bind)

    yield

    if docomplete:
        readline.write_history_file(history)
dataset/ETHPy150Open hylang/hy/hy/completer.py/completion