transformers.py 文件源码

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

项目:async2rewrite 作者: TheTrain2000 项目源码 文件源码
def stateful_create_channel(self, call):
        if isinstance(call.func, ast.Attribute):
            if call.func.attr == 'create_channel':
                if self.interactive and not prompt_change(
                        'A possible change was found to make {} stateful.'.format(call.func.attr)
                ):
                    return call
                for kw in list(call.keywords):
                    if isinstance(kw.value, ast.Attribute):
                        channel_type = kw.value.attr
                        call.keywords.remove(kw)
                        break
                else:
                    channel_type = 'text'
                call.func.attr = 'create_{}_channel'.format(channel_type)
                guild = call.args[0]
                call.func.value = guild
                stats_counter['call_changes'] += 1
        return call
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号