flame_utils.misc package
Submodules
flame_utils.misc.alias module
flame_utils.misc.confupdate module
flame_utils.misc.listset module
- flame_utils.misc.listset.flatten(nnn)[source]
flatten recursively defined list or tuple
- Parameters
nnn – recursively defined list or tuple
- Returns
flattened list
- Example
>>> l0 = [1,2,3,[4,5],[6,[7,8,[9,10,['x',['y']]]]]] >>> l1 = flatten(l0) >>> print(l1) [1,2,3,4,5,6,7,8,9,10,'x','y']
- flame_utils.misc.listset.get_intersection(**kws)[source]
Get the intersection of all input keyword parameters, ignore empty list or tuple.
- Returns
- reslist
Examples
>>> a, b, c = [], [], [] >>> print(get_intersection(a=a,b=b,c=c)) [] >>> a, b, c = [1], [2], [] >>> print(get_intersection(a=a,b=b,c=c)) [] >>> a, b, c = [1,2], [2], [] >>> print(get_intersection(a=a,b=b,c=c)) [2] >>> a, b, c = [1,2], [2], [2,3] >>> print(get_intersection(a=a,b=b,c=c)) [2] >>> a, b, c = [1,2], [3,4], [2,3] >>> print(get_intersection(a=a,b=b,c=c)) []