def responsive(res, space_compress=None):
 if (space_compress is None):
  space_compress = (not g.template_debug)
 if is_api():
  res = (res or u'')
  if ((not c.allowed_callback) and request.environ.get('WANT_RAW_JSON')):
   res = scriptsafe_dumps(res)
  else:
   res = websafe_json(simplejson.dumps(res))
  if c.allowed_callback:
   res = ('/**/%s(%s)' % (websafe_json(c.allowed_callback), res))
 elif space_compress:
  res = spaceCompress(res)
 return res

def responsive ( res , space_compress = None ) : if ( space_compress is None ) : space_compress = ( not g . template_debug ) if is_api ( ) : res = ( res or u'' ) if ( ( not c . allowed_callback ) and request . environ . get ( 'WANT_RAW_JSON' ) ) : res = scriptsafe_dumps ( res ) else : res = websafe_json ( simplejson . dumps ( res ) ) if c . allowed_callback : res = ( '/**/%s(%s)' % ( websafe_json ( c . allowed_callback ) , res ) ) elif space_compress : res = spaceCompress ( res ) return res
use in places where the template is returned as the result of the controller so that it becomes compatible with the page cache .