beacon_aug/screenshot.py
def flatten(dict, flatten_ls=[]):
        '''use DFS to unfold the operations'''
        for operation in dict["transforms"]:  # "OneOf" or "OneOrOther", etc
            class_name = operation['__class_fullname__']
            if "." in class_name:
                if operation['__class_fullname__'].split(".")[-2] == "composition":
                    flatten(operation, flatten_ls)
                    continue
            flatten_ls.append(operation)
        return flatten_ls
use DFS to unfold the operations
use DFS to unfold the operations
use DFS to unfold the operations
def flatten(dict, flatten_ls=[]):
        for operation in dict["transforms"]:  
            class_name = operation['__class_fullname__']
            if "." in class_name:
                if operation['__class_fullname__'].split(".")[-2] == "composition":
                    flatten(operation, flatten_ls)
                    continue
            flatten_ls.append(operation)
        return flatten_ls
def flatten ( dict , flatten_ls = [ ] ) : for operation in dict [ "transforms" ] : class_name = operation [ '__class_fullname__' ] if "." in class_name : if operation [ '__class_fullname__' ] . split ( "." ) [ - 2 ] == "composition" : flatten ( operation , flatten_ls ) continue flatten_ls . append ( operation ) return flatten_ls
use DFS to unfold the operations
use DFS to unfold the operations
'''use DFS to unfold the operations''' # "OneOf" or "OneOrOther", etc
dict
flatten_ls