<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_subdomain_DID_info(self, fqn, cur=None):
 """ Get the DID information for a subdomain. Raise SubdomainNotFound if there is no such subdomain """

        subrec = self.get_subdomain_entry_at_sequence(fqn, 0, cur=cur)
        cmd = 'SELECT zonefile_offset FROM {} WHERE fully_qualified_subdomain = ? AND owner = ? AND sequence=0 AND parent_zonefile_index <= ? AND accepted=1 ORDER BY parent_zonefile_index, zonefile_offset LIMIT 1;'.format(self.subdomain_table)
        args = (fqn, subrec.address, subrec.parent_zonefile_index)

        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        rows = db_query_execute(cursor, cmd, args)
        
        zonefile_offset = None
        for r in rows:
            zonefile_offset = r['zonefile_offset']
            break

        if zonefile_offset is None:
            raise SubdomainNotFound('No rows for {}'.format(fqn))

        cmd = 'SELECT COUNT(*) FROM {} WHERE owner = ? AND sequence=0 AND (parent_zonefile_index < ? OR parent_zonefile_index = ? AND zonefile_offset < ?) AND accepted=1 ORDER BY parent_zonefile_index, zonefile_offset LIMIT 1;'.format(self.subdomain_table)
        args = (subrec.address, subrec.parent_zonefile_index, subrec.parent_zonefile_index, zonefile_offset)

        rows = db_query_execute(cursor, cmd, args)
        count = None
        for r in rows:
            count = r['COUNT(*)']
            break

        if count is None:
            raise SubdomainNotFound('No rows for {}'.format(fqn))

        return {'name_type': 'subdomain', 'address': subrec.address, 'index': count}