<commit_before>"""Hardware abstraction for ADS7830 ADC"""

import time

from i2c_device.i2c_device import I2CDevice

import bbb.pwm as pwm_mod
import bot.lib.lib as lib

class ADC(object):
    
    """Class for communicating with ADS_7830 external ADC's"""

    def __init__(self):
            """Initialized I2C device"""
            self.logger = lib.get_logger()
            self.bot_config = lib.get_config()

            # Handle off-bone runs
            if self.bot_config["test_mode"]["ADC"]:
                self.logger.debug("Running in test mode")
            else:
                self.logger.debug("Running in non-test mode")

                # Setup I2C
                I2CDevice.__init__(self, 1, 0x12,
                                config='adc_ads7830_i2c.yaml')<commit_msg>Added instantiation args to ADC class (as opposed to hard-coded address<commit_after>"""Hardware abstraction for ADS7830 ADC"""

import time

from i2c_device.i2c_device import I2CDevice

import bbb.pwm as pwm_mod
import bot.lib.lib as lib

class ADC(object):
    
    """Class for communicating with ADS_7830 external ADC's"""

    def __init__(self, i2c_bus, i2c_address):
            """Initialized I2C device"""
            self.logger = lib.get_logger()
            self.bot_config = lib.get_config()

            # Bus location and address of ADC.
            self.bus = i2c_bus
            self.addr = i2c_address

            # Handle off-bone runs
            if self.bot_config["test_mode"]["ADC"]:
                self.logger.debug("Running in test mode")
            else:
                self.logger.debug("Running in non-test mode")
{'fraction_non_alphanumeric': 0.09590714722052535, 'fraction_numerical': 0.023824068417837508, 'mean_word_length': 2.1319311663479925, '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': '3783475', 'n_tokens_mistral': 520, 'n_tokens_neox': 485, 'n_words': 129}