def test_add(self): values = Values() self.assertEqual([], values.values()) values.add(4.2) values.add(2.3) self.assertEqual([4.2, 2.3], values.values())
def __init__(self, add_tomorrow): super().__init__() self.path = None self.columns = [] self.v = Values() self.t = Tasks() self.l = Locks() self.ts = TimeSheet() self.table = self.compare_goal_actual(add_tomorrow)
def test_median(self): values = Values([1, 10, 1]) self.assertEqual(1, values.median()) # Returns the average of the two middle values when len(values()) is even. values.add(20) self.assertEqual(5.5, values.median()) values.add(20) self.assertEqual(10, values.median())
def setup_teardown_method(driver): locale.setlocale(locale.LC_ALL, '') self.driver = driver self.logging = logging.basicConfig(filename='exersice1.log', filemode='w') value_end_point = EndPoints.get("base_end_point") + EndPoints.get( "values_end_point") driver.get(value_end_point) self.values_obj = Values(driver, logging) slef.lable_text_dict = self.values.dict_lable_text() yield driver.close()
def twoSAT(link): rules = Cases(link) answer = Values(rules.size) for i in range(int(math.log(answer.n, 2))): answer.generate() for j in range(int((answer.n**2) * 2)): print(i, j) result = rules.test_all_cases(answer.values) if (result == -1): return True answer.flip(int(random.choice(rules.cases[result]))) return False
def __init__(self): self.values = Values(50, None, None, 8192) self.Values = { 'CurrentValue': self.values.CurrentValue, 'DefaultValue': self.values.DefaultValue } self.ExposureAuto = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoBrightness' }
def __init__(self): self.values = Values(10, 0, 256, -8193) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.Saturation = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoSaturation' }
def __init__(self): self.values = Values(250, 1, 500, 16384) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.Gamma = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoGamma' }
def __init__(self): self.values = Values(50, 0, 100, 8192) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.Brightness = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoBrightness' }
def __init__(self): self.values = Values(500, 260, 1023, 32768) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.Gain = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoGain' }
def __init__(self): self.values = Values(200, 0, 359, -8193) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.Hue = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoGain' }
def __init__(self): self.values = Values(8, 0, 95, 32) self.Values = { 'CurrentValue': self.values.CurrentValue, 'MinValue': self.values.MinValue, 'MaxValue': self.values.MaxValue, 'DefaultValue': self.values.DefaultValue } self.WhiteBalanceBlue = { 'Value': self.Values, 'Category': 'ByDefault', 'Group': 'GrupoGain' }
def new(args): def parse_custom_values(s): result = {} values = [v for v in s.split(',') if v] for pair in values: try: key, val = pair.split('=') result[key] = val except ValueError: print( '--values got an invalid format. Wants key=value pairs, separated by ,' ) sys.exit(1) return result name = args['<name>'] dest = args['<dir>'] or '.' values = args['--values'] or '' """Create new template. To be used by cli.py""" try: pre_main() main(name, Values(**parse_custom_values(values)), dest=dest) except KeyboardInterrupt: shutil.rmtree(os.path.join(WORKDIR, name))
def select(self, board): values = Values(board, self.minimax, self.color) pos = choice(values.get_best_pos()) return pos
def test_initialize(self): values = Values() self.assertEqual([], values.values()) values = Values([2.3, 4.2]) self.assertEqual([2.3, 4.2], values.values())
<br> Incall only! <br> Serious & Discreet clients only <br> No blocked calls! <br> <br> <a target="_blank" href="mailto:"></a> <br> *82 <br> <br> XOXO, Tessa""" ad_data2 = """<b></b><i>My name is Dream & I am an exotic Armenian, German<br> woman, standing 5'7, 150lbs, all natural busty 36c-28-38,<br> with light blonde hair & blue eyes.<br> <br> I offer incall or outcall & I am available 24hrs a day so feel free to<br> contact me at anytime!<br> <br> <br> If for some reason I dont answer, please leave a message.<br> No blocked calls will be answered!<br> No text messages either boys!<br> <br> <u><b>Ready for pleasure<br></b></u> <br> CALL ME!!!<br> <br></i> """ v1 = Values(ad_data, path, all_names) v2 = Values(ad_data2, path, all_names) f = Features(v1, v2) print f.extract_feats(False)
def update_records(self): name_to_search = input("Enter name to update: ") new_ip = input("Enter new ip :") v = Values(name_to_search, new_ip) Table.change_target(self, *v.get_value())
def insert_records(self): name = input("Enter name: ") ip = input("Enter ip: ") v = Values(name, ip) print('Input values :', *v.get_value()) Table.insert_in_table(self, *v.get_value())
def test_mean(self): values = Values([1, 10, 1]) self.assertEqual(4, values.mean())
def test_stddev(self): values = Values([1, 10, 1]) self.assertAlmostEqual(4.24, values.stddev(), places=2)
def test_pval_identical(self): identical_list = [1, 10, 1] values = Values(identical_list) self.assertEqual(0, values.pval(identical_list))
from flask import Flask, request, abort from mail import Mail_Handler from values import Values from datetime import datetime import json import sys import threading app = Flask(__name__) SERVER_IP = '192.168.1.15' values = Values() mailClient = Mail_Handler() warningTemp = 40 @app.route('/setTemp', methods=['POST']) def setTemp(): try: if (request.form['temp'] != 'Sensor error' or 'Sensor error' != request.form['humid']): f = open("./../frontend/src/data/tempData.json", "r") data = json.load(f) write = "[\n" + json.dumps( data[0]).split('}')[0] + ', "' + datetime.today().strftime( '%Y-%m-%d:%H%M' ) + '" : ' + request.form['temp'] + "}}" + ",\n" + json.dumps( data[1]).split('}')[0] + ', "' + datetime.today().strftime( '%Y-%m-%d:%H%M' ) + '" : ' + request.form['humid'] + "}}" + "\n]" originalStdout = sys.stdout f = open("./../frontend/src/data/tempData.json", "w")
def test_pval_significant(self): values = Values([1, 1, 1, 1, 1]) self.assertAlmostEqual(0.992, values.pval([10, 10, 10, 10, 10]), places=3)