def METHOD_NAME(self, key: Optional[str] = None) -> ContextCaller:
    """Get the context of rewriter.
    Args:
        key: key to the context.
    Returns:
        ContextCaller: context of function
    """
    func = None
    if key is None:
        func = get_frame_func(2)
        key = get_func_qualname(func)
    # get all contexts
    ctxs = self._func_contexts.get(key, [])
    if func is None:
        assert len(ctxs) == 1
        return ctxs[0]
    ctx = None
    for tmp_ctx in ctxs:
        if tmp_ctx.func == func:
            ctx = tmp_ctx
    if ctx is None:
        get_root_logger().warning(f'Can not found context of {key}')
    return ctx