<commit_before>from .instrument import Instrument, Command, FloatCommand

class Picosecond10070A(Instrument):
    """Picosecond 10070A Pulser"""
    amplitude = Command("amplitude", get_string="amplitude?", set_string="amplitude {:g}")
    delay = FloatCommand("delay", get_string="delay?", set_string="delay {:g}")
    duration = FloatCommand("duration", get_string="duration?", set_string="duration {:g}")
    level = FloatCommand("level", get_string="level?", set_string="level {:g}")
    period = FloatCommand("period", get_string="period?", set_string="period {:g}")
    frequency = FloatCommand("frequency", get_string="frequency?", set_string="frequency {:g}")
    offset = FloatCommand("offset", get_string="offset?", set_string="offset {:g}")
    output = FloatCommand("offset", get_string="offset?", set_string="offset {:g}")

    def __init__(self, resourceName, *args, **kwargs):
        super(Picosecond10070A, self).__init__(resourceName, "Picosecond 10070A Pulser", *args, **kwargs)
        self.write("header off")
        self.write("trigger GPIB")

    # This command is syntactically screwy
    @property
    def output(self):
        return self.ask("enable?") == "YES"
    @output.setter
    def output(self, value):
        if value:
            self.write("enable")
        else:
            self.write("disable")<commit_msg>:art: Formatting changes, slight fixes<commit_after>from .instrument import Instrument, Command, FloatCommand

class Picosecond10070A(Instrument):
    """Picosecond 10070A Pulser"""
    amplitude = FloatCommand("amplitude", get_string="amplitude?", set_string="amplitude {:g}")
    delay     = FloatCommand("delay", get_string="delay?", set_string="delay {:g}")
    duration  = FloatCommand("duration", get_string="duration?", set_string="duration {:g}")
    level     = FloatCommand("level", get_string="level?", set_string="level {:g}")
    period    = FloatCommand("period", get_string="period?", set_string="period {:g}")
    frequency = FloatCommand("frequency", get_string="frequency?", set_string="frequency {:g}")
    offset    = FloatCommand("offset", get_string="offset?", set_string="offset {:g}")

    def __init__(self, name, resource_name, *args, **kwargs):
        super(Picosecond10070A, self).__init__(name, resource_name, *args, **kwargs)
        self.interface.write("header off")
        self.interface.write("trigger GPIB")
        self.interface._instrument.read_termination = u"\n"

    # This command is syntactically screwy
    @property
    def output(self):
        return self.interface.query("enable?") == "YES"
    @output.setter
    def output(self, value):
        if value:
            self.interface.write("enable")
        else:
            self.interface.write("disable")

    def trigger(self):
        self.interface.write("*TRG")
{'fraction_non_alphanumeric': 0.15660511363636365, 'fraction_numerical': 0.012428977272727272, 'mean_word_length': 4.365714285714286, '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': '2818359', 'n_tokens_mistral': 867, 'n_tokens_neox': 798, 'n_words': 176}