original_docstring: 
      Method to check if an IMEI exists in the Registration List.
  
      :param db_conn: database connection
      :param cursor: database cursor
      :param imei_norm: normalized imei
      :return: bool
      
docstring: Method to check if an IMEI exists in the Registration List.
docstring_tokens: Method to check if an IMEI exists in the Registration List .
code: def is_in_registration_list(db_conn, cursor, imei_norm):
      """
      Method to check if an IMEI exists in the Registration List.
  
      :param db_conn: database connection
      :param cursor: database cursor
      :param imei_norm: normalized imei
      :return: bool
      """
      cursor.execute(sql.SQL("""SELECT EXISTS(SELECT 1
                                                FROM registration_list
                                               WHERE imei_norm = %(imei_norm)s
                                                 AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)
                                                 AND {wl_status_filter}) AS in_registration_list""")
                     .format(wl_status_filter=registration_list_status_filter_sql()), {'imei_norm': imei_norm})
      in_registration_list = cursor.fetchone().in_registration_list
      exempted_device_types = current_app.config['DIRBS_CONFIG'].region_config.exempted_device_types
      if not in_registration_list and len(exempted_device_types) > 0:
          imei_sql = str(cursor.mogrify("""SELECT %s::TEXT AS imei_norm""", [imei_norm]), db_conn.encoding)
  
          sql_query = filter_imei_list_sql_by_device_type(db_conn,
                                                          exempted_device_types,
                                                          imei_sql)
          cursor.execute(sql_query)
          # The IMEI is returned if it does not belong to an exempted device type.
          # As the IMEI was not in registration list and is not exempted,
          # the in_registration_list value would be set to False.
          in_registration_list = cursor.fetchone() is None
      return in_registration_list
code_tokens: def is_in_registration_list ( db_conn , cursor , imei_norm ) : cursor . execute ( sql . SQL ( """SELECT EXISTS(SELECT 1
                                                FROM registration_list
                                               WHERE imei_norm = %(imei_norm)s
                                                 AND virt_imei_shard = calc_virt_imei_shard(%(imei_norm)s)
                                                 AND {wl_status_filter}) AS in_registration_list""" ) . format ( wl_status_filter = registration_list_status_filter_sql ( ) ) , { 'imei_norm' : imei_norm } ) in_registration_list = cursor . fetchone ( ) . in_registration_list exempted_device_types = current_app . config [ 'DIRBS_CONFIG' ] . region_config . exempted_device_types if not in_registration_list and len ( exempted_device_types ) > 0 : imei_sql = str ( cursor . mogrify ( """SELECT %s::TEXT AS imei_norm""" , [ imei_norm ] ) , db_conn . encoding ) sql_query = filter_imei_list_sql_by_device_type ( db_conn , exempted_device_types , imei_sql ) cursor . execute ( sql_query ) in_registration_list = cursor . fetchone ( ) is None return in_registration_list
short_docstring: Method to check if an IMEI exists in the Registration List.
short_docstring_tokens: Method to check if an IMEI exists in the Registration List .
comment: """
      Method to check if an IMEI exists in the Registration List.
  
      :param db_conn: database connection
      :param cursor: database cursor
      :param imei_norm: normalized imei
      :return: bool
      """$SEP$# The IMEI is returned if it does not belong to an exempted device type.$SEP$# As the IMEI was not in registration list and is not exempted,$SEP$# the in_registration_list value would be set to False.