<s> import wrapt <EOL> import functools <EOL> import time <EOL> from calvin . utilities import calvinuuid <EOL> from calvin . utilities . security import Security <EOL> from calvin . actor import actorport <EOL> from calvin . utilities . calvinlogger import get_logger <EOL> from calvin . utilities . utils import enum <EOL> from calvin . runtime . north . calvin_token import Token , ExceptionToken <EOL> from calvin . runtime . north import calvincontrol <EOL> from calvin . runtime . north import metering <EOL> _log = get_logger ( __name__ ) <EOL> def manage ( include = None , exclude = None ) : <EOL> """<STR_LIT>""" <EOL> if include and type ( include ) is not list or exclude and type ( exclude ) is not list : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> include = set ( include ) if include else set ( ) <EOL> exclude = set ( exclude ) if exclude else set ( ) <EOL> @ wrapt . decorator <EOL> def wrapper ( wrapped , instance , args , kwargs ) : <EOL> exclude . update ( instance . __dict__ ) <EOL> x = wrapped ( * args , ** kwargs ) <EOL> if not include : <EOL> include . update ( instance . __dict__ ) <EOL> include . remove ( '<STR_LIT>' ) <EOL> include . difference_update ( exclude ) <EOL> instance . _managed . update ( include ) <EOL> return x <EOL> return wrapper <EOL> def condition ( action_input = [ ] , action_output = [ ] ) : <EOL> """<STR_LIT>""" <EOL> action_input = [ p if isinstance ( p , ( list , tuple ) ) else ( p , <NUM_LIT:1> ) for p in action_input ] <EOL> action_output = [ p if isinstance ( p , ( list , tuple ) ) else ( p , <NUM_LIT:1> ) for p in action_output ] <EOL> contract_output = tuple ( n for _ , n in action_output ) <EOL> tokens_produced = sum ( contract_output ) <EOL> tokens_consumed = sum ( [ n for _ , n in action_input ] ) <EOL> def wrap ( action_method ) : <EOL> @ functools . wraps ( action_method ) <EOL> def condition_wrapper ( self ) : <EOL> input_ok = all ( <EOL> [ self . inports [ portname ] . available_tokens ( ) >= repeat for ( portname , repeat ) in action_input ] <EOL> ) <EOL> output_ok = all ( <EOL> [ self . outports [ portname ] . available_tokens ( ) >= repeat for ( portname , repeat ) in action_output ] <EOL> ) <EOL> if not input_ok or not output_ok : <EOL> _log . debug ( "<STR_LIT>" % ( self . name , action_method . __name__ , input_ok , output_ok ) ) <EOL> return ActionResult ( did_fire = False ) <EOL> args = [ ] <EOL> ex = { } <EOL> for ( portname , repeat ) in action_input : <EOL> port = self . inports [ portname ] <EOL> tokenlist = [ ] <EOL> for i in range ( repeat ) : <EOL> token = port . peek_token ( ) <EOL> is_exception = isinstance ( token , ExceptionToken ) <EOL> if is_exception : <EOL> ex . setdefault ( portname , [ ] ) . append ( i ) <EOL> tokenlist . append ( token if is_exception else token . value ) <EOL> args . append ( tokenlist if len ( tokenlist ) > <NUM_LIT:1> else tokenlist [ <NUM_LIT:0> ] ) <EOL> if ex : <EOL> action_result = self . exception_handler ( action_method , args , { '<STR_LIT>' : ex } ) <EOL> else : <EOL> action_result = action_method ( self , * args ) <EOL> valid_production = False <EOL> if action_result . did_fire and ( len ( contract_output ) == len ( action_result . production ) ) : <EOL> valid_production = True <EOL> for repeat , prod in zip ( contract_output , action_result . production ) : <EOL> if repeat > <NUM_LIT:1> and len ( prod ) != repeat : <EOL> valid_production = False <EOL> break <EOL> if action_result . did_fire and valid_production : <EOL> for ( portname , _ ) in action_input : <EOL> self . inports [ portname ] . commit_peek_as_read ( ) <EOL> for ( portname , repeat ) , retval in zip ( action_output , action_result . production ) : <EOL> port = self . outports [ portname ] <EOL> for data in retval if repeat > <NUM_LIT:1> else [ retval ] : <EOL> port . write_token ( data if isinstance ( data , Token ) else Token ( data ) ) <EOL> action_result . tokens_consumed = tokens_consumed <EOL> action_result . tokens_produced = tokens_produced <EOL> else : <EOL> for ( portname , _ ) in action_input : <EOL> self . inports [ portname ] . peek_rewind ( ) <EOL> if action_result . did_fire and not valid_production : <EOL> action = "<STR_LIT>" % ( self . _type , action_method . __name__ ) <EOL> raise Exception ( "<STR_LIT>" % ( action , str ( action_result . production ) , str ( tuple ( action_output ) ) ) ) <EOL> return action_result <EOL> condition_wrapper . action_input = action_input <EOL> condition_wrapper . action_output = action_output <EOL> return condition_wrapper <EOL> return wrap <EOL> def guard ( action_guard ) : <EOL> """<STR_LIT>""" <EOL> def wrap ( action_method ) : <EOL> @ functools . wraps ( action_method ) <EOL> def guard_wrapper ( self , * args ) : <EOL> retval = ActionResult ( did_fire = False ) <EOL> guard_ok = action_guard ( self , * args ) <EOL> _log . debug ( "<STR_LIT>" % ( self . name , action_method . __name__ , guard_ok ) ) <EOL> if guard_ok : <EOL> retval = action_method ( self , * args ) <EOL> return retval <EOL> return guard_wrapper <EOL> return wrap <EOL> def verify_status ( valid_status_list , raise_ = False ) : <EOL> """<STR_LIT>""" <EOL> @ wrapt . decorator <EOL> def wrapper ( wrapped , instance , args , kwargs ) : <EOL> if not instance . fsm . disable_state_checks and instance . fsm . state ( ) not in valid_status_list : <EOL> msg = "<STR_LIT>" % ( instance . fsm , wrapped . __name__ ) <EOL> if raise_ : <EOL> raise Exception ( msg ) <EOL> else : <EOL> _log . info ( msg ) <EOL> x = wrapped ( * args , ** kwargs ) <EOL> return x <EOL> return wrapper <EOL> class ActionResult ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , did_fire = True , production = ( ) ) : <EOL> super ( ActionResult , self ) . __init__ ( ) <EOL> self . did_fire = did_fire <EOL> self . tokens_consumed = <NUM_LIT:0> <EOL> self . tokens_produced = <NUM_LIT:0> <EOL> self . production = production <EOL> def __str__ ( self ) : <EOL> fmtstr = "<STR_LIT>" <EOL> return fmtstr % ( self . __class__ . __name__ , str ( self . did_fire ) , self . tokens_consumed , self . tokens_produced ) <EOL> def merge ( self , other_result ) : <EOL> """<STR_LIT>""" <EOL> self . did_fire |= other_result . did_fire <EOL> self . tokens_consumed += other_result . tokens_consumed <EOL> self . tokens_produced += other_result . tokens_produced <EOL> def _implements_state ( obj ) : <EOL> """<STR_LIT>""" <EOL> return hasattr ( obj , '<STR_LIT:state>' ) and callable ( getattr ( obj , '<STR_LIT:state>' ) ) and hasattr ( obj , '<STR_LIT>' ) and callable ( getattr ( obj , '<STR_LIT>' ) ) <EOL> class Actor ( object ) : <EOL> """<STR_LIT>""" <EOL> action_priority = tuple ( ) <EOL> class FSM ( object ) : <EOL> def __init__ ( self , states , initial , transitions , hooks = None , allow_invalid_transitions = True , <EOL> disable_transition_checks = False , disable_state_checks = False ) : <EOL> self . states = states <EOL> self . _state = initial <EOL> self . transitions = transitions <EOL> self . hooks = hooks or { } <EOL> self . allow_invalid_transitions = allow_invalid_transitions <EOL> self . disable_transition_checks = disable_transition_checks <EOL> self . disable_state_checks = disable_state_checks <EOL> def state ( self ) : <EOL> return self . _state <EOL> def transition_to ( self , new_state ) : <EOL> if new_state in self . transitions [ self . _state ] or self . disable_transition_checks : <EOL> hook = self . hooks . get ( ( self . _state , new_state ) , None ) <EOL> if hook : <EOL> hook ( ) <EOL> self . _state = new_state <EOL> else : <EOL> msg = "<STR_LIT>" % ( self , self . printable ( new_state ) ) <EOL> if self . allow_invalid_transitions : <EOL> _log . warning ( "<STR_LIT>" + msg ) <EOL> self . _state = new_state <EOL> else : <EOL> raise Exception ( msg ) <EOL> def printable ( self , state ) : <EOL> return self . states . reverse_mapping [ state ] <EOL> def __str__ ( self ) : <EOL> return self . printable ( self . _state ) <EOL> STATUS = enum ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> VALID_TRANSITIONS = { <EOL> STATUS . LOADED : [ STATUS . READY ] , <EOL> STATUS . READY : [ STATUS . PENDING , STATUS . ENABLED ] , <EOL> STATUS . PENDING : [ STATUS . READY , STATUS . PENDING , STATUS . ENABLED ] , <EOL> STATUS . ENABLED : [ STATUS . READY , STATUS . PENDING ] <EOL> } <EOL> test_args = ( ) <EOL> test_kwargs = { } <EOL> def __init__ ( self , actor_type , name = '<STR_LIT>' , allow_invalid_transitions = True , disable_transition_checks = False , <EOL> disable_state_checks = False , actor_id = None ) : <EOL> """<STR_LIT>""" <EOL> super ( Actor , self ) . __init__ ( ) <EOL> self . _type = actor_type <EOL> self . name = name <EOL> self . id = actor_id or calvinuuid . uuid ( "<STR_LIT>" ) <EOL> _log . debug ( "<STR_LIT>" % ( self . id , actor_id ) ) <EOL> self . _deployment_requirements = [ ] <EOL> self . _signature = None <EOL> self . _component_members = set ( [ self . id ] ) <EOL> self . _managed = set ( ( '<STR_LIT:id>' , '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> self . _calvinsys = None <EOL> self . _using = { } <EOL> self . control = calvincontrol . get_calvincontrol ( ) <EOL> self . metering = metering . get_metering ( ) <EOL> self . _migrating_to = None <EOL> self . _last_time_warning = <NUM_LIT:0.0> <EOL> self . credentials = None <EOL> self . inports = { p : actorport . InPort ( p , self ) for p in self . inport_names } <EOL> self . outports = { p : actorport . OutPort ( p , self ) for p in self . outport_names } <EOL> hooks = { <EOL> ( Actor . STATUS . PENDING , Actor . STATUS . ENABLED ) : self . will_start , <EOL> ( Actor . STATUS . ENABLED , Actor . STATUS . PENDING ) : self . will_stop , <EOL> } <EOL> self . fsm = Actor . FSM ( Actor . STATUS , Actor . STATUS . LOADED , Actor . VALID_TRANSITIONS , hooks , <EOL> allow_invalid_transitions = allow_invalid_transitions , <EOL> disable_transition_checks = disable_transition_checks , <EOL> disable_state_checks = disable_state_checks ) <EOL> self . metering . add_actor_info ( self ) <EOL> def set_credentials ( self , credentials , security = None ) : <EOL> """<STR_LIT>""" <EOL> _log . debug ( "<STR_LIT>" % credentials ) <EOL> if credentials is None : <EOL> return <EOL> self . credentials = credentials <EOL> if security : <EOL> self . sec = security <EOL> else : <EOL> self . sec = Security ( ) <EOL> self . sec . set_principal ( self . credentials ) <EOL> self . sec . authenticate_principal ( ) <EOL> def get_credentials ( self ) : <EOL> _log . debug ( "<STR_LIT>" % self . credentials ) <EOL> return self . credentials <EOL> @ verify_status ( [ STATUS . LOADED ] ) <EOL> def setup_complete ( self ) : <EOL> self . fsm . transition_to ( Actor . STATUS . READY ) <EOL> def init ( self ) : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def will_start ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def will_stop ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def will_migrate ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def did_migrate ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def will_end ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> @ verify_status ( [ STATUS . LOADED ] ) <EOL> def check_requirements ( self ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( self , '<STR_LIT>' ) and not self . sec . check_security_actor_requirements ( [ '<STR_LIT>' ] + <EOL> ( self . requires if hasattr ( self , "<STR_LIT>" ) else [ ] ) ) : <EOL> _log . debug ( "<STR_LIT>" ) <EOL> raise Exception ( '<STR_LIT>' ) <EOL> if hasattr ( self , "<STR_LIT>" ) : <EOL> for req in self . requires : <EOL> if not self . _calvinsys . has_capability ( req ) : <EOL> raise Exception ( "<STR_LIT>" % ( self . id , req ) ) <EOL> def __getitem__ ( self , attr ) : <EOL> if attr in self . _using : <EOL> return self . _using [ attr ] <EOL> raise KeyError ( attr ) <EOL> def use ( self , requirement , shorthand ) : <EOL> self . _using [ shorthand ] = self . _calvinsys . use_requirement ( self , requirement ) <EOL> def __str__ ( self ) : <EOL> ip = "<STR_LIT>" <EOL> for p in self . inports . values ( ) : <EOL> ip = ip + str ( p ) <EOL> op = "<STR_LIT>" <EOL> for p in self . outports . values ( ) : <EOL> op = op + str ( p ) <EOL> s = "<STR_LIT>" % ( <EOL> self . name , self . _type , self . fsm , ip , op ) <EOL> return s <EOL> @ verify_status ( [ STATUS . READY ] ) <EOL> def set_port_property ( self , port_type , port_name , port_property , value ) : <EOL> """<STR_LIT>""" <EOL> if port_type not in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> _log . error ( "<STR_LIT>" % ( port_type , self . name , self . _type ) ) <EOL> return False <EOL> ports = self . outports if port_type == '<STR_LIT>' else self . inports <EOL> if port_name not in ports : <EOL> _log . error ( "<STR_LIT>" % <EOL> ( port_type , port_name , self . name , self . _type ) ) <EOL> return False <EOL> port = ports [ port_name ] <EOL> if not hasattr ( port , port_property ) : <EOL> _log . error ( "<STR_LIT>" % <EOL> ( port_property , port_type , port_name , self . name , self . _type ) ) <EOL> return False <EOL> setattr ( port , port_property , value ) <EOL> return True <EOL> @ verify_status ( [ STATUS . READY , STATUS . PENDING ] ) <EOL> def did_connect ( self , port ) : <EOL> """<STR_LIT>""" <EOL> if self . fsm . state ( ) == Actor . STATUS . READY : <EOL> self . fsm . transition_to ( Actor . STATUS . PENDING ) <EOL> if self . inports : <EOL> for p in self . inports . values ( ) : <EOL> if not p . is_connected ( ) : <EOL> return <EOL> if self . outports : <EOL> for p in self . outports . values ( ) : <EOL> if not p . is_connected ( ) : <EOL> return <EOL> self . fsm . transition_to ( Actor . STATUS . ENABLED ) <EOL> self . _calvinsys . scheduler_wakeup ( ) <EOL> @ verify_status ( [ STATUS . ENABLED , STATUS . PENDING ] ) <EOL> def did_disconnect ( self , port ) : <EOL> """<STR_LIT>""" <EOL> if self . fsm . state ( ) == Actor . STATUS . ENABLED : <EOL> self . fsm . transition_to ( Actor . STATUS . PENDING ) <EOL> if self . inports : <EOL> for p in self . inports . values ( ) : <EOL> if p . is_connected ( ) : <EOL> return <EOL> if self . outports : <EOL> for p in self . outports . values ( ) : <EOL> if p . is_connected ( ) : <EOL> return <EOL> self . fsm . transition_to ( Actor . STATUS . READY ) <EOL> @ verify_status ( [ STATUS . ENABLED ] ) <EOL> def fire ( self ) : <EOL> start_time = time . time ( ) <EOL> total_result = ActionResult ( did_fire = False ) <EOL> while True : <EOL> for action_method in self . __class__ . action_priority : <EOL> action_result = action_method ( self ) <EOL> total_result . merge ( action_result ) <EOL> if action_result . did_fire : <EOL> self . metering . fired ( self . id , action_method . __name__ ) <EOL> self . control . log_actor_firing ( <EOL> self . id , <EOL> action_method . __name__ , <EOL> action_result . tokens_produced , <EOL> action_result . tokens_consumed , <EOL> action_result . production ) <EOL> _log . debug ( "<STR_LIT>" % ( <EOL> self . _type , self . id , <EOL> action_method . __name__ , <EOL> str ( action_result ) ) ) <EOL> break <EOL> if not action_result . did_fire : <EOL> diff = time . time ( ) - start_time <EOL> if diff > <NUM_LIT> and start_time - self . _last_time_warning > <NUM_LIT> : <EOL> self . _last_time_warning = start_time <EOL> _log . warning ( "<STR_LIT>" % ( self . name , self . _type , diff ) ) <EOL> return total_result <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def enabled ( self ) : <EOL> return self . fsm . state ( ) == Actor . STATUS . ENABLED <EOL> @ verify_status ( [ STATUS . ENABLED ] ) <EOL> def enable ( self ) : <EOL> self . fsm . transition_to ( Actor . STATUS . ENABLED ) <EOL> @ verify_status ( [ STATUS . READY , STATUS . PENDING , STATUS . LOADED ] ) <EOL> def disable ( self ) : <EOL> self . fsm . transition_to ( Actor . STATUS . PENDING ) <EOL> @ verify_status ( [ STATUS . LOADED , STATUS . READY , STATUS . PENDING ] ) <EOL> def state ( self ) : <EOL> state = { } <EOL> state [ '<STR_LIT>' ] = list ( self . _managed ) <EOL> state [ '<STR_LIT>' ] = { port : self . inports [ port ] . _state ( ) <EOL> for port in self . inports } <EOL> state [ '<STR_LIT>' ] = { <EOL> port : self . outports [ port ] . _state ( ) for port in self . outports } <EOL> state [ '<STR_LIT>' ] = list ( self . _component_members ) <EOL> for key in self . _managed : <EOL> obj = self . __dict__ [ key ] <EOL> if _implements_state ( obj ) : <EOL> state [ key ] = obj . state ( ) <EOL> else : <EOL> state [ key ] = obj <EOL> return state <EOL> @ verify_status ( [ STATUS . LOADED , STATUS . READY , STATUS . PENDING ] ) <EOL> def _set_state ( self , state ) : <EOL> self . _managed . update ( set ( state [ '<STR_LIT>' ] ) ) <EOL> for key in state [ '<STR_LIT>' ] : <EOL> if key not in self . __dict__ : <EOL> self . __dict__ [ key ] = state . pop ( key ) <EOL> else : <EOL> obj = self . __dict__ [ key ] <EOL> if _implements_state ( obj ) : <EOL> obj . set_state ( state . pop ( key ) ) <EOL> else : <EOL> self . __dict__ [ key ] = state . pop ( key ) <EOL> for port in state [ '<STR_LIT>' ] : <EOL> self . inports . setdefault ( port , actorport . InPort ( port , self ) ) . _set_state ( state [ '<STR_LIT>' ] [ port ] ) <EOL> for port in state [ '<STR_LIT>' ] : <EOL> self . outports . setdefault ( port , actorport . OutPort ( port , self ) ) . _set_state ( state [ '<STR_LIT>' ] [ port ] ) <EOL> self . _component_members = set ( state [ '<STR_LIT>' ] ) <EOL> @ verify_status ( [ STATUS . ENABLED , STATUS . READY , STATUS . PENDING ] ) <EOL> def connections ( self , node_id ) : <EOL> c = { '<STR_LIT>' : self . id , '<STR_LIT>' : self . name } <EOL> inports = { } <EOL> for port in self . inports . values ( ) : <EOL> peer = port . get_peer ( ) <EOL> if peer [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> peer = ( node_id , peer [ <NUM_LIT:1> ] ) <EOL> inports [ port . id ] = peer <EOL> c [ '<STR_LIT>' ] = inports <EOL> outports = { } <EOL> for port in self . outports . values ( ) : <EOL> peers = [ <EOL> ( node_id , p [ <NUM_LIT:1> ] ) if p [ <NUM_LIT:0> ] == '<STR_LIT>' else p for p in port . get_peers ( ) ] <EOL> outports [ port . id ] = peers <EOL> c [ '<STR_LIT>' ] = outports <EOL> return c <EOL> def serialize ( self ) : <EOL> return self . state ( ) <EOL> def deserialize ( self , data ) : <EOL> self . _set_state ( data ) <EOL> def exception_handler ( self , action , args , context ) : <EOL> """<STR_LIT>""" <EOL> _log . error ( "<STR_LIT>" % <EOL> ( self . name , self . _type , action . __name__ , args , context ) ) <EOL> raise Exception ( "<STR_LIT>" ) <EOL> def events ( self ) : <EOL> return [ ] <EOL> def component_add ( self , actor_ids ) : <EOL> if not isinstance ( actor_ids , ( set , list , tuple ) ) : <EOL> actor_ids = [ actor_ids ] <EOL> self . _component_members . update ( actor_ids ) <EOL> def component_remove ( self , actor_ids ) : <EOL> if not isinstance ( actor_ids , ( set , list , tuple ) ) : <EOL> actor_ids = [ actor_ids ] <EOL> self . _component_members -= set ( actor_ids ) <EOL> def part_of_component ( self ) : <EOL> return len ( self . _component_members - set ( [ self . id ] ) ) > <NUM_LIT:0> <EOL> def component_members ( self ) : <EOL> return self . _component_members <EOL> def requirements_add ( self , deploy_reqs , extend = False ) : <EOL> if extend : <EOL> self . _deployment_requirements . extend ( deploy_reqs ) <EOL> else : <EOL> self . _deployment_requirements = deploy_reqs <EOL> def requirements_get ( self ) : <EOL> return self . _deployment_requirements + ( <EOL> [ { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : self . requires } , <EOL> '<STR_LIT:type>' : '<STR_LIT:+>' } ] <EOL> if hasattr ( self , '<STR_LIT>' ) else [ ] ) <EOL> def signature_set ( self , signature ) : <EOL> if self . _signature is None : <EOL> self . _signature = signature <EOL> class ShadowActor ( Actor ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , actor_type , name = '<STR_LIT>' , allow_invalid_transitions = True , disable_transition_checks = False , <EOL> disable_state_checks = False , actor_id = None ) : <EOL> self . inport_names = [ ] <EOL> self . outport_names = [ ] <EOL> super ( ShadowActor , self ) . __init__ ( actor_type , name , allow_invalid_transitions = allow_invalid_transitions , <EOL> disable_transition_checks = disable_transition_checks , <EOL> disable_state_checks = disable_state_checks , actor_id = actor_id ) <EOL> @ manage ( [ '<STR_LIT>' ] ) <EOL> def init ( self , ** args ) : <EOL> self . _shadow_args = args <EOL> def create_shadow_port ( self , port_name , port_dir , port_id = None ) : <EOL> if port_dir == "<STR_LIT>" : <EOL> self . inport_names . append ( port_name ) <EOL> port = actorport . InPort ( port_name , self ) <EOL> self . inports [ port_name ] = port <EOL> else : <EOL> self . outport_names . append ( port_name ) <EOL> port = actorport . OutPort ( port_name , self ) <EOL> self . outports [ port_name ] = port <EOL> return port <EOL> def enabled ( self ) : <EOL> return False <EOL> def requirements_get ( self ) : <EOL> if self . _signature : <EOL> return self . _deployment_requirements + [ { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : self . _signature , <EOL> '<STR_LIT>' : self . _shadow_args . keys ( ) } , <EOL> '<STR_LIT:type>' : '<STR_LIT:+>' } ] <EOL> else : <EOL> _log . error ( "<STR_LIT>" % ( self . name , self . id ) ) <EOL> return self . _deployment_requirements </s>
