<commit_before>#include <iostream>
#include <random>
#include <fstream>
#include <cstdlib>
#include <cmath>
#include <algorithm>

int main(int argc, char *argv[]){

  int N = atoi(argv[1]);
  int K = atoi(argv[2]); //Mean degree.

  int M = (int) round( (N-1)*K / 2.0 );

  std::default_random_engine generator;
  std::uniform_int_distribution<int> distribution(0, N-1);

  std::vector<std::vector<int>> edge_list(N);
  
  int count  = 0;
  int i, j;

  while(count < M) {
    
    i = distribution(generator);
    
    //Avoiding self loops! 
    do {
      j = distribution(generator);
    } while(j == i);
    
    if ( !( std::find(edge_list[i].begin(), edge_list[i].end(), j) != edge_list[i].end() )
	 && !( std::find(edge_list[j].begin(), edge_list[j].end(), i) != edge_list[j].end() ) ){
      edge_list[i].push_back(j);
      edge_list[j].push_back(i);
      count += 1;
    }
    
  }

  std::ofstream outFile;

  outFile.open(argv[3]);

  for(int k = 0; k < N; k++)<commit_msg>Redoing ER branch to accomodate growing<commit_after>#include <iostream>
#include <random>
#include <fstream>
#include <cstdlib>
#include <cmath>
#include <algorithm>

int main(int argc, char *argv[]){
  
  int SEED = atoi(argv[1]);  // Seed
  int N = atoi(argv[2]);     // Number of nodes
  int M = atoi(argv[3]);     // Number of nodes
  
  int m0 = 5;                // Initial number of nodes
  double alpha = 1.;         // Switching probability
  
  // Random generators
  std::default_random_engine generator;
  std::uniform_real_distribution<double> ureal(0., 1.);
  
  // Connections
  std::vector<std::vector<int>> edge_list(N);
  
  // Index variables
  int i, j, k;
  
  
  
  // Connecting the initial core
  for ( j = 0; j < m0; j++ )
  {
    for ( i = j+1; i < m0; i++ )
    {
      edge_list[i].push_back(j);
      edge_list[j].push_back(i);
    }
  }
  
  
  // Growing the network
  for ( j = m0; j < N; j++)
  {
    
    if ( ureal(generator) <= alpha) 
    {
      
      // Erdos-Renyi branch
      
      for ( k = 0; k < M; k++ )
      {
	// Choosing a pair
	i = (j-1)*ureal(generator);
	edge_list[i].push_back(j);
	edge_list[j].push_back(i);
      }
      
    }
    else {
      
      // Barabasi-Albert branch
      
      
      
    }
  }
  
  
  std::ofstream outFile;

  outFile.open(argv[4]);

  for(int k = 0; k < N; k++)
{'fraction_non_alphanumeric': 0.1712943186672362, 'fraction_numerical': 0.01196070055531824, 'mean_word_length': 2.384393063583815, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2045779', 'n_tokens_mistral': 929, 'n_tokens_neox': 896, 'n_words': 200}