<commit_before>import collections
import confluent.interface.console
import confluent.messages as msg
import eventlet
import eventlet.event
import eventlet.greenpool as greenpool
import eventlet.queue
import os
import pyghmi.ipmi.console as console
import pyghmi.ipmi.command as ipmicommand
console.session.select = eventlet.green.select

_ipmithread = None
#pullchain is a pipe to tug on to induce the ipmi thread process pending data
pullchain = None
chainpulled = False
tmptimeout = None
ipmiq = collections.deque([])
ipmiwaiters = collections.deque([])


def wait_on_ipmi():
    waitevt = eventlet.event.Event()
    ipmiwaiters.append(waitevt)
    waitevt.wait()


def _ipmi_evtloop():
    global tmptimeout
    global pullchain
    console.session.Session.register_handle_callback(pullchain[0],
                                                     _process_chgs)
    while (1):
        try:
            if tmptimeout is not None:
                console.session.Session.wait_for_rsp(timeout=tmptimeout)
                tmptimeout = None
            else:
                console.session.Session.wait_for_rsp(timeout=600)
            while ipmiwaiters:
                waiter = ipmiwaiters.popleft()
                waiter.send()
        except:
            print "Whoops, that was a doozy"

def _process_chgs(intline):
    #here we receive functions to run in our thread
    #the tuples on the deque consist of:<commit_msg>Last change made exit fail badly, correct that<commit_after>import collections
import confluent.interface.console
import confluent.messages as msg
import eventlet
import eventlet.event
import eventlet.greenpool as greenpool
import eventlet.queue
import os
import pyghmi.ipmi.console as console
import pyghmi.ipmi.command as ipmicommand
console.session.select = eventlet.green.select

_ipmithread = None
#pullchain is a pipe to tug on to induce the ipmi thread process pending data
pullchain = None
chainpulled = False
tmptimeout = None
ipmiq = collections.deque([])
ipmiwaiters = collections.deque([])


def wait_on_ipmi():
    waitevt = eventlet.event.Event()
    ipmiwaiters.append(waitevt)
    waitevt.wait()


def _ipmi_evtloop():
    global tmptimeout
    global pullchain
    console.session.Session.register_handle_callback(pullchain[0],
                                                     _process_chgs)
    while (1):
        try:
            if tmptimeout is not None:
                console.session.Session.wait_for_rsp(timeout=tmptimeout)
                tmptimeout = None
            else:
                console.session.Session.wait_for_rsp(timeout=600)
            while ipmiwaiters:
                waiter = ipmiwaiters.popleft()
                waiter.send()
        except RunTimeError:
            raise
        except:
            print "Whoops, that was a doozy"

def _process_chgs(intline):
    #here we receive functions to run in our thread
    #the tuples on the deque consist of:
{'fraction_non_alphanumeric': 0.0667574931880109, 'fraction_numerical': 0.0034059945504087193, 'mean_word_length': 2.594859241126071, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1061207', 'n_tokens_mistral': 867, 'n_tokens_neox': 848, 'n_words': 237}