def get_duplicate_provider(messages):
 social_auth_messages = [m for m in messages if m.message.endswith('is already in use.')]
 if (not social_auth_messages):
  return
 assert (len(social_auth_messages) == 1)
 backend_name = social_auth_messages[0].extra_tags.split()[1]
 return backend_name

def get_duplicate_provider ( messages ) : social_auth_messages = [ m for m in messages if m . message . endswith ( 'is already in use.' ) ] if ( not social_auth_messages ) : return assert ( len ( social_auth_messages ) == 1 ) backend_name = social_auth_messages [ 0 ] . extra_tags . split ( ) [ 1 ] return backend_name
gets provider from message about social account already in use .