<commit_before>from connection import ZConnection, HTTPConnection
from requests.exceptions import *
from requests.models import Response

import requests
import urlparse
import json

dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime) else None

class SolrResponse(object):
    def __init__(self,_dict):
        self.dict = _dict
        if not self.dict:
            return

        response = self.dict['response']
        self.hits = int(response['numFound'])
        self.docs = response['docs']

    def __repr__(self):
        if not self.dict:
            return "Empty SolrResponse"
        
        return "SolrResponse(hits=%i)" % (self.hits)
    
class SolrRequest(object):
    def __init__(self,connection,collection):
        self.connection = connection
        self.collection = collection
        self.client = requests.Session()
        
    def _send(self,path,params,method='GET',body=None):<commit_msg>rename<commit_after>from connection import ZConnection, HTTPConnection
from requests.exceptions import *
from requests.models import Response

import requests
import urlparse
import json

dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime) else None

class SolrResponse(object):
    def __init__(self,_dict):
        self.dict = _dict
        if not self.dict:
            return

        response = self.dict['response']
        self.hits = int(response['numFound'])
        self.docs = response['docs']

    def __repr__(self):
        if not self.dict:
            return "Empty SolrResponse"
        
        return "SolrResponse(hits=%i)" % (self.hits)
    
class SolrIndex(object):
    def __init__(self,connection,collection):
        self.connection = connection
        self.collection = collection
        self.client = requests.Session()
        
    def _send(self,path,params,method='GET',body=None):
{'fraction_non_alphanumeric': 0.09737827715355805, 'fraction_numerical': 0.0, 'mean_word_length': 2.9368421052631577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6052089', 'n_tokens_mistral': 515, 'n_tokens_neox': 509, 'n_words': 131}