当前位置: 首页 > news >正文

大港油田建设官方网站怎么帮人做网站

大港油田建设官方网站,怎么帮人做网站,沁阳建网站,第二季企业网站开发本文整理汇总了Python中asyncio.isfuture方法的典型用法代码示例。如果您正苦于以下问题#xff1a;Python asyncio.isfuture方法的具体用法#xff1f;Python asyncio.isfuture怎么用#xff1f;Python asyncio.isfuture使用的例子#xff1f;那么恭喜您, 这里精选的方法代…本文整理汇总了Python中asyncio.isfuture方法的典型用法代码示例。如果您正苦于以下问题Python asyncio.isfuture方法的具体用法Python asyncio.isfuture怎么用Python asyncio.isfuture使用的例子那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块asyncio的用法示例。在下文中一共展示了asyncio.isfuture方法的10个代码示例这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞您的评价将有助于我们的系统推荐出更棒的Python代码示例。示例1: test_isfuture​点赞 6​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_isfuture(self):class MyFuture:_asyncio_future_blocking Nonedef __init__(self):self._asyncio_future_blocking Falseself.assertFalse(asyncio.isfuture(MyFuture))self.assertTrue(asyncio.isfuture(MyFuture()))self.assertFalse(asyncio.isfuture(1))self.assertFalse(asyncio.isfuture(asyncio.Future))# As isinstance(Mock(), Future) returns Falseself.assertFalse(asyncio.isfuture(mock.Mock()))# As isinstance(Mock(Future), Future) returns Trueself.assertTrue(asyncio.isfuture(mock.Mock(asyncio.Future)))f asyncio.Future(loopself.loop)self.assertTrue(asyncio.isfuture(f))f.cancel()开发者ID:ShikyoKira项目名称:Project-New-Reign---Nemesis-Main代码行数:24示例2: test_isfuture​点赞 6​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_isfuture(self):class MyFuture:_asyncio_future_blocking Nonedef __init__(self):self._asyncio_future_blocking Falseself.assertFalse(asyncio.isfuture(MyFuture))self.assertTrue(asyncio.isfuture(MyFuture()))self.assertFalse(asyncio.isfuture(1))# As isinstance(Mock(), Future) returns Falseself.assertFalse(asyncio.isfuture(mock.Mock()))f self._new_future(loopself.loop)self.assertTrue(asyncio.isfuture(f))self.assertFalse(asyncio.isfuture(type(f)))# As isinstance(Mock(Future), Future) returns Trueself.assertTrue(asyncio.isfuture(mock.Mock(type(f))))f.cancel()开发者ID:bkerler项目名称:android_universal代码行数:24示例3: test_api_calls_return_a_response_when_run_in_sync_mode​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_api_calls_return_a_response_when_run_in_sync_mode(self):self.client.token xoxb-api_testresp self.client.api_test()self.assertFalse(asyncio.isfuture(resp))self.assertTrue(resp[ok])开发者ID:slackapi项目名称:python-slackclient代码行数:7示例4: test_api_calls_return_a_future_when_run_in_async_mode​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_api_calls_return_a_future_when_run_in_async_mode(self):self.client.token xoxb-api_testself.client.run_async Truefuture self.client.api_test()self.assertTrue(asyncio.isfuture(future))resp await futureself.assertEqual(200, resp.status_code)self.assertTrue(resp[ok])开发者ID:slackapi项目名称:python-slackclient代码行数:10示例5: _dispatch​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def _dispatch(self, f, valueNone):self._check_exhausted()if f is None:returnelif asyncio.isfuture(f):f.set_result(value)elif asyncio.iscoroutinefunction(f):self.loop.create_task(f(value))else:f(value)# self.loop.call_soon(functools.partial(f, value))开发者ID:zh217项目名称:aiochan代码行数:14示例6: __init__​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def __init__(self, identifier, hashable_key, type_spec, target_future):Creates a cached value.Args:identifier: An instance of CachedValueIdentifier.hashable_key: A hashable source value key, if any, or None of notapplicable in this context, for use during cleanup.type_spec: The type signature of the target, an instance of tff.Type.target_future: An asyncio future that returns an instance ofexecutor_value_base.ExecutorValue that represents a value embedded inthe target executor.Raises:TypeError: If the arguments are of the wrong types.py_typecheck.check_type(identifier, CachedValueIdentifier)py_typecheck.check_type(hashable_key, collections.Hashable)py_typecheck.check_type(type_spec, computation_types.Type)if not asyncio.isfuture(target_future):raise TypeError(Expected an asyncio future, got {}.format(py_typecheck.type_string(type(target_future))))self._identifier identifierself._hashable_key hashable_keyself._type_spec type_specself._target_future target_futureself._computed_result None开发者ID:tensorflow项目名称:federated代码行数:28示例7: test_mock_from_create_future​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_mock_from_create_future(self, klass):loop asyncio.new_event_loop()try:if not (hasattr(loop, create_future) andhasattr(asyncio, isfuture)):returnmock klass(loop.create_future())self.assertTrue(asyncio.isfuture(mock))finally:loop.close()开发者ID:Martiusweb项目名称:asynctest代码行数:14示例8: isfuture​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def isfuture(fut):return isinstance(fut, asyncio.Future)开发者ID:skylander86项目名称:lambda-text-extractor代码行数:4示例9: test_start_stop​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_start_stop(self):self.assertTrue(asyncio.isfuture(self.order_book_tracker._order_book_snapshot_router_task))self.order_book_tracker.stop()self.assertIsNone(self.order_book_tracker._order_book_snapshot_router_task)self.order_book_tracker.start()开发者ID:CoinAlpha项目名称:hummingbot代码行数:7示例10: test_wrap_future​点赞 5​# 需要导入模块: import asyncio [as 别名]# 或者: from asyncio import isfuture [as 别名]def test_wrap_future(self):def run(arg):return (arg, threading.get_ident())ex concurrent.futures.ThreadPoolExecutor(1)f1 ex.submit(run, oi)f2 asyncio.wrap_future(f1, loopself.loop)res, ident self.loop.run_until_complete(f2)self.assertTrue(asyncio.isfuture(f2))self.assertEqual(res, oi)self.assertNotEqual(ident, threading.get_ident())ex.shutdown(waitTrue)开发者ID:bkerler项目名称:android_universal代码行数:14注本文中的asyncio.isfuture方法示例整理自Github/MSDocs等源码及文档管理平台相关代码片段筛选自各路编程大神贡献的开源项目源码版权归原作者所有传播和使用请参考对应项目的License未经允许请勿转载。
http://www.pierceye.com/news/661902/

