<commit_before>package ro.robertgabriel.configuration;

import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class MongoConfig extends AbstractMongoConfiguration {

    public static final String OPENSHIFT_MONGODB_DB_HOST = "OPENSHIFT_MONGODB_DB_HOST";
    public static final String OPENSHIFT_MONGODB_DB_PORT = "OPENSHIFT_MONGODB_DB_PORT";
    public static final String OPENSHIFT_APP_NAME = "OPENSHIFT_APP_NAME";
    public static final String OPENSHIFT_MONGODB_DB_USERNAME = "OPENSHIFT_MONGODB_DB_USERNAME";
    public static final String OPENSHIFT_MONGODB_DB_PASSWORD = "<PASSWORD>MONGODB_DB_PASSWORD";

    @Override
    protected String getDatabaseName() {
        return getDb();
    }

    @Override
    public Mongo mongo() throws Exception {

        String host = getHost();
        String db = getDb();
        String user = getUser();
        String password = getPassword();
        int port = getPort();

        MongoCredential credential = MongoCredential.createCredential(user,
                db,
                password.toCharArray());

        List<MongoCredential> listMongoCredentials = new ArrayList<MongoCredential>();

        listMongoCredentials.add(credential);

        return new MongoClient(new ServerAddress(host, port), listMongoCredentials);
    }
<commit_msg>implemented roles , need to store them in array<commit_after>package ro.robertgabriel.configuration;

import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class MongoConfig extends AbstractMongoConfiguration {

    private static final String OPENSHIFT_MONGODB_DB_HOST = "OPENSHIFT_MONGODB_DB_HOST";
    private static final String OPENSHIFT_MONGODB_DB_PORT = "OPENSHIFT_MONGODB_DB_PORT";
    private static final String OPENSHIFT_APP_NAME = "OPENSHIFT_APP_NAME";
    private static final String OPENSHIFT_MONGODB_DB_USERNAME = "OPENSHIFT_MONGODB_DB_USERNAME";
    private static final String OPENSHIFT_MONGODB_DB_PASSWORD = "<PASSWORD>";

    @Override
    protected String getDatabaseName() {
        return getDb();
    }

    @Override
    public Mongo mongo() throws Exception {

        String host = getHost();
        String db = getDb();
        String user = getUser();
        String password = <PASSWORD>();
        int port = getPort();

        MongoCredential credential = MongoCredential.createCredential(user,
                db,
                password.toCharArray());

        List<MongoCredential> listMongoCredentials = new ArrayList<MongoCredential>();

        listMongoCredentials.add(credential);

        return new MongoClient(new ServerAddress(host, port), listMongoCredentials);
    }

{'fraction_non_alphanumeric': 0.07697141061891298, 'fraction_numerical': 0.0, 'mean_word_length': 4.110754414125201, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '979833', 'n_tokens_mistral': 927, 'n_tokens_neox': 884, 'n_words': 201}