#NEWLINE# def unmarshal( self , value , bind_client = None ) : #NEWLINE# #INDENT# '\n        Cast the specified value to the entity type.\n        ' #NEWLINE# if ( not isinstance ( value , self . type ) ) : #NEWLINE# #INDENT# o = self . type ( ) #NEWLINE# if ( ( bind_client is not None ) and hasattr ( o . __class__ , 'bind_client' ) ) : #NEWLINE# #INDENT# o . bind_client = bind_client #NEWLINE# #UNINDENT# if isinstance ( value , dict ) : #NEWLINE# #INDENT# for ( k , v ) in value . items ( ) : #NEWLINE# #INDENT# if ( not hasattr ( o . __class__ , k ) ) : #NEWLINE# #INDENT# self . log . warning ( 'Unable to set attribute {0} on entity {1!r}' . format ( k , o ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# setattr ( o , k , v ) #NEWLINE# #UNINDENT# #UNINDENT# value = o #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Unable to unmarshall object {0!r}' . format ( value ) ) #NEWLINE# #UNINDENT# #UNINDENT# return value