本文整理汇总了Python中neurokernel.pattern.Pattern.is_in_interfaces方法的典型用法代码示例。如果您正苦于以下问题:Python Pattern.is_in_interfaces方法的具体用法?Python Pattern.is_in_interfaces怎么用?Python Pattern.is_in_interfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neurokernel.pattern.Pattern
的用法示例。
在下文中一共展示了Pattern.is_in_interfaces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_in_interfaces
# 需要导入模块: from neurokernel.pattern import Pattern [as 别名]
# 或者: from neurokernel.pattern.Pattern import is_in_interfaces [as 别名]
def test_is_in_interfaces(self):
# Selectors with multiple levels:
p = Pattern('/aaa/bbb', '/ccc/ddd')
assert p.is_in_interfaces('/aaa/bbb') == True
assert p.is_in_interfaces('/aaa') == False
# Selectors with a single level:
p = Pattern('/aaa', '/bbb')
assert p.is_in_interfaces('/aaa') == True
assert p.is_in_interfaces('/ccc') == False
# Selectors comprising identifiers with different numbers of levels::
p = Pattern('/aaa,/bbb[0]', '/ccc,/ddd[0]')
assert p.is_in_interfaces('/aaa') == True
assert p.is_in_interfaces('/ccc') == True
assert p.is_in_interfaces('/ddd') == False
assert p.is_in_interfaces('/ddd[0]') == True