mikrokosmos/objects.py
def resolve_attributes(attributes, ctx):
    """Resolve a set of object attributes"""

    result_attributes = {}
    for key, value in attributes.items():

        args = []
        kwargs = {}

        if isinstance(value, dict):
            value, rest = list(value.items())[0]
            if isinstance(rest, dict):
                kwargs = rest
            elif isinstance(rest, list):
                args = rest
            else:
                args = [rest]
        if isinstance(value, list):
            value, *args = value

        for i, arg in enumerate(args):
            args[i] = resolve_value(arg, args, kwargs, ctx)(None)

        for k, v in kwargs.items():
            kwargs[k] = resolve_value(v, args, kwargs, ctx)(None)

        value = resolve_value(value, args, kwargs, ctx)

        result_attributes[key] = value

    return result_attributes
Resolve a set of object attributes
Resolve a set of object attributes
Resolve a set of object attributes
def resolve_attributes(attributes, ctx):
    result_attributes = {}
    for key, value in attributes.items():
        args = []
        kwargs = {}
        if isinstance(value, dict):
            value, rest = list(value.items())[0]
            if isinstance(rest, dict):
                kwargs = rest
            elif isinstance(rest, list):
                args = rest
            else:
                args = [rest]
        if isinstance(value, list):
            value, *args = value
        for i, arg in enumerate(args):
            args[i] = resolve_value(arg, args, kwargs, ctx)(None)
        for k, v in kwargs.items():
            kwargs[k] = resolve_value(v, args, kwargs, ctx)(None)
        value = resolve_value(value, args, kwargs, ctx)
        result_attributes[key] = value
    return result_attributes
def resolve_attributes ( attributes , ctx ) : result_attributes = { } for key , value in attributes . items ( ) : args = [ ] kwargs = { } if isinstance ( value , dict ) : value , rest = list ( value . items ( ) ) [ 0 ] if isinstance ( rest , dict ) : kwargs = rest elif isinstance ( rest , list ) : args = rest else : args = [ rest ] if isinstance ( value , list ) : value , * args = value for i , arg in enumerate ( args ) : args [ i ] = resolve_value ( arg , args , kwargs , ctx ) ( None ) for k , v in kwargs . items ( ) : kwargs [ k ] = resolve_value ( v , args , kwargs , ctx ) ( None ) value = resolve_value ( value , args , kwargs , ctx ) result_attributes [ key ] = value return result_attributes
Resolve a set of object attributes
Resolve a set of object attributes
"""Resolve a set of object attributes"""
attributes
ctx