<commit_before>// $Id$
///
/// @file downloadCDB.C
/// @brief Download a snapshot of the CDB to another folder
///
/// <pre>
/// Usage: aliroot -b -q -l \
///     downloadCDB.C'(runno, "from", "to", "path")'
///
/// Examples:
///     downloadCDB.C'(144991, "alien://folder=/alice/data/2011/OCDB", "local:///tmp/144991/OCDB")'
///
/// Defaults
///     path="*/*/*"  -> download everything
///
/// </pre>
///
///
void downloadCDB(Int_t runnr,
      const char* from,
      const char* to,
      const char* path="*/*/*") 
{
  AliCDBManager* man=AliCDBManager::Instance();
  man->SetDefaultStorage(from);
  man->SetDrain(to);
  AliCDBPath cdbpath(path);
  man->GetAll(path, runnr);
}

void downloadCDB()
{
  cout << " Usage:" << endl;
  cout << "   aliroot -b -q -l \\" << endl;
  cout << "     downloadCDB.C'(runno, \"from\", \"to\", \"path\")'" << endl;
  cout << "" << endl;
  cout << " Examples:" << endl;
  cout << "   aliroot -b -q -l \\" << endl;
  cout << "     downloadCDB.C'(144991, \"alien://folder=/alice/data/2011/OCDB\", \"local:///tmp/144991/OCDB\")'" << endl;
  cout << "" << endl;
  cout << " Defaults" << endl;
  cout << "     path=\"*/*/*\"  -> download everything" << endl;<commit_msg>possibility to create an OCDB snapshot<commit_after>// $Id$
///
/// @file downloadCDB.C
/// @brief Download a snapshot of the CDB to another folder
///
/// <pre>
/// Usage: aliroot -b -q -l \
///     downloadCDB.C'(runno, "from", "to", "path")'
///
/// Examples:
///     downloadCDB.C'(144991, "alien://folder=/alice/data/2011/OCDB", "local:///tmp/144991/OCDB")'
///
/// Defaults
///     path="*/*/*"  -> download everything
///
/// </pre>
///
///
void downloadCDB(Int_t runnr,
      const char* from,
      const char* to,
      const char* path="*/*/*") 
{
  AliCDBManager* man=AliCDBManager::Instance();
  man->SetDefaultStorage(from);
  man->SetRun(runnr);
  man->SetDrain(to);
  AliCDBPath cdbpath(path);
  man->GetAll(path, runnr);

  if(TString(getenv("OCDB_SNAPSHOT_CREATE")) == TString("kTRUE"))
  {
    TString snapshotFile(getenv("OCDB_SNAPSHOT_FILENAME"));

    TString snapshotFileOut = "OCDB.root";
    if(!(snapshotFile.IsNull() || snapshotFile.IsWhitespace()))
    {
      snapshotFileOut = snapshotFile;
    }

    man->DumpToSnapshotFile("OCDB.root",kFALSE);
  }
}

void downloadCDB()
{
  cout << " Usage:" << endl;
  cout << "   aliroot -b -q -l \\" << endl;
  cout << "     downloadCDB.C'(runno, \"from\", \"to\", \"path\")'" << endl;
  cout << "" << endl;
  cout << " Examples:" << endl;
  cout << "   aliroot -b -q -l \\" << endl;
  cout << "     downloadCDB.C'(144991, \"alien://folder=/alice/data/2011/OCDB\", \"local:///tmp/144991/OCDB\")'" << endl;
  cout << "" << endl;
  cout << " Defaults" << endl;
  cout << "     path=\"*/*/*\"  -> download everything" << endl;
{'fraction_non_alphanumeric': 0.2437365783822477, 'fraction_numerical': 0.02290622763063708, 'mean_word_length': 2.6298701298701297, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '742227', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1036, 'n_words': 209}