<commit_before>import copy, os, rospy, cv2, cv_bridge, json, time, threading
from Queue import Queue

from baxter_dataflow import wait_for

from sensor_msgs.msg import (
    Image,
)

import baxter_artist.msg
from . import BaxterController, KEYS_FILENAME, IMAGE_PATH

notes = {"B5":"63",
        "C6":"64",
        "D6":"66",
        "E6":"68",
        "F6":"69",
        "G6":"71",
        "A6":"73",
        "B6":"75",
        "C7":"76"}

class NoteSubscriber(threading.Thread):
    def __init__(self,q):
        threading.Thread.__init__(self)
        self.q = q

    def on_receive_note(self,data):
        rospy.loginfo("receive - pitch: " + str(data.pitch))
        self.q.put(data)

    def run(self):
        rospy.Subscriber("baxter_artist_notes", baxter_artist.msg.Note, self.on_receive_note)
        rospy.spin()

class Performer(BaxterController):
    def __init__(self):
        """
        Performs the instrument like a boss
        """
        BaxterController.__init__(self)
        self.set_neutral()
        self.q = Queue()

        with open(KEYS_FILENAME) as f:
            self.keys = json.load(f)

        self.right_notes = [int(x) for x in keys['right'].keys()]
        self.left_notes = [int(x) for x in keys['left'].keys()]

    def flick(self,arm,current_pos):
        down_pos = copy.deepcopy(current_pos)
        down_pos[arm + "_w1"] = current_pos[arm + "_w1"] + 0.08

        arm_obj = (self.left_arm if arm == "left" else self.right_arm)

        wait_for(lambda: self.checkJointPositions(down_pos, arm), rate=4, timeout=2.0, body=arm_obj.set_joint_positions(down_pos))<commit_msg>Fixed class member error<commit_after>import copy, os, rospy, cv2, cv_bridge, json, time, threading
from Queue import Queue

from baxter_dataflow import wait_for

from sensor_msgs.msg import (
    Image,
)

import baxter_artist.msg
from . import BaxterController, KEYS_FILENAME, IMAGE_PATH

notes = {"B5":"63",
        "C6":"64",
        "D6":"66",
        "E6":"68",
        "F6":"69",
        "G6":"71",
        "A6":"73",
        "B6":"75",
        "C7":"76"}

class NoteSubscriber(threading.Thread):
    def __init__(self,q):
        threading.Thread.__init__(self)
        self.q = q

    def on_receive_note(self,data):
        rospy.loginfo("receive - pitch: " + str(data.pitch))
        self.q.put(data)

    def run(self):
        rospy.Subscriber("baxter_artist_notes", baxter_artist.msg.Note, self.on_receive_note)
        rospy.spin()

class Performer(BaxterController):
    def __init__(self):
        """
        Performs the instrument like a boss
        """
        BaxterController.__init__(self)
        self.set_neutral()
        self.q = Queue()

        with open(KEYS_FILENAME) as f:
            self.keys = json.load(f)

        self.right_notes = [int(x) for x in self.keys['right'].keys()]
        self.left_notes = [int(x) for x in self.keys['left'].keys()]

    def flick(self,arm,current_pos):
        down_pos = copy.deepcopy(current_pos)
        down_pos[arm + "_w1"] = current_pos[arm + "_w1"] + 0.08

        arm_obj = (self.left_arm if arm == "left" else self.right_arm)

        wait_for(lambda: self.checkJointPositions(down_pos, arm), rate=4, timeout=2.0, body=arm_obj.set_joint_positions(down_pos))
{'fraction_non_alphanumeric': 0.14026453398954167, 'fraction_numerical': 0.02214703168255921, 'mean_word_length': 2.763888888888889, 'pattern_counts': {'":': 18, '<': 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': '5429642', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1139, 'n_words': 224}