src/dirbs/api/common/imei.py
def is_paired(cursor, imei_norm: str) -> bool:
    """
    Method to check if an IMEI is paired.

    Arguments:
        cursor: PostgreSQL connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        Bool
    """
    cursor.execute("""SELECT EXISTS(SELECT 1
                                      FROM pairing_list
                                     WHERE imei_norm = %(imei_norm)s
                                       AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s))""",  # noqa: Q449
                   {'imei_norm': imei_norm})
    return cursor.fetchone()[0]

    Method to check if an IMEI is paired.

    Arguments:
        cursor: PostgreSQL connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        Bool
    
Method to check if an IMEI is paired.
Method to check if an IMEI is paired .
def is_paired(cursor, imei_norm: str) -> bool:
    cursor.execute("""SELECT EXISTS(SELECT 1
                                      FROM pairing_list
                                     WHERE imei_norm = %(imei_norm)s
                                       AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s))""",  
                   {'imei_norm': imei_norm})
    return cursor.fetchone()[0]
def is_paired ( cursor , imei_norm : str ) -> bool : cursor . execute ( """SELECT EXISTS(SELECT 1
                                      FROM pairing_list
                                     WHERE imei_norm = %(imei_norm)s
                                       AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s))""" , { 'imei_norm' : imei_norm } ) return cursor . fetchone ( ) [ 0 ]
Method to check if an IMEI is paired.
Method to check if an IMEI is paired .
"""
    Method to check if an IMEI is paired.

    Arguments:
        cursor: PostgreSQL connection cursor object
        imei_norm: Normalized IMEI
    Returns:
        Bool
    """ # noqa: Q449
None
cursor
PostgreSQL connection cursor object
PostgreSQL connection cursor object
imei_norm
str
None