当前位置: 首页>>代码示例>>Python>>正文


Python Sequence.permutations方法代码示例

本文整理汇总了Python中conductor.native.lib.sequence.Sequence.permutations方法的典型用法代码示例。如果您正苦于以下问题:Python Sequence.permutations方法的具体用法?Python Sequence.permutations怎么用?Python Sequence.permutations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在conductor.native.lib.sequence.Sequence的用法示例。


在下文中一共展示了Sequence.permutations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_one_substitution

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
    def test_one_substitution(self):

        template = "image.%(frame)04d.tif"
        result = list(Sequence.permutations(template, frame="0-20x2"))
        self.assertIn("image.0008.tif", result)
        self.assertIn("image.0012.tif", result)
        self.assertEqual(len(result), 11)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:9,代码来源:test_sequence.py

示例2: test_two_the_same_substitution

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
    def test_two_the_same_substitution(self):

        template = "/path/%(frame)d/image.%(frame)04d.tif"
        result = list(Sequence.permutations(template, frame="0-20x2"))
        self.assertIn("/path/8/image.0008.tif", result)
        self.assertIn("/path/12/image.0012.tif", result)
        self.assertEqual(len(result), 11)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:9,代码来源:test_sequence.py

示例3: initialize

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
def initialize(data):
    """Generate list of files from fixture data."""
    global FILES
    for item in data["files"]:
        if item.get("params"):
            for fn in Sequence.permutations(item["path"], **item["params"]):
                FILES.append(fn)
        else:
            FILES.append(item["path"])
    FILES = sorted(set(FILES))
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:12,代码来源:glob.py

示例4: test_three_substitutions

# 需要导入模块: from conductor.native.lib.sequence import Sequence [as 别名]
# 或者: from conductor.native.lib.sequence.Sequence import permutations [as 别名]
 def test_three_substitutions(self):
     template = "image_%(uval)02d_%(vval)02d.%(frame)04d.tif"
     kw = {
         "uval": "1-2",
         "vval": "1-2",
         "frame": "10-11"
     }
     result = list(Sequence.permutations(template, **kw))
     self.assertIn("image_01_01.0010.tif", result)
     self.assertIn("image_02_02.0011.tif", result)
     self.assertIn("image_02_01.0010.tif", result)
     self.assertEqual(len(result), 8)
开发者ID:AtomicConductor,项目名称:conductor_client,代码行数:14,代码来源:test_sequence.py


注:本文中的conductor.native.lib.sequence.Sequence.permutations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。