<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def check_permission(bot: NoneBot, ctx: Context_T, permission_required: int) -> bool: """ Check if the context has the permission required. :param bot: NoneBot instance :param ctx: message context :param permission_required: permission required :return: the context has the permission """

    min_ctx_kwargs = {}
    for field in _min_context_fields:
        if field in ctx:
            min_ctx_kwargs[field] = ctx[field]
        else:
            min_ctx_kwargs[field] = None
    min_ctx = _MinContext(**min_ctx_kwargs)
    return await _check(bot, min_ctx, permission_required)