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

class Picosecond10070A(Instrument):
    """Picosecond 10070A Pulser"""
    amplitude      = FloatCommand(scpi_string="amplitude?")
    delay          = FloatCommand(scpi_string="delay?")
    duration       = FloatCommand(scpi_string="duration?")
    level          = FloatCommand(scpi_string="level?")
    period         = FloatCommand(scpi_string="period?")
    frequency      = FloatCommand(scpi_string="frequency?")
    offset         = FloatCommand(scpi_string="offset?")
    trigger_source = StringCommand(scpi_string="trigger", allowed_values=["INT", "EXT", "GPIB"])

    def __init__(self, resource_name, *args, **kwargs):
        super(Picosecond10070A, self).__init__(resource_name, *args, **kwargs)
        self.name = "Picosecond 10070A Pulser"
        self.interface.write("header off")
        self.interface.write("trigger GPIB")
        self.interface._resource.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")<commit_msg>Fixed refactoring bugs in scpi_strings<commit_after>from .instrument import Instrument, StringCommand, FloatCommand

class Picosecond10070A(Instrument):
    """Picosecond 10070A Pulser"""
    amplitude      = FloatCommand(scpi_string="amplitude")
    delay          = FloatCommand(scpi_string="delay")
    duration       = FloatCommand(scpi_string="duration")
    level          = FloatCommand(scpi_string="level")
    period         = FloatCommand(scpi_string="period")
    frequency      = FloatCommand(scpi_string="frequency")
    offset         = FloatCommand(scpi_string="offset")
    trigger_source = StringCommand(scpi_string="trigger", allowed_values=["INT", "EXT", "GPIB"])

    def __init__(self, resource_name, *args, **kwargs):
        super(Picosecond10070A, self).__init__(resource_name, *args, **kwargs)
        self.name = "Picosecond 10070A Pulser"
        self.interface.write("header off")
        self.interface.write("trigger GPIB")
        self.interface._resource.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.1226207906295754, 'fraction_numerical': 0.014641288433382138, 'mean_word_length': 3.276995305164319, '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': '1774122', 'n_tokens_mistral': 833, 'n_tokens_neox': 774, 'n_words': 147}