def use_global_asset(self, fname, before=None):
        if not isinstance(fname, str):
            raise ValueError('Asset name must be a string.')
        
        if fname in self._asset_names:
            return  # ok
        
        if fname not in self._store.get_asset_names():
            raise IndexError('Asset %r is not present in the store.' % fname)
        
        if self._served and (fname.endswith('.js') or fname.endswith('.css')):
            suffix = fname.split('.')[-1].upper()
            code = self._store.load_asset(fname).decode()
            self._send_command('DEFINE-%s %s' % (suffix, code))
            #logging.warn('Adding asset %r but the page was already "served".' % fname)
        
        if before:
            index = self._asset_names.index(before)
            self._asset_names.insert(index, fname)
        else:
            self._asset_names.append(fname)
Create error reply basing on the received 'node' stanza and the 'error' error condition.
dataset/ETHPy150Open zoofIO/flexx/flexx/app/assetstore.py/SessionAssets.use_global_asset--crossover with--dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/xmpp/protocol.py/Error.__init__