def asset_diff(before, after):
 alter_dic = {}
 (before_dic, after_dic) = (before, dict(after.iterlists()))
 for (k, v) in before_dic.items():
  after_dic_values = after_dic.get(k, [])
  if (k == 'group'):
   after_dic_value = (after_dic_values if (len(after_dic_values) > 0) else u'')
   uv = (v if (v is not None) else u'')
  else:
   after_dic_value = (after_dic_values[0] if (len(after_dic_values) > 0) else u'')
   uv = (unicode(v) if (v is not None) else u'')
  if (uv != after_dic_value):
   alter_dic.update({k: [uv, after_dic_value]})
 for (k, v) in alter_dic.items():
  if (v == [None, u'']):
   alter_dic.pop(k)
 return alter_dic

def asset_diff ( before , after ) : alter_dic = { } ( before_dic , after_dic ) = ( before , dict ( after . iterlists ( ) ) ) for ( k , v ) in before_dic . items ( ) : after_dic_values = after_dic . get ( k , [ ] ) if ( k == 'group' ) : after_dic_value = ( after_dic_values if ( len ( after_dic_values ) > 0 ) else u'' ) uv = ( v if ( v is not None ) else u'' ) else : after_dic_value = ( after_dic_values [ 0 ] if ( len ( after_dic_values ) > 0 ) else u'' ) uv = ( unicode ( v ) if ( v is not None ) else u'' ) if ( uv != after_dic_value ) : alter_dic . update ( { k : [ uv , after_dic_value ] } ) for ( k , v ) in alter_dic . items ( ) : if ( v == [ None , u'' ] ) : alter_dic . pop ( k ) return alter_dic
asset change before and after .