#NEWLINE# def __init__( self , gateway , attributes ) : #NEWLINE# #INDENT# Resource . __init__ ( self , gateway , attributes ) #NEWLINE# self . is_expired = self . expired #NEWLINE# if ( 'billing_address' in attributes ) : #NEWLINE# #INDENT# self . billing_address = Address ( gateway , self . billing_address ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . billing_address = None #NEWLINE# #UNINDENT# if ( 'subscriptions' in attributes ) : #NEWLINE# #INDENT# self . subscriptions = [ braintree . subscription . Subscription ( gateway , subscription ) for subscription in self . subscriptions ] #NEWLINE# #UNINDENT# if ( 'verifications' in attributes ) : #NEWLINE# #INDENT# sorted_verifications = sorted ( attributes [ 'verifications' ] , key = ( lambda verification : verification [ 'created_at' ] ) , reverse = True ) #NEWLINE# if ( len ( sorted_verifications ) > 0 ) : #NEWLINE# #INDENT# self . verification = CreditCardVerification ( gateway , sorted_verifications [ 0 ] )