def check_session(kwargs):
 if (not check_access()):
  return u'Access denied'
 key = kwargs.get('session')
 if (not key):
  key = kwargs.get('apikey')
 msg = None
 if (not key):
  logging.warning(T('Missing Session key'))
  msg = T('Error: Session Key Required')
 elif (key != cfg.api_key()):
  logging.warning(T('Error: Session Key Incorrect'))
  msg = T('Error: Session Key Incorrect')
 return msg

def check_session ( kwargs ) : if ( not check_access ( ) ) : return u'Access denied' key = kwargs . get ( 'session' ) if ( not key ) : key = kwargs . get ( 'apikey' ) msg = None if ( not key ) : logging . warning ( T ( 'Missing Session key' ) ) msg = T ( 'Error: Session Key Required' ) elif ( key != cfg . api_key ( ) ) : logging . warning ( T ( 'Error: Session Key Incorrect' ) ) msg = T ( 'Error: Session Key Incorrect' ) return msg
check session key .