<commit_before>#!/usr/bin/python

GQRX_IP_ADDRESS = "127.0.0.1:7356"

FREQLIST = [
    # frequency, threshold, description
    (461.7125e6, -70, "RochRad 01"),
    (462.0375e6, -70, "RochRad 02"),
    (463.2375e6, -70, "RochRad 03"),
    (464.5875e6, -70, "RochRad 04"),
    (462.0875e6, -70, "RochRad 05"),
    (461.4125e6, -70, "RochRad 06"),
    (461.8375e6, -70, "RochRad 07"),
    (463.7875e6, -70, "RochRad 08"),
    (461.5000e6, -70, "FlwrCty 01"),
    (463.9500e6, -70, "FlwrCty 02"),
    (464.1750e6, -70, "FlwrCty 03"),
    (461.1500e6, -70, "FlwrCty 05"),
    (461.2750e6, -70, "FlwrCty 06"),
    (453.6750e6, -70, "MCC-B BldgSv"),
    (453.2000e6, -70, "MCC-B Safety"),
    (444.4000e6, -70, "W2RFC Repeater"),
    (463.4125e6, -70, "RIT Crew 1"),
    (468.4125e6, -70, "RIT Crew 2"),
    (864.2125e6, -60, "RIT Dispatch"),
]

import Hamlib
import random
import sys
import time


class NetRig(object):

    rig = None

    def __init__(self, addr):
        self.rig = Hamlib.Rig(Hamlib.RIG_MODEL_NETRIGCTL)
        self.rig.set_conf("rig_pathname", addr)
        self.rig.open()

        self.rig.rig.state.has_get_level = Hamlib.RIG_LEVEL_STRENGTH

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.rig.close()

    def rssi(self):
        return self.rig.get_level_i(Hamlib.RIG_LEVEL_STRENGTH)


def set_title(text):
    sys.stdout.write("\x1B]0;%s\x07" % (text, GQRX_IP_ADDRESS))
    sys.stdout.flush()


def main():
    Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
    #Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_TRACE)

    set_title("scan.py: initializing")
    print("Beginning scan sequence: %s" % GQRX_IP_ADDRESS)

    # Connect to the GQRX server
    with NetRig(GQRX_IP_ADDRESS) as gqrx:<commit_msg>remove vestigial breaking code<commit_after>#!/usr/bin/python

GQRX_IP_ADDRESS = "127.0.0.1:7356"

FREQLIST = [
    # frequency, threshold, description
    (461.7125e6, -70, "RochRad 01"),
    (462.0375e6, -70, "RochRad 02"),
    (463.2375e6, -70, "RochRad 03"),
    (464.5875e6, -70, "RochRad 04"),
    (462.0875e6, -70, "RochRad 05"),
    (461.4125e6, -70, "RochRad 06"),
    (461.8375e6, -70, "RochRad 07"),
    (463.7875e6, -70, "RochRad 08"),
    (461.5000e6, -70, "FlwrCty 01"),
    (463.9500e6, -70, "FlwrCty 02"),
    (464.1750e6, -70, "FlwrCty 03"),
    (461.1500e6, -70, "FlwrCty 05"),
    (461.2750e6, -70, "FlwrCty 06"),
    (453.6750e6, -70, "MCC-B BldgSv"),
    (453.2000e6, -70, "MCC-B Safety"),
    (444.4000e6, -70, "W2RFC Repeater"),
    (463.4125e6, -70, "RIT Crew 1"),
    (468.4125e6, -70, "RIT Crew 2"),
    (864.2125e6, -60, "RIT Dispatch"),
]

import Hamlib
import random
import sys
import time


class NetRig(object):

    rig = None

    def __init__(self, addr):
        self.rig = Hamlib.Rig(Hamlib.RIG_MODEL_NETRIGCTL)
        self.rig.set_conf("rig_pathname", addr)
        self.rig.open()

        self.rig.rig.state.has_get_level = Hamlib.RIG_LEVEL_STRENGTH

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.rig.close()

    def rssi(self):
        return self.rig.get_level_i(Hamlib.RIG_LEVEL_STRENGTH)


def set_title(text):
    sys.stdout.write("\x1B]0;%s\x07" % text)
    sys.stdout.flush()


def main():
    Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
    #Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_TRACE)

    set_title("scan.py: initializing")
    print("Beginning scan sequence: %s" % GQRX_IP_ADDRESS)

    # Connect to the GQRX server
    with NetRig(GQRX_IP_ADDRESS) as gqrx:
{'fraction_non_alphanumeric': 0.1667607223476298, 'fraction_numerical': 0.13148984198645597, 'mean_word_length': 3.0514285714285716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4237622', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1540, 'n_words': 295}