transformers.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:async2rewrite 作者: TheTrain2000 项目源码 文件源码
def stateful_pin_message(self, call):
        if isinstance(call.func, ast.Attribute):
            if call.func.attr == 'pin_message':
                if self.interactive and not prompt_change(
                        'A possible change was found to make {} stateful.'.format(call.func.attr)
                ):
                    return call
                message = call.args[0]
                call.func.value = message
                call.func.attr = 'pin'
                call.args = []
            elif call.func.attr == 'unpin_message':
                if self.interactive and not prompt_change(
                        'A possible change was found to make {} stateful.'.format(call.func.attr)
                ):
                    return call
                message = call.args[0]
                call.func.value = message
                call.func.attr = 'unpin'
                call.args = []
                stats_counter['call_changes'] += 1
        return call
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号