相关文章:

  • nginx建设网站教程wordpress文章列表格子
  • 山东网站开发学校深圳福田网站建设公司
  • 做电商网站的框架结构图江西省住房和城乡建设厅
  • 运输网站建设网站上的销售怎么做的
  • ps做网站首页效果图潮安区住房和城乡建设局网站
  • 商业网站怎么做做图赚钱的网站
  • 如何建立微信网站工作室暴利项目
  • 购物网站建设模板下载家在深圳 歌曲
  • wordpress 网站搬迁网站改版提交给百度
  • 黄山网站建设免费咨询网页制作初学者
  • 小说网站模板温州建设集团有限公司网站
  • 医疗器械为什么做网站杭州网站制作培训
  • 村志网站建设品牌设计logo图片
  • 网站更新服务公司网页打不开显示404要怎么处理
  • 注册公司是在哪个网站网站建设案例步骤
  • 机械设备网站源码中国神鹰网站建设
  • access 网站源码安阳市地图
  • 临沂房产和房建设局网站双和关键词排名怎么查
  • 建网站多少费用301不同类型网站
  • 深圳seo网站排名优化贵州省都匀市网站建设
  • 个人网站风格设计做网站时需要注意什么问题
  • 时装网站建设的背景软装设计费用
  • 排名轻松seo 网站国内开源平台
  • 常德做网站公司哪家好雷达图 做图网站
  • 做网站的环境配置wordpress手机版本
  • 市场网站建设济南智能网站建设
  • 淄博网站的优化大数据开发过程
  • 德阳网站建设公司做抢单软件的网站
  • 金融类的网站怎么做地方门户网站建设多少钱
  • 网站建设周末培训长春网站建设服务