<commit_before>package com.podio;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Locale;
import java.util.TimeZone;

import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.codehaus.jackson.map.DeserializationConfig.Feature;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import org.codehaus.jackson.map.deser.CustomDeserializerFactory;
import org.codehaus.jackson.map.deser.StdDeserializerProvider;
import org.codehaus.jackson.map.ser.CustomSerializerFactory;
import org.eclipse.jetty.http.HttpHeaders;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;

import com.podio.oauth.OAuthClientCredentials;
import com.podio.oauth.OAuthUserCredentials;
import com.podio.serialize.DateTimeDeserializer;
import com.podio.serialize.DateTimeSerializer;
import com.podio.serialize.LocalDateDeserializer;
import com.podio.serialize.LocalDateSerializer;
import com.podio.serialize.LocaleDeserializer;
import com.podio.serialize.LocaleSerializer;
import com.podio.serialize.TimeZoneDeserializer;
import com.podio.serialize.TimeZoneSerializer;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter;

/**
 * This is the main low level entry point to access the Podio API. Construct
 * this and pass it to the APIFactory.
 */
public final class ResourceFactory {

	private final WebResource apiResource;
	private final WebResource fileResource;

	private final LoginFilter loginFilter;

	public ResourceFactory(OAuthClientCredentials clientCredentials,
			OAuthUserCredentials userCredentials) {
		this("api.podio.com", "file.podio.<EMAIL>", 443, true, false,
				clientCredentials, userCredentials);
	}

	public ResourceFactory(String apiHostname, String fileHostname, int port,
			boolean ssl, boolean dryRun,
			OAuthClientCredentials clientCredentials,
			OAuthUserCredentials userCredentials) {
		ClientConfig config = new DefaultClientConfig();
		config.getSingletons().add(getJsonProvider());
		Client client = Client.create(config);
		client.addFilter(new GZIPContentEncodingFilter(false));
		client.addFilter(new ExceptionFilter());
		if (dryRun) {
			client.addFilter(new DryRunFilter());
		}
		// client.addFilter(new LoggingFilter());

		this.apiResource = client.resource(getURI(apiHostname, port, ssl));
		apiResource.header(HttpHeaders.USER_AGENT, "Podio Java API Client");
		this.fileResource = client.resource(getURI(fileHostname, port, ssl));
		fileResource.header(HttpHeaders.USER_AGENT, "Podio Java API Client");

		AuthProvider authProvider = new AuthProvider(this, clientCredentials,
				userCredentials);
		this.loginFilter = new LoginFilter(authProvider);
	}

	private URI getURI(String hostname, int port, boolean ssl) {
		try {
			return new URI(ssl ? "https" : "http", null, hostname, port, null,
					null, null);
		} catch (URISyntaxException e) {
			throw new RuntimeException(e);
		}<commit_msg>fixing "Uploading file: classloading issue"<commit_after>package com.podio;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Locale;
import java.util.TimeZone;

import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.codehaus.jackson.map.DeserializationConfig.Feature;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import org.codehaus.jackson.map.deser.CustomDeserializerFactory;
import org.codehaus.jackson.map.deser.StdDeserializerProvider;
import org.codehaus.jackson.map.ser.CustomSerializerFactory;
import org.eclipse.jetty.http.HttpHeaders;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;

import com.podio.oauth.OAuthClientCredentials;
import com.podio.oauth.OAuthUserCredentials;
import com.podio.serialize.DateTimeDeserializer;
import com.podio.serialize.DateTimeSerializer;
import com.podio.serialize.LocalDateDeserializer;
import com.podio.serialize.LocalDateSerializer;
import com.podio.serialize.LocaleDeserializer;
import com.podio.serialize.LocaleSerializer;
import com.podio.serialize.TimeZoneDeserializer;
import com.podio.serialize.TimeZoneSerializer;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.GZIPContentEncodingFilter;
import com.sun.jersey.multipart.impl.MultiPartWriter;

/**
 * This is the main low level entry point to access the Podio API. Construct
 * this and pass it to the APIFactory.
 */
public final class ResourceFactory {

	private final WebResource apiResource;
	private final WebResource fileResource;

	private final LoginFilter loginFilter;

	public ResourceFactory(OAuthClientCredentials clientCredentials,
			OAuthUserCredentials userCredentials) {
		this("api.podio.com", "file.podio.com", 443, true, false,
				clientCredentials, userCredentials);
	}

	public ResourceFactory(String apiHostname, String fileHostname, int port,
			boolean ssl, boolean dryRun,
			OAuthClientCredentials clientCredentials,
			OAuthUserCredentials userCredentials) {
		ClientConfig config = new DefaultClientConfig();
		config.getSingletons().add(getJsonProvider());
		config.getClasses().add(MultiPartWriter.class);
		Client client = Client.create(config);
		client.addFilter(new GZIPContentEncodingFilter(false));
		client.addFilter(new ExceptionFilter());
		if (dryRun) {
			client.addFilter(new DryRunFilter());
		}
		// client.addFilter(new LoggingFilter());

		this.apiResource = client.resource(getURI(apiHostname, port, ssl));
		apiResource.header(HttpHeaders.USER_AGENT, "Podio Java API Client");
		this.fileResource = client.resource(getURI(fileHostname, port, ssl));
		fileResource.header(HttpHeaders.USER_AGENT, "Podio Java API Client");

		AuthProvider authProvider = new AuthProvider(this, clientCredentials,
				userCredentials);
		this.loginFilter = new LoginFilter(authProvider);
	}

	private URI getURI(String hostname, int port, boolean ssl) {
		try {
			return new URI(ssl ? "https" : "http", null, hostname, port, null,
					null, null);
		} catch (URISyntaxException e) {
			throw new RuntimeException(e);
		}
{'fraction_non_alphanumeric': 0.10055265581823764, 'fraction_numerical': 0.00092109303039607, 'mean_word_length': 6.035637149028077, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7049511', 'n_tokens_mistral': 2050, 'n_tokens_neox': 1955, 'n_words': 401}