@webauth.SecurityCheck
def RenderHelp(request, path, document_root=None, content_type=None):
 _ = document_root
 _ = content_type
 request.REQ = request.REQUEST
 help_path = request.path.split('/', 2)[(-1)]
 if (not help_path):
  return AccessDenied('Error: Invalid help path.')
 try:
  user_record = aff4.FACTORY.Open(aff4.ROOT_URN.Add('users').Add(request.user), aff4_users.GRRUser, token=BuildToken(request, 60))
  settings = user_record.Get(user_record.Schema.GUI_SETTINGS)
 except IOError:
  settings = aff4_users.GRRUser.SchemaCls.GUI_SETTINGS()
 if (settings.docs_location == settings.DocsLocation.REMOTE):
  return RedirectToRemoteHelp(help_path)
 else:
  static_handler_components = urls.static_handler.split('.')
  static_handler_module = importlib.import_module('.'.join(static_handler_components[0:(-1)]))
  static_handler = getattr(static_handler_module, static_handler_components[(-1)])
  return static_handler(request, path, document_root=config_lib.CONFIG['AdminUI.help_root'])

@ webauth . SecurityCheck def RenderHelp ( request , path , document_root = None , content_type = None ) : _ = document_root _ = content_type request . REQ = request . REQUEST help_path = request . path . split ( '/' , 2 ) [ ( - 1 ) ] if ( not help_path ) : return AccessDenied ( 'Error: Invalid help path.' ) try : user_record = aff4 . FACTORY . Open ( aff4 . ROOT_URN . Add ( 'users' ) . Add ( request . user ) , aff4_users . GRRUser , token = BuildToken ( request , 60 ) ) settings = user_record . Get ( user_record . Schema . GUI_SETTINGS ) except IOError : settings = aff4_users . GRRUser . SchemaCls . GUI_SETTINGS ( ) if ( settings . docs_location == settings . DocsLocation . REMOTE ) : return RedirectToRemoteHelp ( help_path ) else : static_handler_components = urls . static_handler . split ( '.' ) static_handler_module = importlib . import_module ( '.' . join ( static_handler_components [ 0 : ( - 1 ) ] ) ) static_handler = getattr ( static_handler_module , static_handler_components [ ( - 1 ) ] ) return static_handler ( request , path , document_root = config_lib . CONFIG [ 'AdminUI.help_root' ] )
either serves local help files or redirects to the remote ones .