src/dirbs/api/v2/resources/imei.py
def is_exempted_device(cursor, imei_norm: str) -> bool:
    """
    Method to check if an IMEI device has been exempted.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Boolean value (True/False)
    """
    exempted_device_types = current_app.config['DIRBS_CONFIG'].region_config.exempted_device_types

    if len(exempted_device_types) > 0:
        cursor.execute("""SELECT device_type
                            FROM gsma_data
                           WHERE tac = '{tac}'""".format(tac=imei_norm[:8]))
        result = cursor.fetchone()
        if result is not None:
            return result.device_type in exempted_device_types
        return False
    return False

    Method to check if an IMEI device has been exempted.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Boolean value (True/False)
    
Method to check if an IMEI device has been exempted.
Method to check if an IMEI device has been exempted .
def is_exempted_device(cursor, imei_norm: str) -> bool:
    exempted_device_types = current_app.config['DIRBS_CONFIG'].region_config.exempted_device_types
    if len(exempted_device_types) > 0:
        cursor.execute("""SELECT device_type
                            FROM gsma_data
                           WHERE tac = '{tac}'""".format(tac=imei_norm[:8]))
        result = cursor.fetchone()
        if result is not None:
            return result.device_type in exempted_device_types
        return False
    return False
def is_exempted_device ( cursor , imei_norm : str ) -> bool : exempted_device_types = current_app . config [ 'DIRBS_CONFIG' ] . region_config . exempted_device_types if len ( exempted_device_types ) > 0 : cursor . execute ( """SELECT device_type
                            FROM gsma_data
                           WHERE tac = '{tac}'""" . format ( tac = imei_norm [ : 8 ] ) ) result = cursor . fetchone ( ) if result is not None : return result . device_type in exempted_device_types return False return False
Method to check if an IMEI device has been exempted.
Method to check if an IMEI device has been exempted .
"""
    Method to check if an IMEI device has been exempted.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Boolean value (True/False)
    """
Boolean value (True/False)
Boolean value ( True / False )
cursor
PostgreSQL database cursor
PostgreSQL database cursor
imei_norm
str
None