def backends_data(user):
 available = get_backends().keys()
 values = {'associated': [], 'not_associated': available, 'backends': available}
 if (hasattr(user, 'is_authenticated') and user.is_authenticated()):
  associated = UserSocialAuth.get_social_auth_for_user(user)
  not_associated = list((set(available) - set((assoc.provider for assoc in associated))))
  values['associated'] = associated
  values['not_associated'] = not_associated
 return values

def backends_data ( user ) : available = get_backends ( ) . keys ( ) values = { 'associated' : [ ] , 'not_associated' : available , 'backends' : available } if ( hasattr ( user , 'is_authenticated' ) and user . is_authenticated ( ) ) : associated = UserSocialAuth . get_social_auth_for_user ( user ) not_associated = list ( ( set ( available ) - set ( ( assoc . provider for assoc in associated ) ) ) ) values [ 'associated' ] = associated values [ 'not_associated' ] = not_associated return values
return backends data for given user .