parameters: (self, user_id)
return_statement: return cursor.fetchall()
docstring: Return list of countries with available phones
          @param self: this object
          @param user_id: User ID
          @type user_id: int
          @return: set of data
          @rtype: dict
docstring_summary: Return list of countries with available phones
docstring_tokens: Return list of countries with available phones
function: def get_country_list(self, user_id):
          """
          Return list of countries with available phones
          @param self: this object
          @param user_id: User ID
          @type user_id: int
          @return: set of data
          @rtype: dict
          """
          cursor = connection.cursor()
          query = """
          SELECT count(id) as total, sum(CASE WHEN (owner_id IS NULL OR owner_id = {0}) AND
          last_connection >= NOW() - INTERVAL '15 minutes' THEN 1 ELSE 0 END) as available, country
          FROM smsapp_phonedata WHERE "number" LIKE '+%' AND NOT inactive
          GROUP BY country ORDER BY available DESC ;
          """.format(user_id)
          cursor.execute(query)
          return cursor.fetchall()
function_tokens: def get_country_list ( self , user_id ) : cursor = connection . cursor ( ) query = """
          SELECT count(id) as total, sum(CASE WHEN (owner_id IS NULL OR owner_id = {0}) AND
          last_connection >= NOW() - INTERVAL '15 minutes' THEN 1 ELSE 0 END) as available, country
          FROM smsapp_phonedata WHERE "number" LIKE '+%' AND NOT inactive
          GROUP BY country ORDER BY available DESC ;
          """ . format ( user_id ) cursor . execute ( query ) return cursor . fetchall ( )