<commit_before>package org.auditioner.services;

import io.dropwizard.Application;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.jdbi.DBIFactory;
import io.dropwizard.migrations.MigrationsBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.auditioner.services.family.FamilyDAO;
import org.auditioner.services.family.FamilyResource;
import org.auditioner.services.production.ProductionDAO;
import org.auditioner.services.production.ProductionResource;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.skife.jdbi.v2.DBI;

import javax.servlet.DispatcherType;
import javax.servlet.FilterRegistration;
import java.util.EnumSet;

public class AuditionApplication extends Application<AuditionConfiguration>
{
    @Override
    public void initialize(Bootstrap<AuditionConfiguration> bootstrap) {
        bootstrap.addBundle(new MigrationsBundle<AuditionConfiguration>() {
            @Override
            public DataSourceFactory getDataSourceFactory(
                    AuditionConfiguration configuration) {
                return configuration.getDataSourceFactory();
            }
        });
    }

    @Override
    public void run(AuditionConfiguration configuration, Environment environment) throws Exception {

        FilterRegistration.Dynamic filter = environment.servlets().addFilter("CORS", CrossOriginFilter.class);

        // Add URL mapping
        filter.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM, "GET,PUT,POST,DELETE,OPTIONS");
        filter.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "*");
        filter.setInitParameter(CrossOriginFilter.TIMING_ALLOW_ORIGIN_HEADER , "*");
        filter.setInitParameter(CrossOriginFilter.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
        filter.setInitParameter(CrossOriginFilter.ACCESS_CONTROL_EXPOSE_HEADERS_HEADER, "Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,Location");
        filter.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM, "Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,Location");
        filter.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM, "true");
        filter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");


        DBIFactory dbiFactory = new DBIFactory();

        final DBI jdbi = dbiFactory.build(environment, configuration.getDataSourceFactory(), "auditioner-connection");

        final FamilyDAO familyDAO = jdbi.onDemand(FamilyDAO.class);
        environment.jersey().register(new FamilyResource(familyDAO));

        final ProductionDAO productionDAO = jdbi.onDemand(ProductionDAO.class);
        environment.jersey().register(new ProductionResource(productionDAO));
    }
}<commit_msg>updated auditiona application by adding familymember dao<commit_after>package org.auditioner.services;

import io.dropwizard.Application;
import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.jdbi.DBIFactory;
import io.dropwizard.migrations.MigrationsBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.auditioner.services.family.FamilyDAO;
import org.auditioner.services.family.FamilyResource;
import org.auditioner.services.family.member.FamilyMemberDAO;
import org.auditioner.services.family.member.FamilyMemberResource;
import org.auditioner.services.production.ProductionDAO;
import org.auditioner.services.production.ProductionResource;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.skife.jdbi.v2.DBI;

import javax.servlet.DispatcherType;
import javax.servlet.FilterRegistration;
import java.util.EnumSet;

public class AuditionApplication extends Application<AuditionConfiguration>
{
    @Override
    public void initialize(Bootstrap<AuditionConfiguration> bootstrap) {
        bootstrap.addBundle(new MigrationsBundle<AuditionConfiguration>() {
            @Override
            public DataSourceFactory getDataSourceFactory(
                    AuditionConfiguration configuration) {
                return configuration.getDataSourceFactory();
            }
        });
    }

    @Override
    public void run(AuditionConfiguration configuration, Environment environment) throws Exception {

        FilterRegistration.Dynamic filter = environment.servlets().addFilter("CORS", CrossOriginFilter.class);

        // Add URL mapping
        filter.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM, "GET,PUT,POST,DELETE,OPTIONS");
        filter.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "*");
        filter.setInitParameter(CrossOriginFilter.TIMING_ALLOW_ORIGIN_HEADER , "*");
        filter.setInitParameter(CrossOriginFilter.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
        filter.setInitParameter(CrossOriginFilter.ACCESS_CONTROL_EXPOSE_HEADERS_HEADER, "Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,Location");
        filter.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM, "Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,Location");
        filter.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM, "true");
        filter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");


        DBIFactory dbiFactory = new DBIFactory();

        final DBI jdbi = dbiFactory.build(environment, configuration.getDataSourceFactory(), "auditioner-connection");

        final FamilyDAO familyDAO = jdbi.onDemand(FamilyDAO.class);
        environment.jersey().register(new FamilyResource(familyDAO));

        final FamilyMemberDAO familyMemberDAO = jdbi.onDemand(FamilyMemberDAO.class);
        environment.jersey().register(new FamilyMemberResource(familyDAO,familyMemberDAO));

        final ProductionDAO productionDAO = jdbi.onDemand(ProductionDAO.class);
        environment.jersey().register(new ProductionResource(productionDAO));
    }
}
{'fraction_non_alphanumeric': 0.09340751981116169, 'fraction_numerical': 0.0003372112628561794, 'mean_word_length': 5.022335025380711, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2278167', 'n_tokens_mistral': 1640, 'n_tokens_neox': 1603, 'n_words': 222}