src/dirbs/api/v2/resources/imei.py
def stolen_list_status(cursor, imei_norm: str) -> dict:
    """
    Method to get StolenList status of an IMEI from Stolen List.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Response dictionary
    """
    cursor.execute(sql.SQL("""SELECT status,
                                          CASE
                                            WHEN status = 'blacklist' THEN FALSE
                                            WHEN status IS NULL THEN FALSE
                                            ELSE TRUE
                                          END
                                          AS provisional_only
                                FROM stolen_list
                               WHERE imei_norm = %(imei_norm)s
                                 AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)"""),
                   {'imei_norm': imei_norm})
    result = cursor.fetchone()
    if result is not None:
        return dict({
            'status': result.status,
            'provisional_only': result.provisional_only
        })
    else:
        return dict({
            'status': None,
            'provisional_only': None
        })

    Method to get StolenList status of an IMEI from Stolen List.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Response dictionary
    
Method to get StolenList status of an IMEI from Stolen List.
Method to get StolenList status of an IMEI from Stolen List .
def stolen_list_status(cursor, imei_norm: str) -> dict:
    cursor.execute(sql.SQL("""SELECT status,
                                          CASE
                                            WHEN status = 'blacklist' THEN FALSE
                                            WHEN status IS NULL THEN FALSE
                                            ELSE TRUE
                                          END
                                          AS provisional_only
                                FROM stolen_list
                               WHERE imei_norm = %(imei_norm)s
                                 AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)"""),
                   {'imei_norm': imei_norm})
    result = cursor.fetchone()
    if result is not None:
        return dict({
            'status': result.status,
            'provisional_only': result.provisional_only
        })
    else:
        return dict({
            'status': None,
            'provisional_only': None
        })
def stolen_list_status ( cursor , imei_norm : str ) -> dict : cursor . execute ( sql . SQL ( """SELECT status,
                                          CASE
                                            WHEN status = 'blacklist' THEN FALSE
                                            WHEN status IS NULL THEN FALSE
                                            ELSE TRUE
                                          END
                                          AS provisional_only
                                FROM stolen_list
                               WHERE imei_norm = %(imei_norm)s
                                 AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)""" ) , { 'imei_norm' : imei_norm } ) result = cursor . fetchone ( ) if result is not None : return dict ( { 'status' : result . status , 'provisional_only' : result . provisional_only } ) else : return dict ( { 'status' : None , 'provisional_only' : None } )
Method to get StolenList status of an IMEI from Stolen List.
Method to get StolenList status of an IMEI from Stolen List .
"""
    Method to get StolenList status of an IMEI from Stolen List.

    Arguments:
        cursor: PostgreSQL database cursor
        imei_norm: Normalized IMEI
    Returns:
        Response dictionary
    """
None
cursor
PostgreSQL database cursor
PostgreSQL database cursor
imei_norm
str
None