def query_admin3s(admin2: Optional[str]=None, admin2_id: Optional[str]=None, admin3s: List[str]=[], admin3_ids: List[str]=[], debug=False) -> List[Region]:
    '\n    Returns a list of admin3s. If admin2 or admin2_id is specified, return the admin3s only of that admin2.\n    If admin3s or admin3_ids are provided, only those admins are returned.\n    If all arguments are empty, all admin3s in the system are returned.\n    '
    if (admin2 and admin2_id):
        raise ValueError('Only one of admin2, admin2_id may be specified')
    if admin2_id:
        admin2_where = f"e_admin2.node2='{admin2_id}'"
    elif admin2:
        admin2_where = f"LOWER(s_admin2_label.text)=LOWER('{admin2}')"
    else:
        admin2_where = '1=1'
    admin3_where = region_where_clause('s_admin3_label.text', admin3s, 'e_admin3.node1', admin3_ids)
    query = f'''
    SELECT  e_admin3.node1 AS admin_id,
            s_admin3_label.text AS admin,
            'Q13221722' AS region_type,
            e_country.node2 AS country_id,
            s_country_label.text AS country,
            e_admin1.node2 AS admin1_id,
            s_admin1_label.text AS admin1,
            e_admin2.node2 AS admin2_id,
            s_admin2_label.text AS admin2,
            e_admin2.node1 AS admin3_id,
            s_admin3_label.text AS admin3
    FROM
        edges e_admin3
        JOIN edges e_admin3_label JOIN strings s_admin3_label ON (e_admin3_label.id=s_admin3_label.edge_id)
            ON (e_admin3.node1=e_admin3_label.node1 AND e_admin3_label.label='label')
        JOIN edges e_admin2 ON (e_admin2.node1=e_admin3.node1 AND e_admin2.label='P2006190002')
        JOIN edges e_admin2_label JOIN strings s_admin2_label ON (e_admin2_label.id=s_admin2_label.edge_id)
            ON (e_admin2.node2=e_admin2_label.node1 AND e_admin2_label.label='label')
        JOIN edges e_admin1 ON (e_admin1.node1=e_admin2.node1 AND e_admin1.label='P2006190001')
        JOIN edges e_admin1_label JOIN strings s_admin1_label ON (e_admin1_label.id=s_admin1_label.edge_id)
            ON (e_admin1.node2=e_admin1_label.node1 AND e_admin1_label.label='label')
        JOIN edges e_country ON (e_country.node1=e_admin1.node2 AND e_country.label='P17')
        JOIN edges e_country_label JOIN strings s_country_label ON (e_country_label.id=s_country_label.edge_id)
            ON (e_country.node2=e_country_label.node1 AND e_country_label.label='label')
    WHERE e_admin3.label='P31' AND e_admin3.node2='Q13221722' AND {admin2_where} AND {admin3_where}
    ORDER BY admin3
    '''
    if debug:
        print(query)
    return _query_regions(query)
Returns a list of admin3s. If admin2 or admin2_id is specified, return the admin3s only of that admin2.
If admin3s or admin3_ids are provided, only those admins are returned.
If all arguments are empty, all admin3s in the system are returned.
def query_admin3s(admin2: Optional[str]=None, admin2_id: Optional[str]=None, admin3s: List[str]=[], admin3_ids: List[str]=[], debug=False) -> List[Region]:
    '\n    Returns a list of admin3s. If admin2 or admin2_id is specified, return the admin3s only of that admin2.\n    If admin3s or admin3_ids are provided, only those admins are returned.\n    If all arguments are empty, all admin3s in the system are returned.\n    '
    if (admin2 and admin2_id):
        raise ValueError('Only one of admin2, admin2_id may be specified')
    if admin2_id:
        admin2_where = f"e_admin2.node2='{admin2_id}'"
    elif admin2:
        admin2_where = f"LOWER(s_admin2_label.text)=LOWER('{admin2}')"
    else:
        admin2_where = '1=1'
    admin3_where = region_where_clause('s_admin3_label.text', admin3s, 'e_admin3.node1', admin3_ids)
    query = f'
    SELECT  e_admin3.node1 AS admin_id,
            s_admin3_label.text AS admin,
            'Q13221722' AS region_type,
            e_country.node2 AS country_id,
            s_country_label.text AS country,
            e_admin1.node2 AS admin1_id,
            s_admin1_label.text AS admin1,
            e_admin2.node2 AS admin2_id,
            s_admin2_label.text AS admin2,
            e_admin2.node1 AS admin3_id,
            s_admin3_label.text AS admin3
    FROM
        edges e_admin3
        JOIN edges e_admin3_label JOIN strings s_admin3_label ON (e_admin3_label.id=s_admin3_label.edge_id)
            ON (e_admin3.node1=e_admin3_label.node1 AND e_admin3_label.label='label')
        JOIN edges e_admin2 ON (e_admin2.node1=e_admin3.node1 AND e_admin2.label='P2006190002')
        JOIN edges e_admin2_label JOIN strings s_admin2_label ON (e_admin2_label.id=s_admin2_label.edge_id)
            ON (e_admin2.node2=e_admin2_label.node1 AND e_admin2_label.label='label')
        JOIN edges e_admin1 ON (e_admin1.node1=e_admin2.node1 AND e_admin1.label='P2006190001')
        JOIN edges e_admin1_label JOIN strings s_admin1_label ON (e_admin1_label.id=s_admin1_label.edge_id)
            ON (e_admin1.node2=e_admin1_label.node1 AND e_admin1_label.label='label')
        JOIN edges e_country ON (e_country.node1=e_admin1.node2 AND e_country.label='P17')
        JOIN edges e_country_label JOIN strings s_country_label ON (e_country_label.id=s_country_label.edge_id)
            ON (e_country.node2=e_country_label.node1 AND e_country_label.label='label')
    WHERE e_admin3.label='P31' AND e_admin3.node2='Q13221722' AND {admin2_where} AND {admin3_where}
    ORDER BY admin3
    '
    if debug:
        print(query)
    return _query_regions(query)