def query_countries(countries: List[str]=[], country_ids: List[str]=[]) -> List[Region]:
    ' Returns a list of countries:\n    If countries or country_ids are not empty, only those countries are returned (all of those in both lists)\n    Otherwise, all countries are returned\n    '
    where = region_where_clause('s_country_label.text', countries, 'e_country.node1', country_ids)
    query = f'''
    SELECT  e_country.node1 AS admin_id,
            s_country_label.text AS admin,
            'Q6256' AS region_type,
            e_country.node1 AS country_id,
            s_country_label.text AS country,
            NULL as admin1_id,
            NULL as admin1,
            NULL as admin2_id,
            NULL as admin2,
            NULL as admin3_id,
            NULL as admin3
    FROM edges e_country
        JOIN edges e_country_label JOIN strings s_country_label ON (e_country_label.id=s_country_label.edge_id)
            ON (e_country.node1=e_country_label.node1 AND e_country_label.label='label')
    WHERE e_country.label='P31' AND e_country.node2='Q6256' AND {where}
    ORDER BY country
    '''
    return _query_regions(query)
Returns a list of countries:
If countries or country_ids are not empty, only those countries are returned (all of those in both lists)
Otherwise, all countries are returned
def query_countries(countries: List[str]=[], country_ids: List[str]=[]) -> List[Region]:
    ' Returns a list of countries:\n    If countries or country_ids are not empty, only those countries are returned (all of those in both lists)\n    Otherwise, all countries are returned\n    '
    where = region_where_clause('s_country_label.text', countries, 'e_country.node1', country_ids)
    query = f'
    SELECT  e_country.node1 AS admin_id,
            s_country_label.text AS admin,
            'Q6256' AS region_type,
            e_country.node1 AS country_id,
            s_country_label.text AS country,
            NULL as admin1_id,
            NULL as admin1,
            NULL as admin2_id,
            NULL as admin2,
            NULL as admin3_id,
            NULL as admin3
    FROM edges e_country
        JOIN edges e_country_label JOIN strings s_country_label ON (e_country_label.id=s_country_label.edge_id)
            ON (e_country.node1=e_country_label.node1 AND e_country_label.label='label')
    WHERE e_country.label='P31' AND e_country.node2='Q6256' AND {where}
    ORDER BY country
    '
    return _query_regions(query)