async def METHOD_NAME(self, user_id: int, corpus_id: Dict[str, Serializable] = None):
    if corpus_id:
        async with self._db.cursor() as cursor:
            await cursor.execute('''
                SELECT data FROM kontext_corpus_settings
                WHERE user_id = %s AND corpus_name = %s
            ''', (user_id, corpus_id))
            row = await cursor.fetchone()
        if row is not None and row['data']:
            return json.loads(row['data'])
    else:
        async with self._db.cursor() as cursor:
            await cursor.execute('''
                SELECT data FROM kontext_settings
                WHERE user_id = %s
            ''', (user_id,))
            row = await cursor.fetchone()
        if row is not None:
            return await self._upgrade_general_settings(json.loads(row['data']), user_id)
    return {}