<s> """<STR_LIT>""" <EOL> import warnings <EOL> from zope . interface import Interface , implements as zimplements , Attribute <EOL> from twisted . python . components import * <EOL> warnings . warn ( "<STR_LIT>" , <EOL> stacklevel = <NUM_LIT:2> ) <EOL> CannotAdapt = TypeError <EOL> _registerAdapter = registerAdapter <EOL> def registerAdapter ( adapterFactory , origInterface , * interfaceClasses ) : <EOL> from nevow . util import _namedAnyWithBuiltinTranslation , _NamedAnyError <EOL> isStr = type ( adapterFactory ) is str <EOL> if ( type ( origInterface ) is str ) != isStr : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> for interfaceClass in interfaceClasses : <EOL> if ( type ( interfaceClass ) is str ) != isStr : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if isStr : <EOL> adapterFactory = _namedAnyWithBuiltinTranslation ( adapterFactory ) <EOL> origInterface = _namedAnyWithBuiltinTranslation ( origInterface ) <EOL> interfaceClasses = [ _namedAnyWithBuiltinTranslation ( x ) for x in interfaceClasses ] <EOL> if '<STR_LIT>' in interfaceClasses or filter ( <EOL> lambda o : getattr ( o , '<STR_LIT>' , None ) == '<STR_LIT>' , interfaceClasses ) : <EOL> warnings . warn ( "<STR_LIT>" , stacklevel = <NUM_LIT:2> ) <EOL> from nevow import flat <EOL> flat . registerFlattener ( adapterFactory , origInterface ) <EOL> _registerAdapter ( adapterFactory , origInterface , * interfaceClasses ) <EOL> class IComponentized ( Interface ) : <EOL> pass <EOL> _Componentized = Componentized <EOL> class Componentized ( _Componentized ) : <EOL> zimplements ( IComponentized ) <EOL> def __init__ ( self , adapterCache = None ) : <EOL> _Componentized . __init__ ( self ) <EOL> if adapterCache : <EOL> for k , v in adapterCache . items ( ) : <EOL> self . setComponent ( k , v ) <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
