<commit_before>// @(#)root/alien:$Name:  $:$Id: TAlienProof.cxx,v 1.0 2003/09/05 11:29:24 peters Exp $
// Author: <NAME> 05/09/2003

/*************************************************************************
 * Copyright (C) 1995-2002, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TAlienProof                                                          //
//                                                                      //
// Class defining the interface to AliEn GRID PROOF Services.           //
// Objects of this class are created by TAlien methods.                 //
//                                                                      //
// Related classes are TAlien.                                          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include <stdlib.h>
#include "TUrl.h"
#include "TBrowser.h"
#include "TAlien.h"
#include "TROOT.h"
#include "TAuthenticate.h"

#define ALIEN_POSIX
#include <AliEnAPI++.h>


ClassImp(TAlienProof)

//______________________________________________________________________________
TAlienProof::TAlienProof() : TGridProof()
{
   // Create AliEn PROOF interface.

   for (int i = 0; i < kALIENPROOFMAXSITES; i++) {
      fSites[i]  = 0;
      fNtimes[i] = 0;
   }
   fNsites = 0;

   if (gGrid) {
      gGrid->SetGridProof(this);
   }
}

//______________________________________________________________________________
TAlienProof::~TAlienProof()
{
   // Cleanup Grid PROOF session.

   for (int i = 0; i < kALIENPROOFMAXSITES; i++) {
      delete fSites[i];
      delete fNtimes[i];
   }
}

//______________________________________________________________________________
Bool_t TAlienProof::Request(TDSet *dse)
{
   // Request the startup of PROOF depending on the information in the TDSet.
   // Returns false in case of error.

   if (!gGrid->IsConnected() || !dse)
      return kFALSE;

   // pack the dataset
   dse->GridPack();

   // extract the required sites
   fNsites = DSetMsnExtraction(dse);

   fProofSession = gGrid->RequestProofSession(gGrid->GetUser(), fNsites,
                                  (void **) &fSites, (void **) &fNtimes, 0, 0);

   if (fProofSession &&
       (((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId != 0)) {
      fProofMasterUrl =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->masterurl.c_str();
      fProofLogin =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->login.c_str();
      fProofPasswd =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->password.c_str();
      fProofConfigFile =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->configfile.c_str();
      fProofSiteBlob =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->siteblob.c_str();
      Info("Request", "PROOF request accepted: your session ID is %4d",
             ((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId);
      printf("--------------------------------------------------------\n");
      ps(((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId);
      printf("--------------------------------------------------------\n");
      const char *siteblob = GetSiteBlob();
      DSetProofServiceAnswer(dse);
      DSetRepack(dse);
      return kTRUE;
   } else {
      Info("Request", "PROOF request rejected!");
      return kFALSE;
   }
}

//______________________________________________________________________________<commit_msg>remove unused variable.<commit_after>// @(#)root/alien:$Name:  $:$Id: TAlienProof.cxx,v 1.1 2003/11/13 15:15:11 rdm Exp $
// Author: <NAME> 05/09/2003

/*************************************************************************
 * Copyright (C) 1995-2002, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TAlienProof                                                          //
//                                                                      //
// Class defining the interface to AliEn GRID PROOF Services.           //
// Objects of this class are created by TAlien methods.                 //
//                                                                      //
// Related classes are TAlien.                                          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include <stdlib.h>
#include "TUrl.h"
#include "TBrowser.h"
#include "TAlien.h"
#include "TROOT.h"
#include "TAuthenticate.h"

#define ALIEN_POSIX
#include <AliEnAPI++.h>


ClassImp(TAlienProof)

//______________________________________________________________________________
TAlienProof::TAlienProof() : TGridProof()
{
   // Create AliEn PROOF interface.

   for (int i = 0; i < kALIENPROOFMAXSITES; i++) {
      fSites[i]  = 0;
      fNtimes[i] = 0;
   }
   fNsites = 0;

   if (gGrid) {
      gGrid->SetGridProof(this);
   }
}

//______________________________________________________________________________
TAlienProof::~TAlienProof()
{
   // Cleanup Grid PROOF session.

   for (int i = 0; i < kALIENPROOFMAXSITES; i++) {
      delete fSites[i];
      delete fNtimes[i];
   }
}

//______________________________________________________________________________
Bool_t TAlienProof::Request(TDSet *dse)
{
   // Request the startup of PROOF depending on the information in the TDSet.
   // Returns false in case of error.

   if (!gGrid->IsConnected() || !dse)
      return kFALSE;

   // pack the dataset
   dse->GridPack();

   // extract the required sites
   fNsites = DSetMsnExtraction(dse);

   fProofSession = gGrid->RequestProofSession(gGrid->GetUser(), fNsites,
                                  (void **) &fSites, (void **) &fNtimes, 0, 0);

   if (fProofSession &&
       (((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId != 0)) {
      fProofMasterUrl =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->masterurl.c_str();
      fProofLogin =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->login.c_str();
      fProofPasswd =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->password.c_str();
      fProofConfigFile =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->configfile.c_str();
      fProofSiteBlob =
          ((TAliEnAPI::ProofSession_T *) fProofSession)->siteblob.c_str();
      Info("Request", "PROOF request accepted: your session ID is %4d",
             ((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId);
      printf("--------------------------------------------------------\n");
      ps(((TAliEnAPI::ProofSession_T *) fProofSession)->sessionId);
      printf("--------------------------------------------------------\n");
      DSetProofServiceAnswer(dse);
      DSetRepack(dse);
      return kTRUE;
   } else {
      Info("Request", "PROOF request rejected!");
      return kFALSE;
   }
}

//______________________________________________________________________________
{'fraction_non_alphanumeric': 0.20724220022553566, 'fraction_numerical': 0.010274401704047111, 'mean_word_length': 1.589036652611093, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 42, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7626617', 'n_tokens_mistral': 2047, 'n_tokens_neox': 1946, 'n_words': 412}