<s> from functools import wraps <EOL> def stream ( func ) : <EOL> """<STR_LIT>""" <EOL> @ wraps ( func ) <EOL> def wrapped ( manager , * args , ** kwargs ) : <EOL> offset , limit = kwargs . pop ( '<STR_LIT>' , None ) , kwargs . pop ( '<STR_LIT>' , None ) <EOL> qs = func ( manager , * args , ** kwargs ) <EOL> if isinstance ( qs , dict ) : <EOL> qs = manager . public ( ** qs ) <EOL> elif isinstance ( qs , ( list , tuple ) ) : <EOL> qs = manager . public ( * qs ) <EOL> if offset or limit : <EOL> qs = qs [ offset : limit ] <EOL> return qs . fetch_generic_relations ( ) <EOL> return wrapped </s>
