<commit_before>from heterodyne import RoachHeterodyne
from r2heterodyne import Roach2Heterodyne
from attenuator import Attenuator
from kid_readout.settings import *


def r2_with_mk2(**kwargs):
    attenuator = Attenuator()
    r2 = Roach2Heterodyne(roachip=ROACH2_IP, adc_valon=ROACH2_VALON, host_ip=ROACH2_GBE_HOST_IP, lo_valon=MARK2_VALON,
                          attenuator=attenuator,**kwargs)
    return r2


def r2_with_mk1(**kwargs):
    r2 = Roach2Heterodyne(roachip=ROACH2_IP, adc_valon=ROACH2_VALON, host_ip=ROACH2_GBE_HOST_IP, lo_valon=None,
                          attenuator=None,**kwargs)
    return r2

   
def r1_with_mk2(**kwargs):
    attenuator = Attenuator()
    if MARK2_VALON is None:  # If lo_valon is None the roach will use its internal valon, with unfortunate results.
        raise ValueError("MARK2_VALON is None.")
    r1 = RoachHeterodyne(roachip=ROACH1_IP, adc_valon=ROACH1_VALON, host_ip=ROACH1_HOST_IP, lo_valon=MARK2_VALON,
                         attenuator=attenuator, **kwargs)
    return r1
    

def r1_with_mk1(**kwargs):
    r1 = RoachHeterodyne(roachip=ROACH1_IP, adc_valon=ROACH1_VALON, host_ip=ROACH1_HOST_IP, lo_valon=None,
                         attenuator=None,**kwargs)
    return r1<commit_msg>Extend check for MARK2_VALON validity<commit_after>from heterodyne import RoachHeterodyne
from r2heterodyne import Roach2Heterodyne
from attenuator import Attenuator
from kid_readout.settings import *


def r2_with_mk2(**kwargs):
    attenuator = Attenuator()
    if MARK2_VALON is None:  # If lo_valon is None the roach will use its internal valon, with unfortunate results.
        raise ValueError("MARK2_VALON is None.")
    r2 = Roach2Heterodyne(roachip=ROACH2_IP, adc_valon=ROACH2_VALON, host_ip=ROACH2_GBE_HOST_IP, lo_valon=MARK2_VALON,
                          attenuator=attenuator,**kwargs)
    return r2


def r2_with_mk1(**kwargs):
    r2 = Roach2Heterodyne(roachip=ROACH2_IP, adc_valon=ROACH2_VALON, host_ip=ROACH2_GBE_HOST_IP, lo_valon=None,
                          attenuator=None,**kwargs)
    return r2

   
def r1_with_mk2(**kwargs):
    attenuator = Attenuator()
    if MARK2_VALON is None:  # If lo_valon is None the roach will use its internal valon, with unfortunate results.
        raise ValueError("MARK2_VALON is None.")
    r1 = RoachHeterodyne(roachip=ROACH1_IP, adc_valon=ROACH1_VALON, host_ip=ROACH1_HOST_IP, lo_valon=MARK2_VALON,
                         attenuator=attenuator, **kwargs)
    return r1
    

def r1_with_mk1(**kwargs):
    r1 = RoachHeterodyne(roachip=ROACH1_IP, adc_valon=ROACH1_VALON, host_ip=ROACH1_HOST_IP, lo_valon=None,
                         attenuator=None,**kwargs)
    return r1
{'fraction_non_alphanumeric': 0.07766629505759941, 'fraction_numerical': 0.027870680044593088, 'mean_word_length': 3.747795414462081, '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': '3728349', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1001, 'n_words': 189}