hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
7362194801cab520c1c6118da8fed2c2fdfa327d
303
py
Python
src/impscan/scanner/__init__.py
lmmx/impscan
fd809f9f32302e3b67bc921164f34fdd837cf92b
[ "MIT" ]
null
null
null
src/impscan/scanner/__init__.py
lmmx/impscan
fd809f9f32302e3b67bc921164f34fdd837cf92b
[ "MIT" ]
15
2021-06-24T15:30:57.000Z
2021-07-30T14:04:38.000Z
src/impscan/scanner/__init__.py
lmmx/impscan
fd809f9f32302e3b67bc921164f34fdd837cf92b
[ "MIT" ]
null
null
null
from . import ( ast_parsing, ast_utils, build_utils, import_utils, module_utils, requirement, sanitiser, scan, ) __all__ = [ "ast_parsing", "ast_utils", "build_utils", "import_utils", "module_utils", "requirement", "sanitiser", "scan", ]
13.772727
19
0.577558
29
303
5.551724
0.37931
0.124224
0.161491
0.223602
0.919255
0.919255
0.919255
0.919255
0.919255
0.919255
0
0
0.29703
303
21
20
14.428571
0.755869
0
0
0
0
0
0.260726
0
0
0
0
0
0
1
0
false
0
0.15
0
0.15
0
1
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
c30208cfcf05bf0d1b0f781241ad34fb2f69ad19
5,469
py
Python
convert.py
ekawahyu/STM32-ldscripts
8a1927a665f4fec6784e78024dbbf93d948805ac
[ "MIT" ]
null
null
null
convert.py
ekawahyu/STM32-ldscripts
8a1927a665f4fec6784e78024dbbf93d948805ac
[ "MIT" ]
null
null
null
convert.py
ekawahyu/STM32-ldscripts
8a1927a665f4fec6784e78024dbbf93d948805ac
[ "MIT" ]
null
null
null
import csv from string import Template #=============================================================================# # STM32L0 linker_template= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB - Data EEPROM ${eeprom}B ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K EEPROM (rw) : ORIGIN = 0x08080000, LENGTH = ${eeprom} }''') with open('STM32L0/STM32L0.csv', 'r') as csvfile: spamreader = csv.reader(csvfile, delimiter=';', quotechar='"') csvfile.readline() # dummy read, ignore header for row in spamreader: device = row[0] flash = row[1] eeprom = row[2] ram = row[3] with open('STM32L0/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_template.safe_substitute(device=device, flash=flash, ram=ram, eeprom=eeprom)) #=============================================================================# # STM32F3 linker_template= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K }''') linker_templateCCRAM= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB - CCRAM ${ccram}kB ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = ${ccram}K }''') with open('STM32F3/STM32F3.csv', 'r') as csvfile: spamreader = csv.reader(csvfile, delimiter=',', quotechar='"') csvfile.readline() # dummy read, ignore header for row in spamreader: device = row[0] flash = row[1] ram = row[2] ccram = row[3] if( row[3] != '' ) else 0 if(ccram == 0): with open('STM32F3/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_template.safe_substitute(device=device, flash=flash, ram=ram)) else: with open('STM32F3/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_templateCCRAM.safe_substitute(device=device, flash=flash, ram=ram,ccram=ccram)) #=============================================================================# # STM32F4 linker_template= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K }''') linker_templateCCRAM= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB - CCRAM ${ccram}kB ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = ${ccram}K }''') with open('STM32F4/STM32F4.csv', 'r') as csvfile: spamreader = csv.reader(csvfile, delimiter=',', quotechar='"') csvfile.readline() # dummy read, ignore header for row in spamreader: device = row[0] flash = row[1] ram = row[2] ccram = row[3] if( row[3] != '' ) else 0 if(ccram == 0): with open('STM32F4/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_template.safe_substitute(device=device, flash=flash, ram=ram)) else: with open('STM32F4/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_templateCCRAM.safe_substitute(device=device, flash=flash, ram=ram,ccram=ccram)) #=============================================================================# # STM32F0 linker_template= Template('''/****************************************************************************** Memory Layout Linker File Device : ${device} - Flash ${flash}kB - RAM ${ram}kB ******************************************************************************/ MEMORY{ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${ram}K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = ${flash}K }''') with open('STM32F0/STM32F0.csv', 'r') as csvfile: spamreader = csv.reader(csvfile, delimiter=';', quotechar='"') csvfile.readline() # dummy read, ignore header for row in spamreader: device = row[0] flash = row[1] ram = row[2] with open('STM32F0/'+device + '.ld', 'w') as csvfile: csvfile.write(linker_template.safe_substitute(device=device, flash=flash, ram=ram))
35.057692
116
0.455659
505
5,469
4.89901
0.120792
0.058205
0.082458
0.10671
0.90097
0.90097
0.90097
0.90097
0.90097
0.90097
0
0.047792
0.196562
5,469
155
117
35.283871
0.515248
0.081185
0
0.886957
0
0
0.53883
0.189259
0
0
0.029946
0
0
1
0
false
0
0.017391
0
0.017391
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c331b4d5cdb43ee8faf5f50a8475d262367c38c6
33,965
py
Python
ironic/tests/unit/drivers/modules/irmc/test_raid.py
yanndegat/ironic
8857ec76443dea7778bb9c0d66568304e52495e5
[ "Apache-2.0" ]
350
2015-01-02T09:35:49.000Z
2022-03-28T09:25:59.000Z
ironic/tests/unit/drivers/modules/irmc/test_raid.py
yanndegat/ironic
8857ec76443dea7778bb9c0d66568304e52495e5
[ "Apache-2.0" ]
7
2015-05-04T16:12:41.000Z
2021-08-31T12:27:27.000Z
ironic/tests/unit/drivers/modules/irmc/test_raid.py
yanndegat/ironic
8857ec76443dea7778bb9c0d66568304e52495e5
[ "Apache-2.0" ]
333
2015-01-06T09:09:22.000Z
2022-02-20T08:11:40.000Z
# Copyright 2018 FUJITSU LIMITED # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Test class for IRMC RAID configuration """ from unittest import mock from ironic.common import exception from ironic.conductor import task_manager from ironic.drivers.modules import deploy_utils from ironic.drivers.modules.irmc import raid from ironic.tests.unit.drivers.modules.irmc import test_common class IRMCRaidConfigurationInternalMethodsTestCase(test_common.BaseIRMCTest): def setUp(self): super(IRMCRaidConfigurationInternalMethodsTestCase, self).setUp() self.raid_adapter_profile = { "Server": { "HWConfigurationIrmc": { "Adapters": { "RAIDAdapter": [ { "@AdapterId": "RAIDAdapter0", "@ConfigurationType": "Addressing", "Arrays": None, "LogicalDrives": None, "PhysicalDisks": { "PhysicalDisk": [ { "@Number": "0", "@Action": "None", "Slot": 0, }, { "@Number": "1", "@Action": "None", "Slot": 1 }, { "@Number": "2", "@Action": "None", "Slot": 2 }, { "@Number": "3", "@Action": "None", "Slot": 3 } ] } } ] } } } } self.valid_disk_slots = { "PhysicalDisk": [ { "@Number": "0", "Slot": 0, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "1", "Slot": 1, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "2", "Slot": 2, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "3", "Slot": 3, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "4", "Slot": 4, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "5", "Slot": 5, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "6", "Slot": 6, "Size": { "@Unit": "GB", "#text": 1000 } }, { "@Number": "7", "Slot": 7, "Size": { "@Unit": "GB", "#text": 1000 } } ] } @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test___fail_validation_with_none_raid_adapter_profile( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = None target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "0" } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test___fail_validation_without_raid_level( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50" } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test___fail_validation_with_raid_level_is_none(self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "" } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_without_physical_disks( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = { "Server": { "HWConfigurationIrmc": { "Adapters": { "RAIDAdapter": [ { "@AdapterId": "RAIDAdapter0", "@ConfigurationType": "Addressing", "Arrays": None, "LogicalDrives": None, "PhysicalDisks": None } ] } } } } target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "1" } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test___fail_validation_with_raid_level_outside_list( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "2" } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch( 'ironic.drivers.modules.irmc.raid._validate_logical_drive_capacity', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_not_enough_valid_disks( self, get_raid_adapter_mock, get_physical_disk_mock, capacity_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "5" }, { "size_gb": "50", "raid_level": "1" }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_physical_disk_insufficient( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "1", "physical_disks": [ "0", "1", "2" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.InvalidParameterValue, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_physical_disk_not_enough_disks( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "5", "physical_disks": [ "0", "1" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_physical_disk_incorrect_valid_disks( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "10", "physical_disks": [ "0", "1", "2", "3", "4" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_physical_disk_outside_valid_disks_1( self, get_raid_adapter_mock, get_physical_disk_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "1", "physical_disks": [ "4", "5" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch( 'ironic.drivers.modules.irmc.raid._validate_logical_drive_capacity', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_physical_disk_outside_valid_slots_2( self, get_raid_adapter_mock, get_physical_disk_mock, capacity_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "5", "physical_disks": [ "0", "1", "2" ] }, { "size_gb": "50", "raid_level": "0", "physical_disks": [ "4" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch( 'ironic.drivers.modules.irmc.raid._validate_logical_drive_capacity', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_physical_disk', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_duplicated_physical_disks( self, get_raid_adapter_mock, get_physical_disk_mock, capacity_mock): get_raid_adapter_mock.return_value = self.raid_adapter_profile target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "1", "physical_disks": [ "0", "1" ] }, { "size_gb": "50", "raid_level": "1", "physical_disks": [ "1", "2" ] }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) @mock.patch('ironic.drivers.modules.irmc.raid._get_raid_adapter', autospec=True) def test__fail_validation_with_difference_physical_disks_type( self, get_raid_adapter_mock): get_raid_adapter_mock.return_value = { "Server": { "HWConfigurationIrmc": { "Adapters": { "RAIDAdapter": [ { "@AdapterId": "RAIDAdapter0", "@ConfigurationType": "Addressing", "Arrays": None, "LogicalDrives": None, "PhysicalDisks": { "PhysicalDisk": [ { "@Number": "0", "Slot": 0, "Type": "HDD", }, { "@Number": "1", "Slot": 1, "Type": "SSD", } ] } } ] } } } } target_raid_config = { "logical_disks": [ { "size_gb": "50", "raid_level": "1", "physical_disks": [ "0", "1" ] } ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: self.assertRaises(exception.IRMCOperationError, raid._validate_physical_disks, task.node, target_raid_config['logical_disks']) def test__fail_validate_capacity_raid_0(self): disk = { "size_gb": 3000, "raid_level": "0" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_raid_1(self): disk = { "size_gb": 3000, "raid_level": "1" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_raid_5(self): disk = { "size_gb": 3000, "raid_level": "5" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_raid_6(self): disk = { "size_gb": 3000, "raid_level": "6" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_raid_10(self): disk = { "size_gb": 3000, "raid_level": "10" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_raid_50(self): disk = { "size_gb": 5000, "raid_level": "50" } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) def test__fail_validate_capacity_with_physical_disk(self): disk = { "size_gb": 4000, "raid_level": "5", "physical_disks": [ "0", "1", "3", "4" ] } self.assertRaises(exception.InvalidParameterValue, raid._validate_logical_drive_capacity, disk, self.valid_disk_slots) @mock.patch('ironic.common.raid.update_raid_info', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid.client.elcm.' 'get_raid_adapter', autospec=True) @mock.patch.object(deploy_utils, 'set_async_step_flags', autospec=True) def test__commit_raid_config_with_logical_drives( self, set_async_step_flags_mock, get_raid_adapter_mock, update_raid_info_mock): get_raid_adapter_mock.return_value = { "Server": { "HWConfigurationIrmc": { "Adapters": { "RAIDAdapter": [ { "@AdapterId": "RAIDAdapter0", "@ConfigurationType": "Addressing", "Arrays": { "Array": [ { "@Number": 0, "@ConfigurationType": "Addressing", "PhysicalDiskRefs": { "PhysicalDiskRef": [ { "@Number": "0" }, { "@Number": "1" } ] } } ] }, "LogicalDrives": { "LogicalDrive": [ { "@Number": 0, "@Action": "None", "RaidLevel": "1", "Name": "LogicalDrive_0", "Size": { "@Unit": "GB", "#text": 465 }, "ArrayRefs": { "ArrayRef": [ { "@Number": 0 } ] } } ] }, "PhysicalDisks": { "PhysicalDisk": [ { "@Number": "0", "@Action": "None", "Slot": 0, "PDStatus": "Operational" }, { "@Number": "1", "@Action": "None", "Slot": 1, "PDStatus": "Operational" } ] } } ] } } } } expected_raid_config = [ {'controller': 'RAIDAdapter0'}, {'irmc_raid_info': {' size': {'#text': 465, '@Unit': 'GB'}, 'logical_drive_number': 0, 'name': 'LogicalDrive_0', 'raid_level': '1'}}, {'physical_drives': {'physical_drive': {'@Action': 'None', '@Number': '0', 'PDStatus': 'Operational', 'Slot': 0}}}, {'physical_drives': {'physical_drive': {'@Action': 'None', '@Number': '1', 'PDStatus': 'Operational', 'Slot': 1}}}] with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: raid._commit_raid_config(task) get_raid_adapter_mock.assert_called_once_with( task.node.driver_info) update_raid_info_mock.assert_called_once_with( task.node, task.node.raid_config) set_async_step_flags_mock.assert_called_once_with( task.node, reboot=True, skip_current_step=True, polling=True) self.assertEqual(task.node.raid_config['logical_disks'], expected_raid_config) class IRMCRaidConfigurationTestCase(test_common.BaseIRMCTest): def setUp(self): super(IRMCRaidConfigurationTestCase, self).setUp() self.config(enabled_raid_interfaces=['irmc']) self.raid_adapter_profile = { "Server": { "HWConfigurationIrmc": { "Adapters": { "RAIDAdapter": [ { "@AdapterId": "RAIDAdapter0", "@ConfigurationType": "Addressing", "Arrays": None, "LogicalDrives": None, "PhysicalDisks": { "PhysicalDisk": [ { "@Number": "0", "@Action": "None", "Slot": 0, }, { "@Number": "1", "@Action": "None", "Slot": 1 }, { "@Number": "2", "@Action": "None", "Slot": 2 }, { "@Number": "3", "@Action": "None", "Slot": 3 } ] } } ] } } } } def test_fail_create_raid_without_target_raid_config(self): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.node.target_raid_config = {} raid_configuration = raid.IRMCRAID() self.assertRaises(exception.MissingParameterValue, raid_configuration.create_configuration, task) @mock.patch('ironic.drivers.modules.irmc.raid._validate_physical_disks', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._create_raid_adapter', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._commit_raid_config', autospec=True) def test_create_raid_with_raid_1_and_0(self, commit_mock, create_raid_mock, validation_mock): expected_input = { "logical_disks": [ { "raid_level": "10" }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.node.target_raid_config = { "logical_disks": [ { "raid_level": "1+0" }, ] } task.driver.raid.create_configuration(task) create_raid_mock.assert_called_once_with(task.node) validation_mock.assert_called_once_with( task.node, expected_input['logical_disks']) commit_mock.assert_called_once_with(task) @mock.patch('ironic.drivers.modules.irmc.raid._validate_physical_disks', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._create_raid_adapter', autospec=True) @mock.patch('ironic.drivers.modules.irmc.raid._commit_raid_config', autospec=True) def test_create_raid_with_raid_5_and_0(self, commit_mock, create_raid_mock, validation_mock): expected_input = { "logical_disks": [ { "raid_level": "50" }, ] } with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.node.target_raid_config = { "logical_disks": [ { "raid_level": "5+0" }, ] } task.driver.raid.create_configuration(task) create_raid_mock.assert_called_once_with(task.node) validation_mock.assert_called_once_with( task.node, expected_input['logical_disks']) commit_mock.assert_called_once_with(task) @mock.patch('ironic.drivers.modules.irmc.raid._delete_raid_adapter', autospec=True) def test_delete_raid_configuration(self, delete_raid_mock): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: task.driver.raid.delete_configuration(task) delete_raid_mock.assert_called_once_with(task.node) @mock.patch('ironic.drivers.modules.irmc.raid._delete_raid_adapter', autospec=True) def test_delete_raid_configuration_return_cleared_raid_config( self, delete_raid_mock): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: expected_raid_config = {} task.driver.raid.delete_configuration(task) self.assertEqual(expected_raid_config, task.node.raid_config) delete_raid_mock.assert_called_once_with(task.node)
39.865023
79
0.410687
2,464
33,965
5.319805
0.082386
0.050351
0.045926
0.069576
0.83224
0.821712
0.792646
0.760604
0.754654
0.744507
0
0.014125
0.503901
33,965
851
80
39.911868
0.763798
0.017459
0
0.589909
0
0
0.14206
0.058977
0
0
0
0
0.043984
1
0.036223
false
0
0.007762
0
0.046572
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c3695237b8906db8295368b161843a3929062560
1,660
py
Python
src/Skeleton/BassActions.py
Voice-First-AI/generative-music-watson
e666f64602baab2e35a66c0a5c4389b1bd5666c9
[ "Apache-2.0" ]
null
null
null
src/Skeleton/BassActions.py
Voice-First-AI/generative-music-watson
e666f64602baab2e35a66c0a5c4389b1bd5666c9
[ "Apache-2.0" ]
null
null
null
src/Skeleton/BassActions.py
Voice-First-AI/generative-music-watson
e666f64602baab2e35a66c0a5c4389b1bd5666c9
[ "Apache-2.0" ]
null
null
null
from __future__ import print_function Actions = { 'bass2': { 'super_simple' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', }, 'simple' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', }, 'semi_complex' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', #3:'CHROMATICS', # Left for developer to be filled in }, 'complex' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', #3:'CHROMATICS', # Left for developer to be filled in }, }, 'bass3': { 'super_simple' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', }, 'simple' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', }, 'semi_complex' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', #3:'CHROMATICS', # Left for developer to be filled in }, 'complex' : { 0:'PLAY_HOME_NOTE', 1:'PLAY_FIFTH_NOTE', 2:'PLAY_OCTAVE_UP', #3:'CHROMATICS', # Left for developer to be filled in }, }, } # End Actions
24.411765
67
0.396988
154
1,660
3.909091
0.201299
0.066445
0.119601
0.172757
0.906977
0.906977
0.906977
0.906977
0.906977
0.906977
0
0.035587
0.492169
1,660
67
68
24.776119
0.678529
0.13253
0
0.680851
0
0
0.314475
0
0
0
0
0
0
1
0
false
0
0.021277
0
0.021277
0.021277
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
5eedee5cf014e446e0ea7a516b1b3b07db8904a2
42
py
Python
mphyspy/test.py
eunchan1001/phypy
17ae1e2bddf784c82f4a2c57721d1176b274072b
[ "MIT" ]
1
2020-04-17T07:54:49.000Z
2020-04-17T07:54:49.000Z
mphyspy/test.py
eunchan1001/phypy
17ae1e2bddf784c82f4a2c57721d1176b274072b
[ "MIT" ]
null
null
null
mphyspy/test.py
eunchan1001/phypy
17ae1e2bddf784c82f4a2c57721d1176b274072b
[ "MIT" ]
null
null
null
#Module Test def check(): return True
10.5
15
0.666667
6
42
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.238095
42
3
16
14
0.875
0.261905
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0
0.5
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
1
1
0
0
7
6f2710310cc6dbeeef3c2068c2385b785b1bcce7
101
py
Python
task_dialog/agents/__init__.py
nanhaishun/smart-chatbot
b98e30d8f1b37631130aaaf8bc3978afb3e67b2a
[ "Apache-2.0" ]
1
2018-12-11T06:10:39.000Z
2018-12-11T06:10:39.000Z
task_dialog/agents/__init__.py
nanhaishun/smart-chatbot
b98e30d8f1b37631130aaaf8bc3978afb3e67b2a
[ "Apache-2.0" ]
null
null
null
task_dialog/agents/__init__.py
nanhaishun/smart-chatbot
b98e30d8f1b37631130aaaf8bc3978afb3e67b2a
[ "Apache-2.0" ]
null
null
null
from .agent_cmd import * from .agent_baselines import * from .agent_dqn import * from .agent import *
25.25
30
0.772277
15
101
5
0.4
0.48
0.6
0
0
0
0
0
0
0
0
0
0.148515
101
4
31
25.25
0.872093
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
6f46c0771f8ff97faa397159b3dd846ea7814b06
14,987
py
Python
openstack/tests/auth/identity/test_v3.py
sivel/python-openstacksdk
85c6a42c8f983b467c79e5dacdfdc996657250b1
[ "Apache-2.0" ]
1
2015-02-16T09:34:58.000Z
2015-02-16T09:34:58.000Z
openstack/tests/auth/identity/test_v3.py
sivel/python-openstacksdk
85c6a42c8f983b467c79e5dacdfdc996657250b1
[ "Apache-2.0" ]
null
null
null
openstack/tests/auth/identity/test_v3.py
sivel/python-openstacksdk
85c6a42c8f983b467c79e5dacdfdc996657250b1
[ "Apache-2.0" ]
null
null
null
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock import testtools from openstack.auth.identity import v3 from openstack import exceptions from openstack.tests.auth import common TEST_URL = 'http://127.0.0.1:5000/v3.0' class TestV3Auth(testtools.TestCase): def test_password_user_domain(self): kargs = {'trust_id': common.TEST_TRUST_ID, 'project_id': common.TEST_PROJECT_ID, 'project_name': common.TEST_PROJECT_NAME} method = v3.PasswordMethod(username=common.TEST_USER, user_id=common.TEST_USER_ID, user_domain_id=common.TEST_DOMAIN_ID, user_domain_name=common.TEST_DOMAIN_NAME, password=common.TEST_PASS) sot = v3.Auth(TEST_URL, [method], **kargs) self.assertEqual(1, len(sot.auth_methods)) auther = sot.auth_methods[0] self.assertEqual(common.TEST_USER_ID, auther.user_id) self.assertEqual(common.TEST_USER, auther.username) self.assertEqual(common.TEST_DOMAIN_ID, auther.user_domain_id) self.assertEqual(common.TEST_DOMAIN_NAME, auther.user_domain_name) self.assertEqual(common.TEST_PASS, auther.password) expected = ('password', {'user': {'id': common.TEST_USER_ID, 'password': common.TEST_PASS}}) self.assertEqual(expected, auther.get_auth_data(None, None, {})) self.assertEqual(common.TEST_TRUST_ID, sot.trust_id) self.assertEqual(None, sot.domain_id) self.assertEqual(None, sot.domain_name) self.assertEqual(common.TEST_PROJECT_ID, sot.project_id) self.assertEqual(common.TEST_PROJECT_NAME, sot.project_name) self.assertEqual(None, sot.project_domain_id) self.assertEqual(None, sot.project_domain_name) self.assertEqual(TEST_URL + '/auth/tokens', sot.token_url) def test_password_domain(self): kargs = {'domain_id': common.TEST_DOMAIN_ID, 'domain_name': common.TEST_DOMAIN_NAME, 'trust_id': common.TEST_TRUST_ID, 'project_id': common.TEST_PROJECT_ID, 'project_name': common.TEST_PROJECT_NAME} methods = [v3.PasswordMethod(username=common.TEST_USER, user_id=common.TEST_USER_ID, password=common.TEST_PASS)] sot = v3.Auth(TEST_URL, methods, **kargs) self.assertEqual(1, len(sot.auth_methods)) auther = sot.auth_methods[0] self.assertEqual(common.TEST_USER_ID, auther.user_id) self.assertEqual(common.TEST_USER, auther.username) self.assertEqual(None, auther.user_domain_id) self.assertEqual(None, auther.user_domain_name) self.assertEqual(common.TEST_PASS, auther.password) expected = ('password', {'user': {'id': common.TEST_USER_ID, 'password': common.TEST_PASS}}) self.assertEqual(expected, auther.get_auth_data(None, None, {})) self.assertEqual(common.TEST_TRUST_ID, sot.trust_id) self.assertEqual(common.TEST_DOMAIN_ID, sot.domain_id) self.assertEqual(common.TEST_DOMAIN_NAME, sot.domain_name) self.assertEqual(common.TEST_PROJECT_ID, sot.project_id) self.assertEqual(common.TEST_PROJECT_NAME, sot.project_name) self.assertEqual(None, sot.project_domain_id) self.assertEqual(None, sot.project_domain_name) self.assertEqual(TEST_URL + '/auth/tokens', sot.token_url) def test_token_project_domain(self): kargs = {'project_domain_id': common.TEST_DOMAIN_ID, 'project_domain_name': common.TEST_DOMAIN_NAME, 'trust_id': common.TEST_TRUST_ID, 'project_id': common.TEST_PROJECT_ID, 'project_name': common.TEST_PROJECT_NAME} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) self.assertEqual(1, len(sot.auth_methods)) auther = sot.auth_methods[0] self.assertEqual(common.TEST_TOKEN, auther.token) expected = ('token', {'id': common.TEST_TOKEN}) self.assertEqual(expected, auther.get_auth_data(None, None, {})) self.assertEqual(common.TEST_TRUST_ID, sot.trust_id) self.assertEqual(None, sot.domain_id) self.assertEqual(None, sot.domain_name) self.assertEqual(common.TEST_PROJECT_ID, sot.project_id) self.assertEqual(common.TEST_PROJECT_NAME, sot.project_name) self.assertEqual(common.TEST_DOMAIN_ID, sot.project_domain_id) self.assertEqual(common.TEST_DOMAIN_NAME, sot.project_domain_name) self.assertEqual(TEST_URL + '/auth/tokens', sot.token_url) def create_mock_transport(self, xresp): transport = mock.Mock() transport.post = mock.Mock() response = mock.Mock() response.json = mock.Mock() response.json.return_value = xresp response.headers = {'X-Subject-Token': common.TEST_SUBJECT} transport.post.return_value = response return transport def test_authorize_token(self): methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'methods': ['token']}}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_domain_id(self): kargs = {'domain_id': common.TEST_DOMAIN_ID} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'methods': ['token']}, 'scope': {'domain': {'id': common.TEST_DOMAIN_ID}}}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_domain_name(self): kargs = {'domain_name': common.TEST_DOMAIN_NAME} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} scope = {'domain': {'name': common.TEST_DOMAIN_NAME}} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'methods': ['token']}, 'scope': scope}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_project_id(self): kargs = {'project_id': common.TEST_PROJECT_ID} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} scope = {'project': {'id': common.TEST_PROJECT_ID}} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'methods': ['token']}, 'scope': scope}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_project_name(self): kargs = {'project_name': common.TEST_PROJECT_NAME, 'project_domain_id': common.TEST_DOMAIN_ID} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} domain = {'domain': {'id': common.TEST_DOMAIN_ID}, 'name': common.TEST_PROJECT_NAME} scope = {'project': domain} ejson = {'auth': {'identity': {'methods': ['token'], 'token': {'id': common.TEST_TOKEN}}, 'scope': scope}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_project_name_domain_name(self): kargs = {'project_name': common.TEST_PROJECT_NAME, 'project_domain_name': common.TEST_DOMAIN_NAME} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} domain = {'domain': {'name': common.TEST_DOMAIN_NAME}, 'name': common.TEST_PROJECT_NAME} scope = {'project': domain} ejson = {'auth': {'identity': {'methods': ['token'], 'token': {'id': common.TEST_TOKEN}}, 'scope': scope}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_token_trust_id(self): kargs = {'trust_id': common.TEST_TRUST_ID} methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods, **kargs) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} scope = {'OS-TRUST:trust': {'id': common.TEST_TRUST_ID}} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'methods': ['token']}, 'scope': scope}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_multi_method(self): methods = [v3.PasswordMethod(username=common.TEST_USER, password=common.TEST_PASS), v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods) xport = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) resp = sot.authorize(xport) eurl = TEST_URL + '/auth/tokens' eheaders = {'Accept': 'application/json', 'X-Auth-Token': common.TEST_TOKEN} up = {'password': common.TEST_PASS, 'name': common.TEST_USER} ejson = {'auth': {'identity': {'token': {'id': common.TEST_TOKEN}, 'password': {'user': up}, 'methods': ['password', 'token']}}} xport.post.assert_called_with(eurl, headers=eheaders, json=ejson) ecatalog = common.TEST_RESPONSE_DICT_V3['token'].copy() ecatalog['auth_token'] = common.TEST_SUBJECT ecatalog['version'] = 'v3' self.assertEqual(ecatalog, resp._info) def test_authorize_mutually_exclusive(self): x = self.create_mock_transport(common.TEST_RESPONSE_DICT_V3) methods = [v3.TokenMethod(token=common.TEST_TOKEN)] kargs = {'domain_id': 'a', 'project_id': 'b'} sot = v3.Auth(TEST_URL, methods, **kargs) self.assertRaises(exceptions.AuthorizationFailure, sot.authorize, x) kargs = {'domain_name': 'a', 'project_name': 'b'} sot = v3.Auth(TEST_URL, methods, **kargs) self.assertRaises(exceptions.AuthorizationFailure, sot.authorize, x) kargs = {'domain_name': 'a', 'trust_id': 'b'} sot = v3.Auth(TEST_URL, methods, **kargs) self.assertRaises(exceptions.AuthorizationFailure, sot.authorize, x) kargs = {'project_id': 'a', 'trust_id': 'b'} sot = v3.Auth(TEST_URL, methods, **kargs) self.assertRaises(exceptions.AuthorizationFailure, sot.authorize, x) def test_authorize_bad_response(self): methods = [v3.TokenMethod(token=common.TEST_TOKEN)] sot = v3.Auth(TEST_URL, methods) xport = self.create_mock_transport({}) self.assertRaises(exceptions.InvalidResponse, sot.authorize, xport)
46.688474
78
0.622673
1,734
14,987
5.135525
0.080161
0.137002
0.040427
0.061763
0.859854
0.857383
0.823021
0.804267
0.785626
0.766423
0
0.007064
0.253753
14,987
320
79
46.834375
0.789163
0.03483
0
0.715909
0
0
0.097696
0
0
0
0
0
0.234848
1
0.05303
false
0.064394
0.018939
0
0.079545
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
8
6f6cb8318eaf02bb8a5ce2ce96682bb02dac454f
1,766
py
Python
test_analytics.py
johntelforduk/shopify-analytics
19ea62ff3b4e89a4e0b0a6a37db05a61a8a2aa23
[ "MIT" ]
null
null
null
test_analytics.py
johntelforduk/shopify-analytics
19ea62ff3b4e89a4e0b0a6a37db05a61a8a2aa23
[ "MIT" ]
null
null
null
test_analytics.py
johntelforduk/shopify-analytics
19ea62ff3b4e89a4e0b0a6a37db05a61a8a2aa23
[ "MIT" ]
null
null
null
# Script to test the Analytics class. from analytics import Analytics import unittest from datetime import datetime class TestAnalytics(unittest.TestCase): def test_0_day_window(self): """Test the class when refund window is zero days.""" test_date = datetime.strptime('2020-05-30', "%Y-%m-%d") analysis = Analytics(filename='transactions_sample.csv', datetime_now=test_date, refund_window=0) for index, row in analysis.monthly.iterrows(): if row['Year Month'] == '2020-04': self.assertEqual(row['Sales'], 50 + 50) self.assertEqual(row['Refunds'], 50) self.assertEqual(row['Refund Rate'], 50 / (50 + 50)) elif row['Year Month'] == '2020-05': self.assertEqual(row['Sales'], 100 + 200) self.assertEqual(row['Refunds'], 100 + 50) self.assertEqual(row['Refund Rate'], (100 + 50) / (100 + 200)) def test_14_day_window(self): """Test the class when refund window is 14 days.""" test_date = datetime.strptime('2020-05-30', "%Y-%m-%d") analysis = Analytics(filename='transactions_sample.csv', datetime_now=test_date, refund_window=14) for index, row in analysis.monthly.iterrows(): if row['Year Month'] == '2020-04': self.assertEqual(row['Sales'], 50 + 50) self.assertEqual(row['Refunds'], 50) self.assertEqual(row['Refund Rate'], 50 / (50 + 50)) elif row['Year Month'] == '2020-05': self.assertEqual(row['Sales'], 200) self.assertEqual(row['Refunds'], 50) self.assertEqual(row['Refund Rate'], 50 / 200) if __name__ == '__main__': unittest.main()
39.244444
106
0.587203
215
1,766
4.711628
0.265116
0.17769
0.213228
0.11846
0.803554
0.772952
0.743337
0.743337
0.743337
0.743337
0
0.080433
0.267837
1,766
44
107
40.136364
0.703016
0.073613
0
0.5
0
0
0.153846
0.028308
0
0
0
0
0.4
1
0.066667
false
0
0.1
0
0.2
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
48bb6a84220293b1d33831e1a2039e2000d131d3
6,124
py
Python
weibo/spiders/test.py
Leu552/cxkspider
94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230
[ "MIT" ]
null
null
null
weibo/spiders/test.py
Leu552/cxkspider
94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230
[ "MIT" ]
null
null
null
weibo/spiders/test.py
Leu552/cxkspider
94fcc9bf5b82ca3d5772d2275ff8bda0be3e9230
[ "MIT" ]
null
null
null
import urllib3 import requests import json import random import time from fake_useragent import UserAgent ua = UserAgent() def get_data(): user_agent_list = [ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1" "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.0 Safari/536.3", ] UserAgent = random.choice(user_agent_list) headers = { 'Host': 'weibo.com', 'User-Agent': ua.random, 'X-Requested-With': 'XMLHttpRequest', 'Cookie': 'SINAGLOBAL=1505092439785.638.1548912484608; TC-Page-G0=841d8e04c4761f733a87c822f72195f3; _s_tentry=passport.weibo.com; Apache=9246181159618.564.1550212893574; ULV=1550212893586:2:1:1:9246181159618.564.1550212893574:1548912484630; Ugrow-G0=8751d9166f7676afdce9885c6d31cd61; login_sid_t=5e86081f15aa42603185fffc3db712f7; cross_origin_proto=SSL; TC-V5-G0=05e7a45f4d2b9f5b065c2bea790496e2; YF-V5-G0=82f55bdb504a04aef59e3e99f6aad4ca; UM_distinctid=16a1f4014e30-034888a184b62e-58422116-1fa400-16a1f4014e673; un=2978610085@qq.com; UOR=,,login.sina.com.cn; WBtopGlobal_register_version=edef3632d17f5fb3; SSOLoginState=1555324904; YF-Ugrow-SEO-G0=8e667ee9394bfc84054b8fa626d4b0dc; wb_view_log_5681855938=1920*10801; wb_view_log=1920*10801; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhnaHFwnfa9b6Bn0eVW_jaD5JpX5K2hUgL.Fo-c1h2RSK-4e0n2dJLoI7UhdNiVwHvk; ALF=1586947400; SCF=ApA3TwJO8OkekAZzIkq-v9EJJ7s2OBvMB3YOUA8HJDkRLpQMp7ZAeE6MawHuVMB4HGeoAmRtJq1e3l5otJBkOh0.; SUB=_2A25xscGcDeThGeNI41MZ9SvFyDSIHXVSxrRUrDV8PUNbmtBeLRPTkW9NSD4SFVOkcS02xhwpzupcOpYGDcWIafuA; SUHB=05iqxFrjc87bAc; wvr=6; YF-Page-G0=ee5462a7ca7a278058fd1807a910bc74|1555412761|1555412757; webim_unReadCount=%7B%22time%22%3A1555412766585%2C%22dm_pub_total%22%3A1%2C%22chat_group_pc%22%3A0%2C%22allcountNum%22%3A6%2C%22msgbox%22%3A0%7D' } for i in range(1,3): headers = { 'Host': 'weibo.com', 'User-Agent': ua.random, 'X-Requested-With': 'XMLHttpRequest', 'Cookie': 'SINAGLOBAL=1505092439785.638.1548912484608; TC-Page-G0=841d8e04c4761f733a87c822f72195f3; _s_tentry=passport.weibo.com; Apache=9246181159618.564.1550212893574; ULV=1550212893586:2:1:1:9246181159618.564.1550212893574:1548912484630; Ugrow-G0=8751d9166f7676afdce9885c6d31cd61; login_sid_t=5e86081f15aa42603185fffc3db712f7; cross_origin_proto=SSL; TC-V5-G0=05e7a45f4d2b9f5b065c2bea790496e2; YF-V5-G0=82f55bdb504a04aef59e3e99f6aad4ca; UM_distinctid=16a1f4014e30-034888a184b62e-58422116-1fa400-16a1f4014e673; un=2978610085@qq.com; UOR=,,login.sina.com.cn; WBtopGlobal_register_version=edef3632d17f5fb3; SSOLoginState=1555324904; YF-Ugrow-SEO-G0=8e667ee9394bfc84054b8fa626d4b0dc; wb_view_log_5681855938=1920*10801; wb_view_log=1920*10801; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhnaHFwnfa9b6Bn0eVW_jaD5JpX5K2hUgL.Fo-c1h2RSK-4e0n2dJLoI7UhdNiVwHvk; ALF=1586947400; SCF=ApA3TwJO8OkekAZzIkq-v9EJJ7s2OBvMB3YOUA8HJDkRLpQMp7ZAeE6MawHuVMB4HGeoAmRtJq1e3l5otJBkOh0.; SUB=_2A25xscGcDeThGeNI41MZ9SvFyDSIHXVSxrRUrDV8PUNbmtBeLRPTkW9NSD4SFVOkcS02xhwpzupcOpYGDcWIafuA; SUHB=05iqxFrjc87bAc; wvr=6; YF-Page-G0=ee5462a7ca7a278058fd1807a910bc74|1555412761|1555412757; webim_unReadCount=%7B%22time%22%3A1555412766585%2C%22dm_pub_total%22%3A1%2C%22chat_group_pc%22%3A0%2C%22allcountNum%22%3A6%2C%22msgbox%22%3A0%7D' } url = 'https://weibo.com/aj/v6/mblog/info/big?ajwvr=6&id=4361379747512186&max_id=4361779607852473&page='+str(i)+'&__rnd='+str(int(time.time())) print(url) print(headers['User-Agent']) res = requests.get(url=url, headers=headers) print(res.json()) print(res.status_code) # print(res.json()['data']['html']) # -*- coding: utf-8 -*- class transCookie: def __init__(self, cookie): self.cookie = cookie def stringToDict(self): itemDict = {} items = self.cookie.split(';') for item in items: key = item.split('=')[0].replace(' ', '') value = item.split('=')[1] itemDict[key] = value return itemDict if __name__ == "__main__": cookie = "SINAGLOBAL=1505092439785.638.1548912484608; TC-Page-G0=841d8e04c4761f733a87c822f72195f3; _s_tentry=passport.weibo.com; Apache=9246181159618.564.1550212893574; ULV=1550212893586:2:1:1:9246181159618.564.1550212893574:1548912484630; Ugrow-G0=8751d9166f7676afdce9885c6d31cd61; login_sid_t=5e86081f15aa42603185fffc3db712f7; cross_origin_proto=SSL; TC-V5-G0=05e7a45f4d2b9f5b065c2bea790496e2; YF-V5-G0=82f55bdb504a04aef59e3e99f6aad4ca; UM_distinctid=16a1f4014e30-034888a184b62e-58422116-1fa400-16a1f4014e673; un=2978610085@qq.com; UOR=,,login.sina.com.cn; WBtopGlobal_register_version=edef3632d17f5fb3; SSOLoginState=1555324904; YF-Ugrow-SEO-G0=8e667ee9394bfc84054b8fa626d4b0dc; wb_view_log_5681855938=1920*10801; wb_view_log=1920*10801; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WhnaHFwnfa9b6Bn0eVW_jaD5JpX5K2hUgL.Fo-c1h2RSK-4e0n2dJLoI7UhdNiVwHvk; ALF=1586947400; SCF=ApA3TwJO8OkekAZzIkq-v9EJJ7s2OBvMB3YOUA8HJDkRLpQMp7ZAeE6MawHuVMB4HGeoAmRtJq1e3l5otJBkOh0.; SUB=_2A25xscGcDeThGeNI41MZ9SvFyDSIHXVSxrRUrDV8PUNbmtBeLRPTkW9NSD4SFVOkcS02xhwpzupcOpYGDcWIafuA; SUHB=05iqxFrjc87bAc; wvr=6; YF-Page-G0=ee5462a7ca7a278058fd1807a910bc74|1555412761|1555412757; webim_unReadCount=%7B%22time%22%3A1555412766585%2C%22dm_pub_total%22%3A1%2C%22chat_group_pc%22%3A0%2C%22allcountNum%22%3A6%2C%22msgbox%22%3A0%7D" trans = transCookie(cookie) print(trans.stringToDict())
91.402985
1,308
0.774494
707
6,124
6.588402
0.267327
0.010305
0.013525
0.024045
0.854229
0.854229
0.854229
0.854229
0.854229
0.846501
0
0.308581
0.109406
6,124
66
1,309
92.787879
0.545471
0.008981
0
0.192308
0
0.211538
0.799967
0.608601
0
0
0
0
0
1
0.057692
false
0.057692
0.115385
0
0.211538
0.096154
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
1
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
12
48c43989c80c2eb19bcd24ba98188894fc7b8c44
11,995
py
Python
tests/test_iot/test_iot_jobs.py
gtourkas/moto
307104417b579d23d02f670ff55217a2d4a16bee
[ "Apache-2.0" ]
5,460
2015-01-01T01:11:17.000Z
2022-03-31T23:45:38.000Z
tests/test_iot/test_iot_jobs.py
gtourkas/moto
307104417b579d23d02f670ff55217a2d4a16bee
[ "Apache-2.0" ]
4,475
2015-01-05T19:37:30.000Z
2022-03-31T13:55:12.000Z
tests/test_iot/test_iot_jobs.py
gtourkas/moto
307104417b579d23d02f670ff55217a2d4a16bee
[ "Apache-2.0" ]
1,831
2015-01-14T00:00:44.000Z
2022-03-31T20:30:04.000Z
import boto3 import json from moto import mock_iot @mock_iot def test_create_job(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing# job document # job_document = { # "field": "value" # } thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") # job document job_document = {"field": "value"} job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], document=json.dumps(job_document), description="Description", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job.should.have.key("description") @mock_iot def test_list_jobs(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing# job document # job_document = { # "field": "value" # } thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") # job document job_document = {"field": "value"} job1 = client.create_job( jobId=job_id, targets=[thing["thingArn"]], document=json.dumps(job_document), description="Description", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job1.should.have.key("jobId").which.should.equal(job_id) job1.should.have.key("jobArn") job1.should.have.key("description") job2 = client.create_job( jobId=job_id + "1", targets=[thing["thingArn"]], document=json.dumps(job_document), description="Description", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job2.should.have.key("jobId").which.should.equal(job_id + "1") job2.should.have.key("jobArn") job2.should.have.key("description") jobs = client.list_jobs() jobs.should.have.key("jobs") jobs.should_not.have.key("nextToken") jobs["jobs"][0].should.have.key("jobId").which.should.equal(job_id) jobs["jobs"][1].should.have.key("jobId").which.should.equal(job_id + "1") @mock_iot def test_describe_job(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], documentSource="https://s3-eu-west-1.amazonaws.com/bucket-name/job_document.json", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job = client.describe_job(jobId=job_id) job.should.have.key("documentSource") job.should.have.key("job") job.should.have.key("job").which.should.have.key("jobArn") job.should.have.key("job").which.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("job").which.should.have.key("targets") job.should.have.key("job").which.should.have.key("jobProcessDetails") job.should.have.key("job").which.should.have.key("lastUpdatedAt") job.should.have.key("job").which.should.have.key("createdAt") job.should.have.key("job").which.should.have.key("jobExecutionsRolloutConfig") job.should.have.key("job").which.should.have.key( "targetSelection" ).which.should.equal("CONTINUOUS") job.should.have.key("job").which.should.have.key("presignedUrlConfig") job.should.have.key("job").which.should.have.key( "presignedUrlConfig" ).which.should.have.key("roleArn").which.should.equal( "arn:aws:iam::1:role/service-role/iot_job_role" ) job.should.have.key("job").which.should.have.key( "presignedUrlConfig" ).which.should.have.key("expiresInSec").which.should.equal(123) job.should.have.key("job").which.should.have.key( "jobExecutionsRolloutConfig" ).which.should.have.key("maximumPerMinute").which.should.equal(10) @mock_iot def test_describe_job_1(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") # job document job_document = {"field": "value"} job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], document=json.dumps(job_document), presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job = client.describe_job(jobId=job_id) job.should.have.key("job") job.should.have.key("job").which.should.have.key("jobArn") job.should.have.key("job").which.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("job").which.should.have.key("targets") job.should.have.key("job").which.should.have.key("jobProcessDetails") job.should.have.key("job").which.should.have.key("lastUpdatedAt") job.should.have.key("job").which.should.have.key("createdAt") job.should.have.key("job").which.should.have.key("jobExecutionsRolloutConfig") job.should.have.key("job").which.should.have.key( "targetSelection" ).which.should.equal("CONTINUOUS") job.should.have.key("job").which.should.have.key("presignedUrlConfig") job.should.have.key("job").which.should.have.key( "presignedUrlConfig" ).which.should.have.key("roleArn").which.should.equal( "arn:aws:iam::1:role/service-role/iot_job_role" ) job.should.have.key("job").which.should.have.key( "presignedUrlConfig" ).which.should.have.key("expiresInSec").which.should.equal(123) job.should.have.key("job").which.should.have.key( "jobExecutionsRolloutConfig" ).which.should.have.key("maximumPerMinute").which.should.equal(10) @mock_iot def test_delete_job(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], documentSource="https://s3-eu-west-1.amazonaws.com/bucket-name/job_document.json", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job = client.describe_job(jobId=job_id) job.should.have.key("job") job.should.have.key("job").which.should.have.key("jobId").which.should.equal(job_id) client.delete_job(jobId=job_id) client.list_jobs()["jobs"].should.have.length_of(0) @mock_iot def test_cancel_job(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], documentSource="https://s3-eu-west-1.amazonaws.com/bucket-name/job_document.json", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job = client.describe_job(jobId=job_id) job.should.have.key("job") job.should.have.key("job").which.should.have.key("jobId").which.should.equal(job_id) job = client.cancel_job(jobId=job_id, reasonCode="Because", comment="You are") job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job = client.describe_job(jobId=job_id) job.should.have.key("job") job.should.have.key("job").which.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("job").which.should.have.key("status").which.should.equal( "CANCELED" ) job.should.have.key("job").which.should.have.key( "forceCanceled" ).which.should.equal(False) job.should.have.key("job").which.should.have.key("reasonCode").which.should.equal( "Because" ) job.should.have.key("job").which.should.have.key("comment").which.should.equal( "You are" ) @mock_iot def test_get_job_document_with_document_source(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], documentSource="https://s3-eu-west-1.amazonaws.com/bucket-name/job_document.json", presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job_document = client.get_job_document(jobId=job_id) job_document.should.have.key("document").which.should.equal("") @mock_iot def test_get_job_document_with_document(): client = boto3.client("iot", region_name="eu-west-1") name = "my-thing" job_id = "TestJob" # thing thing = client.create_thing(thingName=name) thing.should.have.key("thingName").which.should.equal(name) thing.should.have.key("thingArn") # job document job_document = {"field": "value"} job = client.create_job( jobId=job_id, targets=[thing["thingArn"]], document=json.dumps(job_document), presignedUrlConfig={ "roleArn": "arn:aws:iam::1:role/service-role/iot_job_role", "expiresInSec": 123, }, targetSelection="CONTINUOUS", jobExecutionsRolloutConfig={"maximumPerMinute": 10}, ) job.should.have.key("jobId").which.should.equal(job_id) job.should.have.key("jobArn") job_document = client.get_job_document(jobId=job_id) job_document.should.have.key("document").which.should.equal('{"field": "value"}')
34.567723
90
0.652855
1,502
11,995
5.109188
0.05526
0.155069
0.199896
0.112588
0.929111
0.929111
0.914256
0.914256
0.912562
0.877508
0
0.01077
0.179491
11,995
346
91
34.66763
0.768949
0.019091
0
0.773381
0
0.014388
0.214815
0.051
0
0
0
0
0
1
0.028777
false
0
0.010791
0
0.039568
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
d2a48f60f52f83f99f0882d9e6142574d6214b1d
7,553
py
Python
plc_io/core_libraries/irrigation_hash_control_py3.py
bopopescu/docker_images_a
348d0982c5962f2ae34d10183ed9522b7a6fe286
[ "MIT" ]
2
2018-02-21T03:46:51.000Z
2019-12-24T16:40:51.000Z
plc_io/core_libraries/irrigation_hash_control_py3.py
bopopescu/docker_images_a
348d0982c5962f2ae34d10183ed9522b7a6fe286
[ "MIT" ]
7
2020-07-16T19:54:08.000Z
2022-03-02T03:29:07.000Z
plc_io/core_libraries/irrigation_hash_control_py3.py
bopopescu/docker_images_a
348d0982c5962f2ae34d10183ed9522b7a6fe286
[ "MIT" ]
2
2018-04-16T07:02:35.000Z
2020-07-23T21:57:19.000Z
import time import redis import json from redis_support_py3.construct_data_handlers_py3 import Generate_Handlers from redis_support_py3.graph_query_support_py3 import Query_Support def generate_irrigation_control(redis_site_data,qs ): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site_data["site"] ) query_list = qs.add_match_terminal( query_list, relationship = "PACKAGE", property_mask={"name":"IRRIGATION_CONTROL_MANAGEMENT"} ) package_sets, package_sources = qs.match_list(query_list) package = package_sources[0] data_structures = package["data_structures"] generate_handlers = Generate_Handlers(package,qs) return generate_handlers.construct_managed_hash(data_structures["IRRIGATION_CONTROL"]) def generate_sensor_minute_status(redis_site,qs ): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_terminal( query_list, relationship = "PACKAGE", property_mask={"name":"MQTT_DEVICES_DATA"} ) package_sets, package_sources = qs.match_list(query_list) package = package_sources[0] data_structures = package["data_structures"] generate_handlers = Generate_Handlers(package,qs) return generate_handlers.construct_hash(data_structures["MQTT_SENSOR_STATUS"]) def generate_mqtt_devices(redis_site,qs ): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_terminal( query_list, relationship = "PACKAGE", property_mask={"name":"MQTT_DEVICES_DATA"} ) package_sets, package_sources = qs.match_list(query_list) package = package_sources[0] data_structures = package["data_structures"] generate_handlers = Generate_Handlers(package,qs) return generate_handlers.construct_hash(data_structures["MQTT_CONTACT_LOG"]) def get_irrigation_current_limit(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "IRRIGATION_VALVE_CURRENT_LIMIT" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0]["limit"] def get_flow_checking_limits(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "EXCESSIVE_FLOW_LIMITS" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0] def get_cleaning_limits(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "CLEANING_LIMITS" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0]["limit"] def get_cleaning_flow_limits(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "CLEANING_FLOW_LIMITS" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0]["limit"] def get_current_limits(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "CURRENT_LIMITS" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0] def get_master_valves(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "MASTER_VALVES" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0]["MASTER_VALVES"] def get_cleaning_valves(redis_site,qs): query_list = [] query_list = qs.add_match_relationship( query_list,relationship="SITE",label=redis_site["site"] ) query_list = qs.add_match_relationship( query_list,relationship="IRRIGIGATION_SCHEDULING_CONTROL" ) query_list = qs.add_match_terminal( query_list, relationship = "CLEANING_VALVES" ) limits_sets, limit_sources = qs.match_list(query_list) return limit_sources[0]["CLEANING_VALVES"] if __name__ == "__main__": # for test only # # Read Boot File # expand json file # file_handle = open("system_data_files/redis_server.json",'r') data = file_handle.read() file_handle.close() redis_site = json.loads(data) x = generate_irrigation_control(redis_site) # # Binary Test # print(x.hget("RAIN_FLAG")) x.hset("RAIN_FLAG",x.hget("RAIN_FLAG")) print(x.hget("RAIN_FLAG")) x.hset("RAIN_FLAG",1) print(x.hget("RAIN_FLAG")) x.hset("RAIN_FLAG",0) print(x.hget("RAIN_FLAG")) # # Float Test # temp = x.hget("FLOW_CUT_OFF") print(temp) x.hset("FLOW_CUT_OFF",35) print(x.hget("FLOW_CUT_OFF")) x.hset("FLOW_CUT_OFF",temp) print(x.hget("FLOW_CUT_OFF")) # # string test # temp = x.hget("SCHEDULE_NAME") print(temp) x.hset("SCHEDULE_NAME","TEMP") print(x.hget("SCHEDULE_NAME")) x.hset("SCHEDULE_NAME",temp) print(x.hget("SCHEDULE_NAME")) # # dictionary test # temp = x.hget("SLAVE_MAX_CURRENT") print(temp) x.hset("SLAVE_MAX_CURRENT",temp) temp_1 = x.hget("SLAVE_MAX_CURRENT") print(temp,temp_1) temp = x.hget_all() print(temp)
40.175532
123
0.628624
853
7,553
5.168816
0.107855
0.151055
0.067362
0.085734
0.822636
0.792924
0.783851
0.770696
0.770696
0.749603
0
0.003663
0.277108
7,553
187
124
40.390374
0.803846
0.012843
0
0.601626
1
0
0.132018
0.045799
0
0
0
0
0
1
0.081301
false
0
0.04065
0
0.203252
0.105691
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d2a794f5ccf66230f8c60917e047e303a3769c55
22,407
py
Python
pyqmri/_helper_fun/_est_coils.py
philippgualdi/PyQMRI
5de3a7da5feb2d01b746acd47d1dba91a8a1417e
[ "Apache-2.0" ]
null
null
null
pyqmri/_helper_fun/_est_coils.py
philippgualdi/PyQMRI
5de3a7da5feb2d01b746acd47d1dba91a8a1417e
[ "Apache-2.0" ]
null
null
null
pyqmri/_helper_fun/_est_coils.py
philippgualdi/PyQMRI
5de3a7da5feb2d01b746acd47d1dba91a8a1417e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Estimated complex coil sensitivity information. Estimates sensitivities and complex image. (see Martin Uecker: Image reconstruction by regularized nonlinear inversion joint estimation of coil sensitivities and image content) """ import sys import numpy as np import ipyparallel as ipp import pyopencl.array as clarray from pyqmri._helper_fun import _nlinvns_3D as nlinvns3D from pyqmri._helper_fun import _nlinvns as nlinvns from pyqmri._helper_fun import _goldcomp as goldcomp from pyqmri._helper_fun import _utils as utils def est_coils(data, par, file, args, off): """Estimate coil sensitivity profiles. This function estimates coil sensitivity profiles based on the non-linear inversion method from Uecker et al. It first checks if coil information is present in the given data file and if the size matches the number of slices that should be reconstructed. If the check fails, new coil sensitivity information is estimated and saved to the data file. Parameters ---------- data : numpy.array The complex k-space data. par : dict Parameter dictionary. file : h5py.File A h5py.File possibly containing the coil profiles. Also used for storing newly computed profile information. args : argparse.ArgumentParser Commandline arguments passed to the script. off : int A possible offset of the zero slice. Returns ------- numpy.array The complex coilsensitivity information. """ ########################################################################### # Initiate parallel interface ############################################# ########################################################################### c = ipp.Client() nlinvNewtonSteps = 6 nlinvRealConstr = False if args.sms or "Coils_real" in list(file.keys()): print("Using precomputed coil sensitivities") if "Coils_real" in file.keys(): slices_coils = file['Coils_real'][()].shape[1] par["C"] = file['Coils_real'][ :, int(slices_coils / 2) - int(np.floor((par["NSlice"]) / 2)) + off: int(slices_coils / 2) + int(np.ceil(par["NSlice"] / 2)) + off, ...] + 1j * file['Coils_imag'][ :, int(slices_coils / 2) - int(np.floor((par["NSlice"]) / 2)) + off: int(slices_coils / 2) + int(np.ceil(par["NSlice"] / 2)) + off, ...] par["C"] = par["C"].astype(par["DTYPE"]) else: slices_coils = file['Coils'][()].shape[1] par["C"] = file['Coils'][ :, int(slices_coils / 2) - int(np.floor((par["NSlice"]) / 2)) + off: int(slices_coils / 2) + int(np.ceil(par["NSlice"] / 2)) + off, ...] par["C"] = par["C"].astype(par["DTYPE"]) elif not args.sms and "Coils" in list(file.keys()): if args.trafo and not file['Coils'].shape[1] >= par["NSlice"]: traj_coil = par["traj"].reshape( par["NScan"] * par["Nproj"], par["N"], -1) dcf_coil = np.sqrt(goldcomp.cmp(traj_coil)) dcf_coil = np.require(dcf_coil, requirements='C', dtype=par["DTYPE_real"]) par["C"] = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par["phase"] = np.zeros( (par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par_coils = {} par_coils["ogf"] = par["ogf"] par_coils["traj"] = traj_coil par_coils["dcf"] = dcf_coil par_coils["N"] = par["N"] par_coils["NScan"] = 1 par_coils["NC"] = 1 par_coils["NSlice"] = 1 par_coils["ctx"] = par["ctx"] par_coils["queue"] = par["queue"] par_coils["dimX"] = par["dimX"] par_coils["dimY"] = par["dimY"] par_coils["fft_dim"] = [-2, -1] par_coils["use_GPU"] = par["use_GPU"] par_coils["DTYPE"] = par["DTYPE"] par_coils["DTYPE_real"] = par["DTYPE_real"] if "is3D" in par.keys(): par_coils["NSlice"] = par["NSlice"] par_coils["is3D"] = par["is3D"] FFT = utils.NUFFT(par_coils) result = [] if args.is3Ddata: sys.stdout.write( "Computing coil sensitivity maps in 3D") sys.stdout.flush() # RADIAL PART combinedData = np.transpose( data[:, :, :, :, :], (1, 2, 0, 3, 4)) combinedData = np.require( np.reshape( combinedData, (1, par["NC"], 1, par["NScan"] * par["Nproj"], par["N"])), requirements='C') tmp_coilData = clarray.zeros( FFT.queue, (1, par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) coilData = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) for j in range(par["NC"]): tmp_combinedData = clarray.to_device( FFT.queue, combinedData[None, :, j, ...]) FFT.FFTH(tmp_coilData, tmp_combinedData) coilData[j, ...] = np.squeeze(tmp_coilData.get()) combinedData = np.require( np.fft.fftn( coilData, norm='ortho', axes=(-3, -2, -1)), dtype=par["DTYPE"], requirements='C') result = nlinvns3D.nlinvns( combinedData, nlinvNewtonSteps, par_coils, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"]) sys.stdout.write("done") par["C"] = result[2:,-1] else: for i in range(0, (par["NSlice"])): sys.stdout.write( "Computing coil sensitivity map of slice %i \r" % (i)) sys.stdout.flush() # RADIAL PART combinedData = np.transpose( data[:, :, i, :, :], (1, 0, 2, 3)) combinedData = np.require( np.reshape( combinedData, (1, par["NC"], 1, par["NScan"] * par["Nproj"], par["N"])), requirements='C') * dcf_coil tmp_coilData = clarray.zeros( FFT.queue, (1, 1, 1, par["dimY"], par["dimX"]), dtype=par["DTYPE"]) coilData = np.zeros( (par["NC"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) for j in range(par["NC"]): tmp_combinedData = clarray.to_device( FFT.queue, combinedData[None, :, j, ...]) FFT.FFTH(tmp_coilData, tmp_combinedData) coilData[j, ...] = np.squeeze(tmp_coilData.get()) combinedData = np.require( np.fft.fft2( coilData, norm=None) / np.sqrt( par["dimX"] * par["dimY"]), dtype=par["DTYPE"], requirements='C') dview = c[int(np.floor(i * len(c) / par["NSlice"]))] result.append( dview.apply_async( nlinvns.nlinvns, combinedData, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"])) for i in range(par["NSlice"]): par["C"][:, i, :, :] = result[i].get()[2:, -1, :, :] sys.stdout.write("slice %i done \r" % (i)) sys.stdout.flush() if not nlinvRealConstr: par["phase"][i, :, :] = np.exp( 1j * np.angle(result[i].get()[0, -1, :, :])) # standardize coil sensitivity profiles sumSqrC = np.sqrt( np.sum( (par["C"] * np.conj( par["C"])), 0)) par["InScale"] = sumSqrC if par["NC"] == 1: par["C"] = sumSqrC else: par["C"] = par["C"] / \ np.tile(sumSqrC, (par["NC"], 1, 1, 1)) del file['Coils'] del FFT file.create_dataset( "Coils", par["C"].shape, dtype=par["C"].dtype, data=par["C"]) file.flush() elif not args.trafo and not \ file['Coils'].shape[1] >= par["NSlice"]: par["C"] = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par["phase"] = np.zeros( (par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) result = [] combinedData = np.sum(data, 0) if args.use3Dcoilest: if not args.is3Ddata: combinedData = np.fft.fft(combinedData, axis=-3, norm="ortho") sys.stdout.write( "Computing coil sensitivity maps in 3D") sys.stdout.flush() result = nlinvns3D.nlinvns(combinedData, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"]) sys.stdout.write("done") par["C"] = result[2:,-1] else: for i in range(0, (par["NSlice"])): sys.stdout.write( "Computing coil sensitivity map of slice %i \r" % (i)) sys.stdout.flush() tmp = combinedData[:, i, ...] dview = c[int(np.floor(i * len(c) / par["NSlice"]))] result.append( dview.apply_async( nlinvns.nlinvns, tmp, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"])) for i in range(par["NSlice"]): par["C"][:, i, :, :] = result[i].get()[2:, -1, :, :] sys.stdout.write("slice %i done \r" % (i)) sys.stdout.flush() if not nlinvRealConstr: par["phase"][i, :, :] = np.exp( 1j * np.angle(result[i].get()[0, -1, :, :])) # standardize coil sensitivity profiles sumSqrC = np.sqrt( np.sum( (par["C"] * np.conj( par["C"])), 0)) par["InScale"] = sumSqrC if par["NC"] == 1: par["C"] = sumSqrC else: par["C"] = par["C"] / \ np.tile(sumSqrC, (par["NC"], 1, 1, 1)) del file['Coils'] file.create_dataset( "Coils", par["C"].shape, dtype=par["C"].dtype, data=par["C"]) file.flush() else: print("Using precomputed coil sensitivities") slices_coils = file['Coils'].shape[1] par["C"] = \ file['Coils'][ :, int(slices_coils / 2) - int(np.floor((par["NSlice"]) / 2)) + off: int(slices_coils / 2) + int(np.ceil(par["NSlice"] / 2)) + off, ...] par["C"] = par["C"].astype(par["DTYPE"]) else: if args.trafo: traj_coil = par["traj"].reshape( par["NScan"] * par["Nproj"], par["N"], -1) dcf_coil = np.repeat(par["dcf"] , par["NScan"], axis=0) par["C"] = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par["phase"] = np.zeros( (par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par_coils = {} par_coils["ogf"] = par["ogf"] par_coils["traj"] = traj_coil par_coils["dcf"] = dcf_coil par_coils["dimX"] = par["dimX"] par_coils["dimY"] = par["dimY"] par_coils["N"] = par["N"] par_coils["NScan"] = 1 par_coils["NC"] = 1 par_coils["NSlice"] = 1 par_coils["ctx"] = par["ctx"] par_coils["queue"] = par["queue"] par_coils["fft_dim"] = par["fft_dim"] par_coils["use_GPU"] = par["use_GPU"] par_coils["DTYPE"] = par["DTYPE"] par_coils["DTYPE_real"] = par["DTYPE_real"] if "is3D" in par.keys(): par_coils["NSlice"] = par["NSlice"] par_coils["is3D"] = par["is3D"] FFT = utils.NUFFT(par_coils) result = [] if args.is3Ddata: sys.stdout.write( "Computing coil sensitivity maps in 3D") sys.stdout.flush() # RADIAL PART combinedData = np.transpose( data[:, :, :, :, :], (1, 2, 0, 3, 4)) combinedData = np.require( np.reshape( combinedData, (1, par["NC"], 1, par["NScan"] * par["Nproj"], par["N"])), requirements='C') tmp_coilData = clarray.zeros( FFT.queue, (1, 1, par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) coilData = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) for j in range(par["NC"]): tmp_combinedData = clarray.to_device( FFT.queue, combinedData[None, :, j, ...]) FFT.FFTH(tmp_coilData, tmp_combinedData) coilData[j, ...] = np.squeeze(tmp_coilData.get()) combinedData = np.require( np.fft.fftn( coilData, norm='ortho', axes=(-3, -2, -1)), dtype=par["DTYPE"], requirements='C') result = nlinvns3D.nlinvns(combinedData, nlinvNewtonSteps, par_coils, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"]) sys.stdout.write("done") par["C"] = result[2:,-1] else: for i in range(0, (par["NSlice"])): sys.stdout.write( "Computing coil sensitivity map of slice %i \r" % (i)) sys.stdout.flush() combinedData = np.transpose(data[:, :, i, :, :], (1, 0, 2, 3)) combinedData = np.require( np.reshape( combinedData, (1, par["NC"], 1, par["NScan"] * par["Nproj"], par["N"])), requirements='C') * dcf_coil tmp_coilData = clarray.zeros( FFT.queue, (1, 1, 1, par["dimY"], par["dimX"]), dtype=par["DTYPE"]) coilData = np.zeros( (par["NC"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) for j in range(par["NC"]): tmp_combinedData = clarray.to_device( FFT.queue, combinedData[None, :, j, ...]) FFT.FFTH(tmp_coilData, tmp_combinedData) coilData[j, ...] = np.squeeze(tmp_coilData.get()) combinedData = np.require( np.fft.fft2( coilData, norm=None) / np.sqrt( par["dimX"] * par["dimY"]), dtype=par["DTYPE"], requirements='C') dview = c[int(np.floor(i * len(c) / par["NSlice"]))] result.append( dview.apply_async( nlinvns.nlinvns, combinedData, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"])) for i in range(par["NSlice"]): par["C"][:, i, :, :] = result[i].get()[2:, -1, :, :] sys.stdout.write("slice %i done \r" % (i)) sys.stdout.flush() if not nlinvRealConstr: par["phase"][i, :, :] = np.exp( 1j * np.angle(result[i].get()[0, -1, :, :])) # standardize coil sensitivity profiles sumSqrC = np.sqrt( np.sum( (par["C"] * np.conj( par["C"])), 0)) par["InScale"] = sumSqrC if par["NC"] == 1: par["C"] = sumSqrC else: par["C"] = par["C"] / np.tile(sumSqrC, (par["NC"], 1, 1, 1)) del FFT else: par["C"] = np.zeros( (par["NC"], par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) par["phase"] = np.zeros( (par["NSlice"], par["dimY"], par["dimX"]), dtype=par["DTYPE"]) result = [] combinedData = np.sum(data, 0) if args.use3Dcoilest: if not args.is3Ddata: combinedData = np.fft.fft(combinedData, axis=-3, norm="ortho") sys.stdout.write( "Computing coil sensitivity maps in 3D") sys.stdout.flush() result = nlinvns3D.nlinvns( combinedData, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"]) sys.stdout.write("done") par["C"] = result[2:,-1] else: for i in range(0, (par["NSlice"])): sys.stdout.write( "Computing coil sensitivity map of slice %i \r" % (i)) sys.stdout.flush() # RADIAL PART tmp = combinedData[:, i, ...] dview = c[int(np.floor(i * len(c) / par["NSlice"]))] result.append( dview.apply_async( nlinvns.nlinvns, tmp, nlinvNewtonSteps, True, nlinvRealConstr, DTYPE=par["DTYPE"], DTYPE_real=par["DTYPE_real"])) for i in range(par["NSlice"]): par["C"][:, i, :, :] = result[i].get()[2:, -1, :, :] sys.stdout.write("slice %i done \r" % (i)) sys.stdout.flush() if not nlinvRealConstr: par["phase"][i, :, :] = np.exp( 1j * np.angle(result[i].get()[0, -1, :, :])) # standardize coil sensitivity profiles sumSqrC = np.sqrt( np.sum( (par["C"] * np.conj( par["C"])), 0)) par["InScale"] = sumSqrC if par["NC"] == 1: par["C"] = sumSqrC[None, ...] else: par["C"] = par["C"] / np.tile(sumSqrC, (par["NC"], 1, 1, 1)) file.create_dataset( "Coils", par["C"].shape, dtype=par["C"].dtype, data=par["C"]) file.flush()
40.888686
93
0.386531
2,018
22,407
4.221506
0.111497
0.023477
0.047306
0.026294
0.837305
0.822514
0.812771
0.812771
0.812771
0.812771
0
0.013401
0.470478
22,407
547
94
40.963437
0.704593
0.060383
0
0.89738
0
0
0.083755
0
0
0
0
0
0
1
0.002183
false
0
0.017467
0
0.019651
0.004367
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d2b4cc45f8aa5b41ca1b2e00c4ff166ade8ed63f
49,738
py
Python
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/classDefs_solverWrapper/methodDefs_KratosSolverWrapper/solve.py
SADPR/Kratos
82d1e335d2e7e674f77022a3d91c958168805d59
[ "BSD-4-Clause" ]
null
null
null
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/classDefs_solverWrapper/methodDefs_KratosSolverWrapper/solve.py
SADPR/Kratos
82d1e335d2e7e674f77022a3d91c958168805d59
[ "BSD-4-Clause" ]
null
null
null
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/classDefs_solverWrapper/methodDefs_KratosSolverWrapper/solve.py
SADPR/Kratos
82d1e335d2e7e674f77022a3d91c958168805d59
[ "BSD-4-Clause" ]
null
null
null
# Import Kratos import KratosMultiphysics from KratosMultiphysics.MultilevelMonteCarloApplication.adaptive_refinement_utilities import AdaptiveRefinement from xmc.distributedEnvironmentFramework import * # Import python packages import time import pickle try: from threadpoolctl import * except: pass #################################################################################################### ############################################ WRAPPERS ############################################## #################################################################################################### def executeInstanceStochasticAdaptiveRefinementAllAtOnce_Wrapper(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,current_contribution): if (current_index == 0): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev0_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 1): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev1_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 2): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev2_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 3): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev3_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 4): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev4_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 5): qoi,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev5_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") else: raise Exception("Level not supported") return qoi,time_for_qoi def executeInstanceStochasticAdaptiveRefinementMultipleTasks_Wrapper(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,print_to_file,current_contribution,pickled_mapping_reference_model=None): if (current_index == 0): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev0_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 1): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev1_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 2): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev2_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 3): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev3_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 4): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev4_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 5): qoi,pickled_current_model,time_for_qoi = ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev5_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") else: raise Exception("Level not supported") return qoi,pickled_current_model,time_for_qoi def executeInstanceDeterministicAdaptiveRefinement_Wrapper(current_index,pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): if (current_index == 0): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev0_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) elif (current_index == 1): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev1_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) elif (current_index == 2): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev2_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) elif (current_index == 3): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev3_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) elif (current_index == 4): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev4_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) elif (current_index == 5): qoi,time_for_qoi = executeInstanceDeterministicAdaptiveRefinementAuxLev5_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) else: raise Exception("Level not supported") return qoi,time_for_qoi def executeInstanceReadingFromFile_Wrapper(current_index,pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,current_contribution): if (current_index == 0): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev0_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 1): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev1_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 2): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev2_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 3): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev3_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 4): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev4_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") elif (current_index == 5): qoi,time_for_qoi = executeInstanceReadingFromFileAuxLev5_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,"filename_level_"+str(current_index)+"_contribution_"+str(current_contribution)+"_random_variable_"+str(random_variable[0])+".dat") else: raise Exception("Level not supported") return qoi,time_for_qoi #################################################################################################### ############################################## TASKS ############################################### #################################################################################################### ############################### StochasticAdaptiveRefinementAllAtOnce ############################## # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_0}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev0_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_0"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) return qoi,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_1}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev1_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_1"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) return qoi,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_2}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev2_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_2"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) else: # not running since we jump from coarsest to finest level pass return qoi,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_3}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev3_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_3"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) return qoi,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_4}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev4_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_4"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) return qoi,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=2) @constraint(ComputingUnits="${computing_units_mlmc_execute_5}") @ExaquteTask(returns=2) def ExecuteInstanceStochasticAdaptiveRefinementAllAtOnceAuxLev5_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_analysis,time_for_qoi,mapping_flag,adaptive_refinement_jump_to_finest_level,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_5"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 pickled_coarsest_model = pickled_coarse_model for current_local_index in range(current_index+1): if ((adaptive_refinement_jump_to_finest_level is False) or (adaptive_refinement_jump_to_finest_level is True and (current_local_index == 0 or current_local_index == current_index))): qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_coarsest_model,print_to_file,filename) del(pickled_coarse_model) pickled_coarse_model = pickled_current_model del(pickled_current_model) return qoi,time_for_qoi ############################# StochasticAdaptiveRefinementMultipleTasks ############################ # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_0}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev0_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_0"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_1}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev1_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_1"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_2}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev2_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_2"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_3}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev3_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_3"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_4}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev4_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_4"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi # @ExaquteTask(filename=FILE_OUT,returns=3) @constraint(ComputingUnits="${computing_units_mlmc_execute_5}") @ExaquteTask(returns=3) def ExecuteInstanceStochasticAdaptiveRefinementMultipleTasksAuxLev5_Task(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_5"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,pickled_current_model,time_for_qoi = \ ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_local_index,current_analysis,time_for_qoi,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename) return qoi,pickled_current_model,time_for_qoi ########################################## DeterministicAdaptiveRefinement ######################################## @constraint(ComputingUnits="${computing_units_mlmc_execute_0}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev0_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_0"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_1}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev1_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_1"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_2}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev2_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_2"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_3}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev3_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_3"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_4}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev4_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_4"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_5}") @ExaquteTask(returns=2) def executeInstanceDeterministicAdaptiveRefinementAuxLev5_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_5"]) threadpool_limits(limits=open_mp_threads) except: pass qoi,time_for_qoi = \ ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi) return qoi,time_for_qoi ########################################## ReadingFromFile ######################################### @constraint(ComputingUnits="${computing_units_mlmc_execute_0}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev0_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_0"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_1}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev1_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_1"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_2}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev2_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_2"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_3}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev3_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_3"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_4}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev4_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_4"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi @constraint(ComputingUnits="${computing_units_mlmc_execute_5}") @ExaquteTask(returns=2) def executeInstanceReadingFromFileAuxLev5_Task(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): try: open_mp_threads = int(os.environ["computing_units_mlmc_execute_5"]) threadpool_limits(limits=open_mp_threads) except: open_mp_threads = 1 qoi,time_for_qoi = \ ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis,random_variable,time_for_qoi,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads) return qoi,time_for_qoi ############################################# ZeroTask ############################################# @ExaquteTask(returns=2) def returnZeroQoiAndTime_Task(number): qoi = [0.0 for _ in range(number)] time_for_qoi = 0.0 return qoi,time_for_qoi #################################################################################################### ######################################### FUNCTIONALITIES ########################################## #################################################################################################### def ExecuteInstanceDeterministicAdaptiveRefinementAux_Functionality(pickled_model,pickled_project_parameters,current_analysis_stage,random_variable,previous_computational_time): """ Auxiliary method to the solve method of the KratosSolverWrapper class. The problem is solved calling Kratos. To be called if the selected refinement strategy is deterministic_adaptive_refinement. Inputs: - pickled_model: serialization of the model. - pickled_project_parameters: serialization of the Project Parameters. - current_analysis_stage: analysis stage of the problem. - random_variable: random variable of the current instance. - previous_computational_time: time to solution of previous indices, if any. Outputs: - qoi: list containing all the quantities of interest. - computational_time: time to solution up to current index. """ start_time = time.time() # overwrite the old model serializer with the unpickled one model_serializer = pickle.loads(pickled_model) current_model = KratosMultiphysics.Model() model_serializer.Load("ModelSerialization",current_model) del(model_serializer) # overwrite the old parameters serializer with the unpickled one serialized_project_parameters = pickle.loads(pickled_project_parameters) current_project_parameters = KratosMultiphysics.Parameters() serialized_project_parameters.Load("ParametersSerialization",current_project_parameters) del(serialized_project_parameters) simulation = current_analysis_stage(current_model,current_project_parameters,random_variable) simulation.Run() qoi = simulation.EvaluateQuantityOfInterest() end_time = time.time() computational_time = previous_computational_time + (end_time-start_time) return qoi,computational_time def ExecuteInstanceStochasticAdaptiveRefinementAux_Functionality(current_global_index,pickled_coarse_model,pickled_coarse_project_parameters,pickled_custom_metric_refinement_parameters,pickled_custom_remesh_refinement_parameters,random_variable,current_index,current_analysis_stage,previous_computational_time,open_mp_threads,mapping_flag,pickled_mapping_reference_model,print_to_file,filename): """ Auxiliary method to the solve method of the KratosSolverWrapper class. Firstly, if needed, adaptive refinement is performed. Then the problem is solved calling Kratos. To be called if the selected refinement strategy is stochastic_adaptive_refinement. Inputs: - current_global_index: index we are interested in and for which we have called the solve method of the solver wrapper. - pickled_coarse_model: serialization of the model. - pickled_coarse_project_parameters: serialization of the parameters. - pickled_custom_metric_refinement_parameters: serialization of metric adaptive refinement parameters. - pickled_custom_remesh_refinement_parameters: serialization of remeshing adaptive refinement parameters. - random_variable: list containing all random variables. - current_index: index we are currently solving at this moment. May be different from current_global_index for "stocharstic_adaptive_refinement" strategy. - current_analysis_stage: Kratos analysis stage of the problem. - previous_computational_time: time to solution of previous indices, if any. - open_mp_threads: number of threads we are exploiting to solve current task. - mapping_flag: booleans. Defines if in current_analysis_stage = SimulationScenario class mapping is required. - pickled_mapping_reference_model: Kratos Model to which mapping is performed. - print_to_file: boolean. If true, the specific filename is passed to the analysis stage. - filename: string which defines the name of the file the task will write, if any. Outputs: - qoi: quantities of interest. - pickled_finer_model: serialized adaptively refined model, used at current index. - computational_time: time to solution up to current index. """ start_time = time.time() # unpickle model and build Kratos Model object serialized_model = pickle.loads(pickled_coarse_model) current_model = KratosMultiphysics.Model() serialized_model.Load("ModelSerialization",current_model) del(serialized_model) # unpickle parameters and build Kratos Parameters object serialized_project_parameters = pickle.loads(pickled_coarse_project_parameters) current_project_parameters = KratosMultiphysics.Parameters() serialized_project_parameters.Load("ParametersSerialization",current_project_parameters) del(serialized_project_parameters) # refine if current current_global_index > 0, adaptive refinement based on the solution of previous index if (current_index > 0): # unpickle metric and remesh refinement parameters and build Kratos Parameters objects serialized_custom_metric_refinement_parameters = pickle.loads(pickled_custom_metric_refinement_parameters) serialized_custom_remesh_refinement_parameters = pickle.loads(pickled_custom_remesh_refinement_parameters) current_custom_metric_refinement_parameters = KratosMultiphysics.Parameters() current_custom_remesh_refinement_parameters = KratosMultiphysics.Parameters() serialized_custom_metric_refinement_parameters.Load("MetricRefinementParametersSerialization",current_custom_metric_refinement_parameters) serialized_custom_remesh_refinement_parameters.Load("RemeshRefinementParametersSerialization",current_custom_remesh_refinement_parameters) del(serialized_custom_metric_refinement_parameters,serialized_custom_remesh_refinement_parameters) # refine the model Kratos object adaptive_refinement_manager = AdaptiveRefinement(current_index,current_model,current_project_parameters,current_custom_metric_refinement_parameters,current_custom_remesh_refinement_parameters) refined_model,refined_project_parameters = adaptive_refinement_manager.ComputeAdaptiveRefinement() current_model = refined_model del(refined_model,refined_project_parameters) # constructor analysis stage simulation = current_analysis_stage(current_model,current_project_parameters,random_variable) # add filename flag print_to_file is true if (print_to_file): simulation.filename = filename # add flag if current index is maximum index if (current_index == current_global_index): simulation.is_current_index_maximum_index = True else: simulation.is_current_index_maximum_index = False # mapping if in current finest level and mapping flag is true # otherwise standard behavior if (mapping_flag is True and current_index == current_global_index): # unpickle mapping reference model and build Kratos Model object serialized_mapping_reference_model = pickle.loads(pickled_mapping_reference_model) mapping_reference_model = KratosMultiphysics.Model() serialized_mapping_reference_model.Load("ModelSerialization",mapping_reference_model) del(serialized_mapping_reference_model) # send reference model to analysis stage for mapping and set mapping flag to true simulation.mapping_reference_model = mapping_reference_model simulation.mapping = True simulation.Run() # mapping if in current finest level and mapping flag is true # otherwise standard qoi evaluation if (mapping_flag is True and current_index == current_global_index): qoi = simulation.MappingAndEvaluateQuantityOfInterest() else: qoi = simulation.EvaluateQuantityOfInterest() # save model and parameters as MpiSerializer Kratos objects serialized_finer_model = KratosMultiphysics.MpiSerializer() serialized_finer_model.Save("ModelSerialization",simulation.model) # pickle model and parameters pickled_finer_model = pickle.dumps(serialized_finer_model, 2) # second argument is the protocol and is NECESSARY (according to pybind11 docs) del(simulation) end_time = time.time() computational_time = previous_computational_time + open_mp_threads*(end_time-start_time) # multiply by open mp threads to consider real machine cost return qoi,pickled_finer_model,computational_time @ExaquteTask(returns=2) def ExecuteInstanceReadingFromFileAux_Functionality(pickled_model,pickled_project_parameters,current_analysis_stage,random_variable,previous_computational_time,mapping_flag,pickled_mapping_reference_model,print_to_file,filename,open_mp_threads): """ Auxiliary method to the solve method of the KratosSolverWrapper class. The problem is solved calling Kratos. To be called if the selected refinement strategy is reading_from_file. Inputs: - pickled_model: serialization of the model. - pickled_project_parameters: serialization of the parameters. - current_analysis_stage: Kratos analysis stage of the problem. - random_variable: list containing all random variables. - previous_computational_time: time to solution of previous indices, if any. - mapping_flag: booleans. Defines if in current_analysis_stage = SimulationScenario class mapping is required. - pickled_mapping_reference_model: Kratos Model to which mapping is performed. - print_to_file: boolean. If true, the specific filename is passed to the analysis stage. - filename: string which defines the name of the file the task will write, if any. - open_mp_threads: number of threads we are exploiting to solve current task. Outputs: - qoi: quantities of interest. - computational_time: time to solution up to current index. """ start_time = time.time() # unpickle model and build Kratos Model object serialized_model = pickle.loads(pickled_model) current_model = KratosMultiphysics.Model() serialized_model.Load("ModelSerialization",current_model) del(serialized_model) # unpickle parameters and build Kratos Parameters object serialized_project_parameters = pickle.loads(pickled_project_parameters) current_project_parameters = KratosMultiphysics.Parameters() serialized_project_parameters.Load("ParametersSerialization",current_project_parameters) del(serialized_project_parameters) # constructor analysis stage simulation = current_analysis_stage(current_model,current_project_parameters,random_variable) # add filename flag print_to_file is true if (print_to_file): simulation.filename = filename # add flag if current index is maximum index: always True simulation.is_current_index_maximum_index = True # mapping if in current finest level (always true) and mapping flag is true # otherwise standard behavior if (mapping_flag is True): # unpickle mapping reference model and build Kratos Model object serialized_mapping_reference_model = pickle.loads(pickled_mapping_reference_model) mapping_reference_model = KratosMultiphysics.Model() serialized_mapping_reference_model.Load("ModelSerialization",mapping_reference_model) del(serialized_mapping_reference_model) # send reference model to analysis stage for mapping and set mapping flag to true simulation.mapping_reference_model = mapping_reference_model simulation.mapping = True simulation.Run() # mapping if in current finest level and mapping flag is true # otherwise standard qoi evaluation if (mapping_flag is True): qoi = simulation.MappingAndEvaluateQuantityOfInterest() else: qoi = simulation.EvaluateQuantityOfInterest() del(simulation) end_time = time.time() computational_time = previous_computational_time + open_mp_threads*(end_time-start_time) # multiply by open mp threads to consider real machine cost return qoi,computational_time
76.874807
531
0.81676
5,809
49,738
6.507661
0.04493
0.028516
0.040738
0.028146
0.934053
0.919715
0.907362
0.891437
0.885776
0.870513
0
0.004785
0.096707
49,738
646
532
76.993808
0.836627
0.117777
0
0.812632
0
0
0.064722
0.039145
0
0
0
0
0
1
0.067368
false
0.016842
0.012632
0
0.147368
0.128421
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d2c37eaeb9c02e273938bfee618c637e6c1f35c6
10,135
py
Python
goods/serializers.py
ashrafali46/GreaterWMS
1aed14a8c26c8ac4571db5e6b07ab7e4fa3c7c72
[ "Apache-2.0" ]
2
2021-11-09T10:29:44.000Z
2021-11-15T08:03:40.000Z
goods/serializers.py
ashrafali46/GreaterWMS
1aed14a8c26c8ac4571db5e6b07ab7e4fa3c7c72
[ "Apache-2.0" ]
null
null
null
goods/serializers.py
ashrafali46/GreaterWMS
1aed14a8c26c8ac4571db5e6b07ab7e4fa3c7c72
[ "Apache-2.0" ]
null
null
null
from rest_framework import serializers from .models import ListModel from utils import datasolve class GoodsGetSerializer(serializers.ModelSerializer): goods_code = serializers.CharField(read_only=True, required=False) goods_desc = serializers.CharField(read_only=True, required=False) goods_supplier = serializers.CharField(read_only=True, required=False) goods_weight = serializers.FloatField(read_only=True, required=False) goods_w = serializers.FloatField(read_only=True, required=False) goods_d = serializers.FloatField(read_only=True, required=False) goods_h = serializers.FloatField(read_only=True, required=False) unit_volume = serializers.FloatField(read_only=True, required=False) goods_unit = serializers.CharField(read_only=True, required=False) goods_class = serializers.CharField(read_only=True, required=False) goods_brand = serializers.CharField(read_only=True, required=False) goods_color = serializers.CharField(read_only=True, required=False) goods_shape = serializers.CharField(read_only=True, required=False) goods_specs = serializers.CharField(read_only=True, required=False) goods_origin = serializers.CharField(read_only=True, required=False) goods_cost = serializers.FloatField(read_only=True, required=False) goods_price = serializers.FloatField(read_only=True, required=False) creater = serializers.CharField(read_only=True, required=False) create_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S') update_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S') class Meta: model = ListModel exclude = ['openid', 'is_delete', ] read_only_fields = ['id'] class GoodsPostSerializer(serializers.ModelSerializer): openid = serializers.CharField(read_only=False, required=False, validators=[datasolve.openid_validate]) goods_code = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_desc = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_supplier = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_weight = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_w = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_d = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_h = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) unit_volume = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_unit = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_class = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_brand = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_color = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_shape = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_specs = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_origin = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_cost = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_price = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) creater = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) class Meta: model = ListModel exclude = ['is_delete', ] read_only_fields = ['id', 'create_time', 'update_time', ] class GoodsUpdateSerializer(serializers.ModelSerializer): goods_code = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_desc = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_supplier = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_weight = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_w = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_d = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_h = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) unit_volume = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_unit = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_class = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_brand = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_color = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_shape = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_specs = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_origin = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_cost = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) goods_price = serializers.FloatField(read_only=False, required=True, validators=[datasolve.data_validate]) creater = serializers.CharField(read_only=False, required=True, validators=[datasolve.data_validate]) class Meta: model = ListModel exclude = ['openid', 'is_delete', ] read_only_fields = ['id', 'create_time', 'update_time', ] class GoodsPartialUpdateSerializer(serializers.ModelSerializer): goods_code = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_desc = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_supplier = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_weight = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_w = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_d = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_h = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) unit_volume = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_unit = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_class = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_brand = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_color = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_shape = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_specs = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_origin = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_cost = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) goods_price = serializers.FloatField(read_only=False, required=False, validators=[datasolve.data_validate]) creater = serializers.CharField(read_only=False, required=False, validators=[datasolve.data_validate]) class Meta: model = ListModel exclude = ['openid', 'is_delete', ] read_only_fields = ['id', 'create_time', 'update_time', ] class FileRenderSerializer(serializers.ModelSerializer): goods_code = serializers.CharField(read_only=False, required=False) goods_desc = serializers.CharField(read_only=False, required=False) goods_supplier = serializers.CharField(read_only=False, required=False) goods_weight = serializers.FloatField(read_only=False, required=False) goods_w = serializers.FloatField(read_only=False, required=False) goods_d = serializers.FloatField(read_only=False, required=False) goods_h = serializers.FloatField(read_only=False, required=False) unit_volume = serializers.FloatField(read_only=False, required=False) goods_unit = serializers.CharField(read_only=False, required=False) goods_class = serializers.CharField(read_only=False, required=False) goods_brand = serializers.CharField(read_only=False, required=False) goods_color = serializers.CharField(read_only=False, required=False) goods_shape = serializers.CharField(read_only=False, required=False) goods_specs = serializers.CharField(read_only=False, required=False) goods_origin = serializers.CharField(read_only=False, required=False) goods_cost = serializers.FloatField(read_only=False, required=False) goods_price = serializers.FloatField(read_only=False, required=False) creater = serializers.CharField(read_only=False, required=False) create_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S') update_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S') class Meta: model = ListModel ref_name = 'GOODSFileRenderSerializer' exclude = ['openid', 'is_delete', ]
77.961538
114
0.781056
1,192
10,135
6.422819
0.052852
0.103448
0.123955
0.200235
0.961076
0.961076
0.961076
0.953239
0.825758
0.700627
0
0
0.109916
10,135
129
115
78.565891
0.848686
0
0
0.463415
0
0
0.023286
0.002467
0
0
0
0
0
1
0
false
0
0.02439
0
0.878049
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
8
824bbb77d6fdecb403e6e2d3d18a46a3be4c368b
5,375
py
Python
tests/test_cli.py
Mariatta/arq
7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25
[ "MIT" ]
1
2021-01-03T00:57:38.000Z
2021-01-03T00:57:38.000Z
tests/test_cli.py
Mariatta/arq
7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25
[ "MIT" ]
null
null
null
tests/test_cli.py
Mariatta/arq
7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25
[ "MIT" ]
null
null
null
import re import signal from unittest.mock import MagicMock import pytest from click.testing import CliRunner import arq.worker from arq.cli import cli from .fixtures import EXAMPLE_FILE def test_simple_burst(tmpworkdir, monkeypatch): # we have to prevent RunWorkerProcess actually starting another process # TODO remove after https://bitbucket.org/ned/coveragepy/issues/512 monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'exitcode', 0) tmpworkdir.join('test.py').write(EXAMPLE_FILE) runner = CliRunner() result = runner.invoke(cli, ['--burst', 'test.py']) assert result.exit_code == 0 output = re.sub('\d+:\d+:\d+', 'TIME', result.output) assert output == ('TIME MainProcess: starting work process "WorkProcess"\n' 'TIME MainProcess: worker process exited ok\n') def test_worker_exited_badly(tmpworkdir, monkeypatch): # we have to prevent RunWorkerProcess actually starting another process # TODO remove after https://bitbucket.org/ned/coveragepy/issues/512 monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'exitcode', 42) monkeypatch.setattr(arq.worker.Process, 'pid', 123) tmpworkdir.join('test.py').write(EXAMPLE_FILE) runner = CliRunner() result = runner.invoke(cli, ['--burst', 'test.py']) assert result.exit_code == 3 output = re.sub('\d+:\d+:\d+', 'TIME', result.output) assert ('TIME MainProcess: starting work process "WorkProcess"\n' 'TIME MainProcess: worker process 123 exited badly with exit code 42\n') == output def test_main_process_sigint(tmpworkdir, monkeypatch, caplog): monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'is_alive', MagicMock(return_value=True)) monkeypatch.setattr(arq.worker.Process, 'exitcode', 0) monkeypatch.setattr(arq.worker.Process, 'pid', 123) os_kill = MagicMock() monkeypatch.setattr(arq.worker.os, 'kill', os_kill) tmpworkdir.join('test.py').write(EXAMPLE_FILE) work_runner = arq.worker.RunWorkerProcess('test.py', 'Worker') work_runner.handle_sig(signal.SIGINT, None) assert 'got signal: SIGINT, waiting for worker pid=123 to finish...' in caplog os_kill.assert_called_once_with(123, arq.worker.SIG_PROXY) def test_main_process_sigint_worker_stopped(tmpworkdir, monkeypatch, caplog): monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'is_alive', MagicMock(return_value=False)) monkeypatch.setattr(arq.worker.Process, 'exitcode', 0) monkeypatch.setattr(arq.worker.Process, 'pid', 123) os_kill = MagicMock() monkeypatch.setattr(arq.worker.os, 'kill', os_kill) tmpworkdir.join('test.py').write(EXAMPLE_FILE) work_runner = arq.worker.RunWorkerProcess('test.py', 'Worker') work_runner.handle_sig(signal.SIGINT, None) assert os_kill.called is False def test_main_process_sigint_twice(tmpworkdir, monkeypatch, caplog): monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) is_alive = MagicMock(return_value=False) monkeypatch.setattr(arq.worker.Process, 'is_alive', is_alive) monkeypatch.setattr(arq.worker.Process, 'exitcode', 0) monkeypatch.setattr(arq.worker.Process, 'pid', 123) os_kill = MagicMock() monkeypatch.setattr(arq.worker.os, 'kill', os_kill) tmpworkdir.join('test.py').write(EXAMPLE_FILE) work_runner = arq.worker.RunWorkerProcess('test.py', 'Worker') with pytest.raises(arq.worker.ImmediateExit): work_runner.handle_sig_force(signal.SIGINT, None) assert is_alive.call_count == 1 assert not os_kill.called assert 'got signal: SIGINT again, forcing exit' in caplog def test_main_process_sigint_twice_worker_running(tmpworkdir, monkeypatch, caplog): monkeypatch.setattr(arq.worker.Process, 'start', MagicMock()) monkeypatch.setattr(arq.worker.Process, 'join', MagicMock()) is_alive = MagicMock(return_value=True) monkeypatch.setattr(arq.worker.Process, 'is_alive', is_alive) monkeypatch.setattr(arq.worker.Process, 'exitcode', 0) monkeypatch.setattr(arq.worker.Process, 'pid', 123) os_kill = MagicMock() monkeypatch.setattr(arq.worker.os, 'kill', os_kill) tmpworkdir.join('test.py').write(EXAMPLE_FILE) work_runner = arq.worker.RunWorkerProcess('test.py', 'Worker') with pytest.raises(arq.worker.ImmediateExit): work_runner.handle_sig_force(signal.SIGINT, None) assert is_alive.call_count == 1 os_kill.assert_called_once_with(123, signal.SIGTERM) assert 'got signal: SIGINT again, forcing exit' in caplog def test_check_successful(tmpworkdir, monkeypatch): monkeypatch.setattr(arq.worker.BaseWorker, 'check_health', MagicMock(return_value=0)) tmpworkdir.join('test.py').write(EXAMPLE_FILE) runner = CliRunner() result = runner.invoke(cli, ['--check', 'test.py']) assert result.exit_code == 0, result.output
44.791667
94
0.730419
688
5,375
5.579942
0.159884
0.093774
0.175046
0.225059
0.864027
0.851524
0.838239
0.805418
0.805418
0.805418
0
0.010369
0.138791
5,375
119
95
45.168067
0.818967
0.050419
0
0.638298
0
0
0.138851
0
0
0
0
0.008403
0.148936
1
0.074468
false
0
0.085106
0
0.159574
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
8259854776cdd05879f6596d665b295aa14ae4ca
13,848
py
Python
tests/test_tokenization.py
jingtaozhan/pyserini
1941a2519891eeaef1896bd3457919e561f7f8b1
[ "Apache-2.0" ]
1
2022-02-21T05:14:06.000Z
2022-02-21T05:14:06.000Z
tests/test_tokenization.py
crystina-z/pyserini
3b5bba53f2a1f1875b7404a3521144be9ac94c9c
[ "Apache-2.0" ]
null
null
null
tests/test_tokenization.py
crystina-z/pyserini
3b5bba53f2a1f1875b7404a3521144be9ac94c9c
[ "Apache-2.0" ]
null
null
null
# # Pyserini: Python interface to the Anserini IR toolkit built on Lucene # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from transformers import BertTokenizer, T5Tokenizer, AutoTokenizer import unittest class TestTokenization(unittest.TestCase): def setUp(self): pass def test_bert_base_uncased(self): # https://huggingface.co/transformers/tokenizer_summary.html tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') tokens = tokenizer.tokenize('I have a new GPU!') self.assertEqual(['i', 'have', 'a', 'new', 'gp', '##u', '!'], tokens) def test_bert_base_uncased(self): # These are examples used in the ptr4tr book tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') tokens = tokenizer.tokenize('walking talking balking biking hiking rolling scrolling') self.assertEqual(['walking', 'talking', 'bal', '##king', 'biking', 'hiking', 'rolling', 'scrolling'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['bio', '##sta', '##tist', '##ics'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['ad', '##vers', '##aria', '##l'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-cased') tokens = tokenizer.tokenize('walking talking balking biking hiking') self.assertEqual(['walking', 'talking', 'b', '##alk', '##ing', 'bi', '##king', 'hiking'], tokens) tokens = tokenizer.tokenize('rolling scrolling') self.assertEqual(['rolling', 'scroll', '##ing'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['bio', '##sta', '##tist', '##ics'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['ad', '##vers', '##aria', '##l'], tokens) def test_xlm_roberta_base(self): tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base') tokens = tokenizer.tokenize('walking talking balking biking hiking rolling scrolling') self.assertEqual(['▁walking', '▁talking', '▁bal', 'king', '▁bi', 'king', '▁hi', 'king', '▁roll', 'ing', '▁scroll', 'ing'], tokens) tokens = tokenizer.tokenize('rolling scrolling') self.assertEqual(['▁roll', 'ing', '▁scroll', 'ing'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['▁bio', 'stat', 'istic', 's'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['▁adversari', 'al'], tokens) def test_bert_base_multilingual_en(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') tokens = tokenizer.tokenize('walking talking balking biking hiking rolling scrolling') self.assertEqual(['walking', 'talking', 'bal', '##king', 'bi', '##king', 'hi', '##king', 'rolling', 'sc', '##roll', '##ing'], tokens) tokens = tokenizer.tokenize('rolling scrolling') self.assertEqual(['rolling', 'sc', '##roll', '##ing'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['bio', '##stat', '##istic', '##s'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['ad', '##versari', '##al'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') tokens = tokenizer.tokenize('walking talking balking biking hiking') self.assertEqual(['walking', 'talking', 'bal', '##king', 'bi', '##king', 'hi', '##king'], tokens) tokens = tokenizer.tokenize('rolling scrolling') self.assertEqual(['rolling', 's', '##cro', '##lling'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['bio', '##stati', '##stic', '##s'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['ad', '##versari', '##al'], tokens) def test_bert_base_multilingual_fr(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('marche parler vélo randonnée rouler défilement') self.assertEqual(['marche', 'parler', 'velo', 'rand', '##onne', '##e', 'ro', '##uler', 'def', '##ile', '##ment'], tokens) # rolling scrolling tokens = tokenizer.tokenize('défilement roulant') self.assertEqual(['def', '##ile', '##ment', 'ro', '##ulant'], tokens) # biostatistics tokens = tokenizer.tokenize('biostatistique') self.assertEqual(['bio', '##stat', '##istique'], tokens) # adversarial tokens = tokenizer.tokenize('antagoniste') self.assertEqual(['ant', '##ago', '##niste'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('marche parler vélo randonnée rouler défilement') self.assertEqual(['marche', 'parler', 'v', '##él', '##o', 'rand', '##onnée', 'ro', '##uler', 'dé', '##file', '##ment'], tokens) # rolling scrolling tokens = tokenizer.tokenize('défilement roulant') self.assertEqual(['dé', '##file', '##ment', 'ro', '##ulant'], tokens) # biostatistics tokens = tokenizer.tokenize('biostatistique') self.assertEqual(['bio', '##stati', '##stique'], tokens) # adversarial tokens = tokenizer.tokenize('antagoniste') self.assertEqual(['ant', '##agon', '##iste'], tokens) def test_bert_base_multilingual_zh(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('走路说话骑自行车远足滚动滚动') self.assertEqual(['走', '路', '说', '话', '骑', '自', '行', '车', '远', '足', '滚', '动', '滚', '动'], tokens) # rolling scrolling tokens = tokenizer.tokenize('滚动滚动') self.assertEqual(['滚', '动', '滚', '动'], tokens) # biostatistics tokens = tokenizer.tokenize('生物统计学') self.assertEqual(['生', '物', '统', '计', '学'], tokens) # adversarial tokens = tokenizer.tokenize('对抗的') self.assertEqual(['对', '抗', '的'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('走路说话骑自行车远足滚动滚动') self.assertEqual(['走', '路', '说', '话', '骑', '自', '行', '车', '远', '足', '滚', '动', '滚', '动'], tokens) # rolling scrolling tokens = tokenizer.tokenize('滚动滚动') self.assertEqual(['滚', '动', '滚', '动'], tokens) # biostatistics tokens = tokenizer.tokenize('生物统计学') self.assertEqual(['生', '物', '统', '计', '学'], tokens) # adversarial tokens = tokenizer.tokenize('对抗的') self.assertEqual(['对', '抗', '的'], tokens) def test_bert_base_multilingual_ar(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('المشي الحديث ركوب الدراجات المشي لمسافات طويلة المتداول التمرير') self.assertEqual(['ال', '##م', '##شي', 'الحديث', 'ر', '##كو', '##ب', 'ال', '##در', '##اج', '##ات', 'ال', '##م', '##شي', 'لم', '##سا', '##فات', 'طويلة', 'ال', '##مت', '##دا', '##ول', 'ال', '##تم', '##رير'], tokens) # rolling scrolling tokens = tokenizer.tokenize('المتداول التمرير') self.assertEqual(['ال', '##مت', '##دا', '##ول', 'ال', '##تم', '##رير'], tokens) # biostatistics tokens = tokenizer.tokenize('الإحصاء الحيوي') self.assertEqual(['الاحصاء', 'ال', '##حي', '##وي'], tokens) # adversarial tokens = tokenizer.tokenize('عدائي') self.assertEqual(['ع', '##دا', '##يي'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('المشي الحديث ركوب الدراجات المشي لمسافات طويلة المتداول التمرير') self.assertEqual(['ال', '##م', '##شي', 'الحديث', 'ر', '##كو', '##ب', 'ال', '##در', '##اجات', 'ال', '##م', '##شي', 'لم', '##سا', '##فات', 'طويلة', 'ال', '##مت', '##دا', '##ول', 'ال', '##تم', '##رير'], tokens) # rolling scrolling tokens = tokenizer.tokenize('المتداول التمرير') self.assertEqual(['ال', '##مت', '##دا', '##ول', 'ال', '##تم', '##رير'], tokens) # biostatistics tokens = tokenizer.tokenize('الإحصاء الحيوي') self.assertEqual(['الإحصاء', 'ال', '##حي', '##وي'], tokens) # adversarial tokens = tokenizer.tokenize('عدائي') self.assertEqual(['ع', '##دا', '##ئي'], tokens) def test_bert_base_multilingual_hi(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('चलने की बात करते हुए बाइक चलाना लंबी पैदल यात्रा स्क्रॉल') self.assertEqual(['चल', '##न', 'की', 'बात', 'करत', 'हए', 'ब', '##ा', '##इ', '##क', 'चल', '##ाना', 'ल', '##बी', 'पद', '##ल', 'यातरा', 'सक', '##र', '##ॉल'], tokens) # rolling scrolling tokens = tokenizer.tokenize('रोलिंग स्क्रॉल') self.assertEqual(['र', '##ोल', '##िग', 'सक', '##र', '##ॉल'], tokens) # biostatistics tokens = tokenizer.tokenize('जैव सांख्यिकी') self.assertEqual(['ज', '##व', 'स', '##ा', '##ख', '##यिक', '##ी'], tokens) # adversarial tokens = tokenizer.tokenize('विरोधात्मक') self.assertEqual(['वि', '##रो', '##धा', '##तमक'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('चलने की बात करते हुए बाइक चलाना लंबी पैदल यात्रा स्क्रॉल') self.assertEqual(['च', '##लन', '##े', 'की', 'बात', 'करते', 'हुए', 'ब', '##ा', '##इ', '##क', 'च', '##ला', '##ना', 'ल', '##ं', '##बी', 'प', '##ै', '##दल', 'यात्रा', 'स', '##्क', '##्र', '##ॉल'], tokens) # rolling scrolling tokens = tokenizer.tokenize('रोलिंग स्क्रॉल') self.assertEqual(['र', '##ोल', '##िंग', 'स', '##्क', '##्र', '##ॉल'], tokens) # biostatistics tokens = tokenizer.tokenize('जैव सांख्यिकी') self.assertEqual(['ज', '##ै', '##व', 'स', '##ा', '##ं', '##ख', '##्य', '##िकी'], tokens) # adversarial tokens = tokenizer.tokenize('विरोधात्मक') self.assertEqual(['वि', '##रो', '##धा', '##त्मक'], tokens) def test_bert_base_multilingual_bn(self): tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-uncased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('হাঁটাচলা বাইকিং হাইকিং রোলিং স্ক্রোলিং') self.assertEqual(['হ', '##াট', '##া', '##চ', '##লা', 'বা', '##ই', '##কি', '##ং', 'হ', '##াই', '##কি', '##ং', 'র', '##ো', '##লি', '##ং', 'স', '##কর', '##ো', '##লি', '##ং'], tokens) # rolling scrolling tokens = tokenizer.tokenize('ঘূর্ণায়মান স্ক্রোলিং') self.assertEqual(['ঘর', '##ণা', '##য', '##মান', 'স', '##কর', '##ো', '##লি', '##ং'], tokens) # biostatistics tokens = tokenizer.tokenize('বায়োস্টাটিক্স') self.assertEqual(['বা', '##যে', '##াস', '##টা', '##টি', '##ক', '##স'], tokens) # adversarial tokens = tokenizer.tokenize('প্রতিকূল') self.assertEqual(['পরতি', '##ক', '##ল'], tokens) tokenizer = BertTokenizer.from_pretrained('bert-base-multilingual-cased') # walking talking biking hiking rolling scrolling tokens = tokenizer.tokenize('হাঁটাচলা বাইকিং হাইকিং রোলিং স্ক্রোলিং') self.assertEqual(['হ', '##া', '##ঁ', '##টা', '##চ', '##লা', 'বা', '##ই', '##কি', '##ং', 'হ', '##াই', '##কি', '##ং', 'র', '##োল', '##িং', 'স', '##্ক', '##্র', '##োল', '##িং'], tokens) # rolling scrolling tokens = tokenizer.tokenize('ঘূর্ণায়মান স্ক্রোলিং') self.assertEqual(['ঘ', '##ূর্ণ', '##ায়', '##মান', 'স', '##্ক', '##্র', '##োল', '##িং'], tokens) # biostatistics tokens = tokenizer.tokenize('বায়োস্টাটিক্স') self.assertEqual(['বা', '##য়', '##ো', '##স্ট', '##াট', '##িক', '##্স'], tokens) # adversarial tokens = tokenizer.tokenize('প্রতিকূল') self.assertEqual(['প্রতি', '##ক', '##ূ', '##ল'], tokens) def test_doc2query(self): tokenizer = T5Tokenizer.from_pretrained('castorini/doc2query-t5-base-msmarco') tokens = tokenizer.tokenize('I have a new GPU!') self.assertEqual(['▁I', '▁have', '▁', 'a', '▁new', '▁GPU', '!'], tokens) tokenizer = T5Tokenizer.from_pretrained('castorini/doc2query-t5-base-msmarco') tokens = tokenizer.tokenize('walking talking biking scrolling') self.assertEqual(['▁walking', '▁talking', '▁biking', '▁scroll', 'ing'], tokens) tokens = tokenizer.tokenize('biostatistics') self.assertEqual(['▁bio', 'stat', 'istic', 's'], tokens) tokens = tokenizer.tokenize('adversarial') self.assertEqual(['▁adversar', 'i', 'al'], tokens) def tearDown(self): pass if __name__ == '__main__': unittest.main()
44.670968
221
0.56853
1,799
13,848
4.497499
0.181768
0.133482
0.181931
0.076628
0.856878
0.849092
0.825856
0.810036
0.793103
0.722655
0
0.001181
0.204795
13,848
309
222
44.815534
0.708227
0.11619
0
0.612121
0
0.024242
0.280929
0.034316
0
0
0
0
0.387879
1
0.072727
false
0.012121
0.012121
0
0.090909
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
826d4b078338b76ca5c09b4e457dba1e2d0bdb28
2,075
py
Python
test/functions/decl6.py
Setonas/MagicSetonas
ef76da5f27a0506b194c58072b81424e3ce985d7
[ "MIT" ]
5
2017-02-22T10:17:39.000Z
2021-04-06T16:36:13.000Z
test/functions/decl6.py
Setonas/MagicSetonas
ef76da5f27a0506b194c58072b81424e3ce985d7
[ "MIT" ]
null
null
null
test/functions/decl6.py
Setonas/MagicSetonas
ef76da5f27a0506b194c58072b81424e3ce985d7
[ "MIT" ]
1
2020-08-29T02:30:52.000Z
2020-08-29T02:30:52.000Z
apibrėžti Tiesa(): pereiti apibrėžti Joks(): pereiti apibrėžti Netikras(): pereiti apibrėžti : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python Tiesa : keyword.illegal.name.python, meta.function.python, source.python ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python : : meta.function.python, punctuation.section.function.begin.python, source.python : source.python pereiti : keyword.control.flow.python, source.python apibrėžti : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python Joks : keyword.illegal.name.python, meta.function.python, source.python ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python : : meta.function.python, punctuation.section.function.begin.python, source.python : source.python pereiti : keyword.control.flow.python, source.python apibrėžti : meta.function.python, source.python, storage.type.function.python : meta.function.python, source.python Netikras : keyword.illegal.name.python, meta.function.python, source.python ( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python ) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python : : meta.function.python, punctuation.section.function.begin.python, source.python : source.python pereiti : keyword.control.flow.python, source.python
66.935484
132
0.716145
225
2,075
6.604444
0.097778
0.193809
0.290713
0.242261
0.944818
0.944818
0.944818
0.944818
0.944818
0.944818
0
0
0.175422
2,075
30
133
69.166667
0.868498
0
0
0.777778
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
10
828133306abfd96c413c736f0a8cd03c128d692e
6,224
py
Python
python/testData/inspections/PyPropertyDefinitionInspection26/test.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyPropertyDefinitionInspection26/test.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyPropertyDefinitionInspection26/test.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
import abc class A(object): def __init__(self): self._x = 1 @property def foo(self): return self._x @foo.setter def foo(self, x): self._x = x @foo.deleter def foo(self): pass @property def boo(self): return self._x <warning descr="Names of function and decorator don't match; property accessor is not created">@boo.setter</warning> def boo1(self, x): self._x = x <warning descr="Names of function and decorator don't match; property accessor is not created">@boo.deleter</warning> def boo2(self): pass @property def <warning descr="Getter should return or yield something">moo</warning>(self): pass @moo.setter def <warning descr="Setter should not return a value">moo</warning>(self, x): return 1 @moo.deleter def <warning descr="Deleter should not return a value">moo</warning>(self): return self._x @qoo.setter # unknown qoo is reported in ref inspection def qoo(self, v): self._x = v @property def futuroo(self): raise NotImplementedError("Override!") # ok though no return @property def futuroo(self): """Docstring.""" raise NotImplementedError("Override!") # ok though no return @property def xoo(self): return self._x @xoo.setter def xoo(self, x): self._x = x return get_foo2 = lambda self: 'foo2' foo2 = property(get_foo2) @property @abc.abstractproperty def abstract_property(self): pass # PY-19701 class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): def inner_func(n): return n self._myprop = inner_func(val) myprop = property(get_myprop, set_myprop) # all flows have exit point class Test(object): def __init__(self): self._myprop = None def get_myprop(self): if a > b: <error descr="Python versions < 3.3 do not allow 'return' with argument inside generator.">return self._myprop</error> elif a < b: raise self._myprop else: yield self._myprop myprop = property(get_myprop) # some flows have not exit point class Test(object): def __init__(self): self._myprop = None def get_myprop(self): if a > b: return self._myprop elif a < b: raise self._myprop myprop = property(get_myprop) # some flows have not exit point class Test(object): def __init__(self): self._myprop = None def get_myprop(self): if a > b: return self._myprop myprop = property(get_myprop) # non-empty for class Test(object): def __init__(self): self._myprop = None def get_myprop(self): for i in range(5): yield i myprop = property(get_myprop) # empty for class Test(object): def __init__(self): self._myprop = None def get_myprop(self): for i in []: yield i myprop = property(get_myprop) # shouldn't pass with better analysis, pass at the moment # non-empty while class Test(object): def __init__(self): self._myprop = None def get_myprop(self): i = 0 while i < 5: yield i i += 1 myprop = property(get_myprop) # empty while class Test(object): def __init__(self): self._myprop = None def get_myprop(self): while undefined: yield i myprop = property(get_myprop) # shouldn't pass with better analysis, pass at the moment # non-empty while with two conditions class Test(object): def __init__(self): self._myprop = None def get_myprop(self): i = 0 j = 0 while i < 5 and j == 0: yield i i += 1 myprop = property(get_myprop) # empty while with two conditions class Test(object): def __init__(self): self._myprop = None def get_myprop(self): i = 0 j = 0 while i > 5 and j == 0: yield i myprop = property(get_myprop) # shouldn't pass with better analysis, pass at the moment # setter has exit point class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val return 10 myprop = property(get_myprop, <warning descr="Setter should not return a value">set_myprop</warning>) # setter has exit point class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val yield 10 myprop = property(get_myprop, <warning descr="Setter should not return a value">set_myprop</warning>) # setter has raise statement class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val raise NotImplementedError() myprop = property(get_myprop, set_myprop) # setter has exit point in some flow class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val if a > b: return 10 myprop = property(get_myprop, <warning descr="Setter should not return a value">set_myprop</warning>) # setter has exit point in some flow class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val if a > b: yield 10 myprop = property(get_myprop, <warning descr="Setter should not return a value">set_myprop</warning>) # setter has raise statement in some flow class Test(object): def __init__(self): self._myprop = None def get_myprop(self): return self._myprop def set_myprop(self, val): self._myprop = val if a > b: raise NotImplementedError() myprop = property(get_myprop, set_myprop)
20.473684
130
0.619055
839
6,224
4.396901
0.134684
0.097587
0.059908
0.078341
0.803199
0.788832
0.757387
0.757387
0.703172
0.671185
0
0.008125
0.288078
6,224
303
131
20.541254
0.824419
0.103952
0
0.795918
0
0
0.087216
0
0
0
0
0
0
0
null
null
0.020408
0.005102
null
null
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
8285f02c01d430ca10a9e2f5d9aa6f2ce6935815
59,377
py
Python
tests/pydevtest/test_iadmin.py
wtsi-npg/irods
05ff1d20e7d991912c7822f981888e91899118e7
[ "BSD-3-Clause" ]
null
null
null
tests/pydevtest/test_iadmin.py
wtsi-npg/irods
05ff1d20e7d991912c7822f981888e91899118e7
[ "BSD-3-Clause" ]
null
null
null
tests/pydevtest/test_iadmin.py
wtsi-npg/irods
05ff1d20e7d991912c7822f981888e91899118e7
[ "BSD-3-Clause" ]
1
2015-02-19T18:30:33.000Z
2015-02-19T18:30:33.000Z
import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import commands import getpass import imp import json import os import shutil import socket import stat import subprocess import time import configuration import lib import resource_suite # path to server_config.py pydevtestdir = os.path.dirname(os.path.realpath(__file__)) topdir = os.path.dirname(os.path.dirname(pydevtestdir)) packagingdir = os.path.join(topdir, 'packaging') module_tuple = imp.find_module('server_config', [packagingdir]) imp.load_module('server_config', *module_tuple) from server_config import ServerConfig def write_host_access_control(filename, username, group, address, mask): add_ent = { 'user': username, 'group': group, 'address': address, 'mask': mask, } address_entries = [add_ent] hac = {'access_entries': address_entries} with open(filename, 'w') as f: json.dump(hac, f, sort_keys=True, indent=4, ensure_ascii=False) class Test_Iadmin(resource_suite.ResourceBase, unittest.TestCase): def setUp(self): super(Test_Iadmin, self).setUp() def tearDown(self): super(Test_Iadmin, self).tearDown() def test_api_plugin(self): self.admin.assert_icommand("iapitest", 'STDOUT_SINGLELINE', 'this') assert 0 < lib.count_occurrences_of_string_in_log('server', 'HELLO WORLD') ################### # iadmin ################### # PASSWORDS def test_iadmin_scrambling_and_descrambling(self): # spass self.admin.assert_icommand("iadmin spass gibberish 456", 'STDOUT_SINGLELINE', 'Scrambled form is:VMd96$wwJ') self.admin.assert_icommand("iadmin spass '-startswithhyphen' 123", 'STDERR_SINGLELINE', 'parseCmdLineOpt: Option not supported.') self.admin.assert_icommand("iadmin -- spass '-startswithhyphen' 123", 'STDOUT_SINGLELINE', 'Scrambled form is:9u&sabM*+#ht+ahb!') # dspass self.admin.assert_icommand("iadmin dspass VMd96$wwJ 456", 'STDOUT_SINGLELINE', 'Unscrambled form is:gibberish') self.admin.assert_icommand("iadmin dspass '-startswithhyphen' 123", 'STDERR_SINGLELINE', 'parseCmdLineOpt: Option not supported.') self.admin.assert_icommand("iadmin -- dspass '-startswithhyphen' 123", 'STDOUT_SINGLELINE', 'Unscrambled form is:!qhI),9jGkhVm%hha') # LISTS def test_list_zones(self): self.admin.assert_icommand("iadmin lz", 'STDOUT_SINGLELINE', self.admin.zone_name) self.admin.assert_icommand("iadmin lz notazone", 'STDOUT_SINGLELINE', "No rows found") def test_list_resources(self): self.admin.assert_icommand("iadmin lr", 'STDOUT_SINGLELINE', self.testresc) self.admin.assert_icommand("iadmin lr notaresource", 'STDOUT_SINGLELINE', "No rows found") def test_list_users(self): self.admin.assert_icommand("iadmin lu", 'STDOUT_SINGLELINE', [self.admin.username + "#" + self.admin.zone_name]) self.admin.assert_icommand("iadmin lu notauser", 'STDOUT_SINGLELINE', "No rows found") def test_list_groups(self): group_name = 'test_group' lib.mkgroup_and_add_users(group_name, [self.admin.username, self.user0.username]) self.admin.assert_icommand('iadmin lg', 'STDOUT_SINGLELINE', group_name) self.admin.assert_icommand_fail('iadmin lg', 'STDOUT_SINGLELINE', 'notagroup') self.admin.assert_icommand('iadmin lg ' + group_name, 'STDOUT_SINGLELINE', self.user0.username) self.admin.assert_icommand_fail('iadmin lg ' + group_name, 'STDOUT_SINGLELINE', 'notauser') lib.rmgroup(group_name) # RESOURCES def test_resource_name_restrictions(self): h = lib.get_hostname() oversize_name = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" # longer than NAME_LEN self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("?/=*", h, "junk"), 'STDERR_SINGLELINE', "SYS_INVALID_INPUT_PARAM") # invalid char self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("replication.B", h, "junk"), 'STDERR_SINGLELINE', "SYS_INVALID_INPUT_PARAM") # invalid char self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("replication{", h, "junk"), 'STDERR_SINGLELINE', "SYS_INVALID_INPUT_PARAM") # invalid char self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % (oversize_name, h, "junk"), 'STDERR_SINGLELINE', "SYS_INVALID_INPUT_PARAM") # too long def test_modify_resource_name(self): h = lib.get_hostname() # tree standup self.admin.assert_icommand("iadmin mkresc %s passthru %s:/tmp/irods/pydevtest_%s" % ("pt1", h, "pt1"), 'STDOUT_SINGLELINE', "Creating") # passthru self.admin.assert_icommand("iadmin mkresc %s replication %s:/tmp/irods/pydevtest_%s" % ("repl", h, "repl"), 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unix1", h, "unix1"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc %s passthru %s:/tmp/irods/pydevtest_%s" % ("pt2", h, "pt2"), 'STDOUT_SINGLELINE', "Creating") # passthru self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unix2", h, "unix2"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("pt1", "repl")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("repl", "unix1")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("repl", "pt2")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("pt2", "unix2")) # rename repl node newnodename = "replwithmoreletters" self.admin.assert_icommand("iadmin modresc %s name %s" % ("repl", newnodename), 'STDOUT_SINGLELINE', 'OK, performing the resource rename', stdin_string='yes\n') # confirm children of pt1 is newnodename self.admin.assert_icommand("iadmin lr %s" % "pt1", 'STDOUT_SINGLELINE', "resc_children: %s" % newnodename + "{}") # confirm parent of newnodename is still pt1 self.admin.assert_icommand("iadmin lr %s" % newnodename, 'STDOUT_SINGLELINE', "resc_parent: %s" % "pt1") # confirm children of newnodename is unix1 and pt2 self.admin.assert_icommand("iadmin lr %s" % newnodename, 'STDOUT_SINGLELINE', "resc_children: %s" % "unix1{};pt2{}") # confirm parent of pt2 is newnodename self.admin.assert_icommand("iadmin lr %s" % "pt2", 'STDOUT_SINGLELINE', "resc_parent: %s" % newnodename) # confirm parent of unix2 is pt2 self.admin.assert_icommand("iadmin lr %s" % "unix2", 'STDOUT_SINGLELINE', "resc_parent: %s" % "pt2") # confirm parent of unix1 is newnodename self.admin.assert_icommand("iadmin lr %s" % "unix1", 'STDOUT_SINGLELINE', "resc_parent: %s" % newnodename) # tree teardown self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("pt2", "unix2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % (newnodename, "unix1")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % (newnodename, "pt2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("pt1", newnodename)) self.admin.assert_icommand("iadmin rmresc %s" % "unix2") self.admin.assert_icommand("iadmin rmresc %s" % "unix1") self.admin.assert_icommand("iadmin rmresc %s" % "pt2") self.admin.assert_icommand("iadmin rmresc %s" % newnodename) self.admin.assert_icommand("iadmin rmresc %s" % "pt1") def test_resource_hierarchy_errors(self): # prep self.admin.assert_icommand("iadmin mkresc %s passthru" % ("pt"), 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc %s passthru" % ("the_child"), 'STDOUT_SINGLELINE', "Creating") # bad parent self.admin.assert_icommand("iadmin addchildtoresc non_existent_resource %s" % ("pt"), 'STDERR_SINGLELINE', "CAT_INVALID_RESOURCE") # bad child self.admin.assert_icommand("iadmin addchildtoresc %s non_existent_resource" % ("pt"), 'STDERR_SINGLELINE', "CHILD_NOT_FOUND") # duplicate parent self.admin.assert_icommand("iadmin addchildtoresc pt the_child") self.admin.assert_icommand("iadmin addchildtoresc pt the_child", 'STDERR_SINGLELINE', "CHILD_HAS_PARENT") # cleanup self.admin.assert_icommand("iadmin rmchildfromresc pt the_child") self.admin.assert_icommand("iadmin rmresc the_child") self.admin.assert_icommand("iadmin rmresc pt") def test_resource_hierarchy_manipulation(self): h = lib.get_hostname() # first tree standup self.admin.assert_icommand("iadmin mkresc %s passthru" % ("pt"), 'STDOUT_SINGLELINE', "Creating") # passthru self.admin.assert_icommand("iadmin mkresc %s replication" % ("replA"), 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixA1", h, "unixA1"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixA2", h, "unixA2"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("pt", "replA")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "unixA1")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "unixA2")) # second tree standup self.admin.assert_icommand("iadmin mkresc %s replication" % ("replB"), 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixB1", h, "unixB1"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixB2", h, "unixB2"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replB", "unixB1")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replB", "unixB2")) # create some files dir1 = "for_pt" dir2 = "for_replB" tree1 = 5 tree2 = 8 doubletree1 = 2 * tree1 # 10 doubletree2 = 2 * tree2 # 16 totaltree = doubletree1 + doubletree2 # 26 lib.create_directory_of_small_files(dir1, tree1) lib.create_directory_of_small_files(dir2, tree2) # add files self.admin.assert_icommand("iput -R %s -r %s" % ("pt", dir1)) self.admin.assert_icommand("iput -R %s -r %s" % ("replB", dir2)) # debugging self.admin.assert_icommand("ils -L %s" % dir1, 'STDOUT_SINGLELINE', dir1) self.admin.assert_icommand("ils -L %s" % dir2, 'STDOUT_SINGLELINE', dir2) # add tree2 to tree1 # add replB to replA self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "replB")) # debugging self.admin.assert_icommand("ils -L %s" % dir1, 'STDOUT_SINGLELINE', dir1) self.admin.assert_icommand("ils -L %s" % dir2, 'STDOUT_SINGLELINE', dir2) # check object_count on pt self.admin.assert_icommand("iadmin lr %s" % "pt", 'STDOUT_SINGLELINE', "resc_objcount: %d" % totaltree) # check object_count and children on replA self.admin.assert_icommand("iadmin lr %s" % "replA", 'STDOUT_SINGLELINE', "resc_objcount: %d" % totaltree) self.admin.assert_icommand("iadmin lr %s" % "replA", 'STDOUT_SINGLELINE', "resc_children: %s" % "unixA1{};unixA2{};replB{}") # check object_count on unixA1 self.admin.assert_icommand("iadmin lr %s" % "unixA1", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree1) # check object_count on unixA2 self.admin.assert_icommand("iadmin lr %s" % "unixA2", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree1) # check object_count and parent on replB self.admin.assert_icommand("iadmin lr %s" % "replB", 'STDOUT_SINGLELINE', "resc_objcount: %d" % doubletree2) self.admin.assert_icommand("iadmin lr %s" % "replB", 'STDOUT_SINGLELINE', "resc_parent: %s" % "replA") # check object_count on unixB1 self.admin.assert_icommand("iadmin lr %s" % "unixB1", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree2) # check object_count on unixB2 self.admin.assert_icommand("iadmin lr %s" % "unixB2", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree2) # check resc_hier on replB files, should have full hierarchy, and should NOT start with replB self.admin.assert_icommand("iquest \"select DATA_RESC_HIER where DATA_RESC_HIER like '%s;%%'\"" % "pt;replA;replB", 'STDOUT_SINGLELINE', "pt") self.admin.assert_icommand("iquest \"select DATA_RESC_HIER where DATA_RESC_HIER like '%s;%%'\"" % "replB", 'STDOUT_SINGLELINE', "CAT_NO_ROWS_FOUND") # check resc_name on replB files self.admin.assert_icommand("iquest \"select DATA_RESC_NAME where DATA_RESC_HIER like '%s;%%'\"" % "pt;replA;replB", 'STDOUT_SINGLELINE', "pt") self.admin.assert_icommand("iquest \"select DATA_RESC_NAME where DATA_RESC_HIER like '%s;%%'\"" % "replB", 'STDOUT_SINGLELINE', "CAT_NO_ROWS_FOUND") # remove child # rm replB from replA self.admin.assert_icommand("iadmin lr %s" % "replA", 'STDOUT_SINGLELINE', "replB") # debugging self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "replB")) # check object_count on pt self.admin.assert_icommand("iadmin lr %s" % "pt", 'STDOUT_SINGLELINE', "resc_objcount: %d" % doubletree1) # check object_count on replA self.admin.assert_icommand("iadmin lr %s" % "replA", 'STDOUT_SINGLELINE', "resc_objcount: %d" % doubletree1) # check object_count on unixA1 self.admin.assert_icommand("iadmin lr %s" % "unixA1", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree1) # check object_count on unixA2 self.admin.assert_icommand("iadmin lr %s" % "unixA2", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree1) # check object_count on replB self.admin.assert_icommand("iadmin lr %s" % "replB", 'STDOUT_SINGLELINE', "resc_objcount: %d" % doubletree2) # check object_count on unixB1 self.admin.assert_icommand("iadmin lr %s" % "unixB1", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree2) # check object_count on unixB2 self.admin.assert_icommand("iadmin lr %s" % "unixB2", 'STDOUT_SINGLELINE', "resc_objcount: %d" % tree2) # check resc_hier on replB files, should start with replB and not have pt anymore self.admin.assert_icommand("iquest \"select DATA_RESC_HIER where DATA_RESC_HIER like '%s;%%'\"" % "replB", 'STDOUT_SINGLELINE', "replB") # check resc_name on replB files self.admin.assert_icommand("iquest \"select DATA_RESC_NAME where DATA_RESC_HIER like '%s;%%'\"" % "replB", 'STDOUT_SINGLELINE', "replB") # delete files self.admin.assert_icommand("irm -rf %s" % dir1) self.admin.assert_icommand("irm -rf %s" % dir2) # local cleanup shutil.rmtree(dir1) shutil.rmtree(dir2) # second tree teardown self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replB", "unixB2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replB", "unixB1")) self.admin.assert_icommand("iadmin rmresc %s" % "unixB2") self.admin.assert_icommand("iadmin rmresc %s" % "unixB1") self.admin.assert_icommand("iadmin rmresc %s" % "replB") # first tree teardown self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "unixA2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "unixA1")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("pt", "replA")) self.admin.assert_icommand("iadmin rmresc %s" % "unixA2") self.admin.assert_icommand("iadmin rmresc %s" % "unixA1") self.admin.assert_icommand("iadmin rmresc %s" % "replA") self.admin.assert_icommand("iadmin rmresc %s" % "pt") def test_create_and_remove_unixfilesystem_resource(self): testresc1 = "testResc1" self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should not be listed output = commands.getstatusoutput("hostname") hostname = output[1] self.admin.assert_icommand("iadmin mkresc " + testresc1 + " unixfilesystem " + hostname + ":/tmp/irods/pydevtest_" + testresc1, 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be listed self.admin.assert_icommand_fail("iadmin rmresc notaresource") # bad remove self.admin.assert_icommand("iadmin rmresc " + testresc1) # good remove self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be gone def test_create_and_remove_unixfilesystem_resource_without_spaces(self): testresc1 = "testResc1" self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should not be listed output = commands.getstatusoutput("hostname") hostname = output[1] self.admin.assert_icommand("iadmin mkresc " + testresc1 + " unixfilesystem " + hostname + ":/tmp/irods/pydevtest_" + testresc1, 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be listed self.admin.assert_icommand("iadmin rmresc " + testresc1) # good remove self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be gone def test_create_and_remove_coordinating_resource(self): testresc1 = "testResc1" self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should not be listed output = commands.getstatusoutput("hostname") hostname = output[1] self.admin.assert_icommand("iadmin mkresc " + testresc1 + " replication", 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be listed # should have empty host self.admin.assert_icommand("iadmin lr " + testresc1, 'STDOUT_SINGLELINE', ["resc_net", "EMPTY_RESC_HOST"]) # should have empty path self.admin.assert_icommand("iadmin lr " + testresc1, 'STDOUT_SINGLELINE', ["resc_def_path", "EMPTY_RESC_PATH"]) self.admin.assert_icommand("iadmin rmresc " + testresc1) # good remove self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be gone def test_create_and_remove_coordinating_resource_with_explicit_contextstring(self): testresc1 = "testResc1" self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should not be listed output = commands.getstatusoutput("hostname") hostname = output[1] self.admin.assert_icommand("iadmin mkresc " + testresc1 + " replication '' Context:String", 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be listed # should have empty host self.admin.assert_icommand("iadmin lr " + testresc1, 'STDOUT_SINGLELINE', ["resc_net", "EMPTY_RESC_HOST"]) # should have empty path self.admin.assert_icommand("iadmin lr " + testresc1, 'STDOUT_SINGLELINE', ["resc_def_path", "EMPTY_RESC_PATH"]) # should have contextstring self.admin.assert_icommand("iadmin lr " + testresc1, 'STDOUT_SINGLELINE', ["resc_context", "Context:String"]) self.admin.assert_icommand("iadmin rmresc " + testresc1) # good remove self.admin.assert_icommand_fail("iadmin lr", 'STDOUT_SINGLELINE', testresc1) # should be gone def test_modify_resource_comment(self): mycomment = "thisisacomment with some spaces" self.admin.assert_icommand_fail("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) self.admin.assert_icommand("iadmin modresc " + self.testresc + " comment '" + mycomment + "'") self.admin.assert_icommand("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) self.admin.assert_icommand("iadmin modresc " + self.testresc + " comment 'none'") self.admin.assert_icommand_fail("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) def test_create_and_remove_new_user(self): testuser1 = "testaddandremoveuser" # should not be listed self.admin.assert_icommand_fail("iadmin lu", 'STDOUT_SINGLELINE', [testuser1 + "#" + self.admin.zone_name]) self.admin.assert_icommand("iadmin mkuser " + testuser1 + " rodsuser") # add rodsuser # should be listed self.admin.assert_icommand("iadmin lu", 'STDOUT_SINGLELINE', [testuser1 + "#" + self.admin.zone_name]) self.admin.assert_icommand_fail("iadmin rmuser notauser") # bad remove self.admin.assert_icommand("iadmin rmuser " + testuser1) # good remove # should be gone self.admin.assert_icommand_fail("iadmin lu", 'STDOUT_SINGLELINE', [testuser1 + "#" + self.admin.zone_name]) def test_iadmin_mkuser(self): # A few examples of valid and invalid usernames valid = ['bo', 'bob', 'jim-bob', 'boB', '123.456', 'user@email', 'u@e', 'user.@.email', '___haysoos___'] invalid = ['#', '.', '..', '<bob>', '________________________________longer_than_NAME_LEN________________________________________________'] # Test valid names for name in valid: self.admin.assert_icommand("iadmin mkuser " + name + " rodsuser") # should be accepted # should be listed self.admin.assert_icommand("iadmin lu", 'STDOUT_SINGLELINE', [name + "#" + self.admin.zone_name]) self.admin.assert_icommand("iadmin rmuser " + name) # remove user # should be gone self.admin.assert_icommand_fail("iadmin lu", 'STDOUT_SINGLELINE', [name + "#" + self.admin.zone_name]) # Test invalid names for name in invalid: self.admin.assert_icommand("iadmin mkuser " + name + " rodsuser", 'STDERR_SINGLELINE', "Invalid username format") # should be rejected # Invalid names with special characters self.admin.assert_icommand(r"iadmin mkuser hawai\'i rodsuser", 'STDERR_SINGLELINE', "Invalid username format") # should be rejected self.admin.assert_icommand(r"iadmin mkuser \\\/\!\*\?\|\$ rodsuser", 'STDERR_SINGLELINE', "Invalid username format") # should be rejected # =-=-=-=-=-=-=- # REBALANCE @unittest.skipIf(configuration.TOPOLOGY_FROM_RESOURCE_SERVER, "Skip for topology testing from resource server") def test_rebalance_for_object_count(self): # =-=-=-=-=-=-=- # read server_config.json and .odbc.ini cfg = ServerConfig() root_dir = "/tmp/irods/big_dir" if os.path.exists(root_dir): shutil.rmtree(root_dir) os.makedirs(root_dir) for i in range(30): path = root_dir + "/rebalance_testfile_" + str(i) output = commands.getstatusoutput('dd if=/dev/zero of=' + path + ' bs=1M count=1') print output[1] assert output[0] == 0, "dd did not successfully exit" # get initial object count initial_output = self.admin.run_icommand('iadmin lr demoResc')[1] objcount_line = initial_output.splitlines()[-1] initial_objcount = int(objcount_line.split(":")[-1].strip()) print "initial: " + str(initial_objcount) # put the new files self.admin.assert_icommand("iput -r " + root_dir) # =-=-=-=-=-=-=- # drop several rows from the R_DATA_MAIN table to jkjjq:q cfg.exec_sql_cmd("delete from R_DATA_MAIN where data_name like 'rebalance_testfile_1%'") # rebalance self.admin.assert_icommand("iadmin modresc demoResc rebalance") # expected object count expected_objcount = initial_objcount + 19 # 19 = 30 initial - 11 (1 and 10 through 19) deleted files print "expected: " + str(expected_objcount) self.admin.assert_icommand("iadmin lr demoResc", 'STDOUT_SINGLELINE', "resc_objcount: " + str(expected_objcount)) def test_rebalance_for_repl_node(self): output = commands.getstatusoutput("hostname") hostname = output[1] # =-=-=-=-=-=-=- # STANDUP self.admin.assert_icommand("iadmin mkresc pt passthru", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc pt_b passthru", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc pt_c1 passthru", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc pt_c2 passthru", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc repl replication", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc leaf_a unixfilesystem " + hostname + ":/tmp/irods/pydevtest_leaf_a", 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc leaf_b unixfilesystem " + hostname + ":/tmp/irods/pydevtest_leaf_b", 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc leaf_c unixfilesystem " + hostname + ":/tmp/irods/pydevtest_leaf_c", 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc pt repl") self.admin.assert_icommand("iadmin addchildtoresc repl leaf_a") self.admin.assert_icommand("iadmin addchildtoresc repl pt_b") self.admin.assert_icommand("iadmin addchildtoresc repl pt_c1") self.admin.assert_icommand("iadmin addchildtoresc pt_b leaf_b") self.admin.assert_icommand("iadmin addchildtoresc pt_c1 pt_c2") self.admin.assert_icommand("iadmin addchildtoresc pt_c2 leaf_c") # =-=-=-=-=-=-=- # place data into the resource test_file = "iput_test_file" lib.make_file(test_file, 10) num_children = 11 for i in range(num_children): self.admin.assert_icommand("iput -R pt %s foo%d" % (test_file, i)) # =-=-=-=-=-=-=- # surgically trim repls so we can rebalance self.admin.assert_icommand("itrim -N1 -n 0 foo0 foo3 foo5 foo6 foo7 foo8") self.admin.assert_icommand("itrim -N1 -n 1 foo1 foo3 foo4 foo9") self.admin.assert_icommand("itrim -N1 -n 2 foo2 foo4 foo5") # =-=-=-=-=-=-=- # visualize our pruning self.admin.assert_icommand("ils -AL", 'STDOUT_SINGLELINE', "foo") # =-=-=-=-=-=-=- # call rebalance function - the thing were actually testing... finally. self.admin.assert_icommand("iadmin modresc pt rebalance") # =-=-=-=-=-=-=- # assert that all the appropriate repl numbers exist for all the children self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 1 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 2 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 3 ", " foo0"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 0 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 2 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 3 ", " foo1"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 0 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 1 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 2 ", " foo2"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 2 ", " foo3"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 3 ", " foo3"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 4 ", " foo3"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 0 ", " foo4"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 1 ", " foo4"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 2 ", " foo4"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 1 ", " foo5"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 2 ", " foo5"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 3 ", " foo5"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 1 ", " foo6"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 2 ", " foo6"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 3 ", " foo6"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 1 ", " foo7"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 2 ", " foo7"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 3 ", " foo7"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 1 ", " foo8"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 2 ", " foo8"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 3 ", " foo8"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 0 ", " foo9"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 2 ", " foo9"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 3 ", " foo9"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 0 ", " foo10"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 1 ", " foo10"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 2 ", " foo10"]) # =-=-=-=-=-=-=- # TEARDOWN for i in range(num_children): self.admin.assert_icommand("irm -f foo%d" % i) self.admin.assert_icommand("iadmin rmchildfromresc pt_c2 leaf_c") self.admin.assert_icommand("iadmin rmchildfromresc repl leaf_a") self.admin.assert_icommand("iadmin rmchildfromresc pt_b leaf_b") self.admin.assert_icommand("iadmin rmchildfromresc pt_c1 pt_c2") self.admin.assert_icommand("iadmin rmchildfromresc repl pt_c1") self.admin.assert_icommand("iadmin rmchildfromresc repl pt_b") self.admin.assert_icommand("iadmin rmchildfromresc pt repl") self.admin.assert_icommand("iadmin rmresc leaf_c") self.admin.assert_icommand("iadmin rmresc leaf_b") self.admin.assert_icommand("iadmin rmresc leaf_a") self.admin.assert_icommand("iadmin rmresc pt_c2") self.admin.assert_icommand("iadmin rmresc pt_c1") self.admin.assert_icommand("iadmin rmresc pt_b") self.admin.assert_icommand("iadmin rmresc repl") self.admin.assert_icommand("iadmin rmresc pt") def test_rebalance_for_repl_in_repl_node(self): output = commands.getstatusoutput("hostname") # =-=-=-=-=-=-=- # STANDUP h = lib.get_hostname() # first tree standup self.admin.assert_icommand("iadmin mkresc %s passthru %s:/tmp/irods/pydevtest_%s" % ("pt", h, "pt"), 'STDOUT_SINGLELINE', "Creating") # passthru self.admin.assert_icommand("iadmin mkresc %s replication %s:/tmp/irods/pydevtest_%s" % ("replA", h, "replA"), 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixA1", h, "unixA1"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixA2", h, "unixA2"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("pt", "replA")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "unixA1")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "unixA2")) # second tree standup self.admin.assert_icommand("iadmin mkresc %s replication %s:/tmp/irods/pydevtest_%s" % ("replB", h, "replB"), 'STDOUT_SINGLELINE', "Creating") # replication self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixB1", h, "unixB1"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc %s unixfilesystem %s:/tmp/irods/pydevtest_%s" % ("unixB2", h, "unixB2"), 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replB", "unixB1")) self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replB", "unixB2")) # wire the repls together self.admin.assert_icommand("iadmin addchildtoresc %s %s" % ("replA", "replB")) # =-=-=-=-=-=-=- # place data into the resource test_file = "iput_test_file" lib.make_file(test_file, 10) num_children = 11 for i in range(num_children): self.admin.assert_icommand("iput -R pt %s foo%d" % (test_file, i)) # =-=-=-=-=-=-=- # visualize our replication self.admin.assert_icommand("ils -AL", 'STDOUT_SINGLELINE', "foo") # =-=-=-=-=-=-=- # surgically trim repls so we can rebalance self.admin.assert_icommand("itrim -N1 -n 0 foo0 foo3 foo5 foo6 foo7 foo8") self.admin.assert_icommand("itrim -N1 -n 1 foo1 foo3 foo4 foo9") self.admin.assert_icommand("itrim -N1 -n 2 foo2 foo4 foo5") # =-=-=-=-=-=-=- # dirty up a foo10 repl to ensure that code path is tested also self.admin.assert_icommand("iadmin modresc unixA2 status down") self.admin.assert_icommand("iput -fR pt test_all_rules.py foo10") self.admin.assert_icommand("iadmin modresc unixA2 status up") # =-=-=-=-=-=-=- # visualize our pruning self.admin.assert_icommand("ils -AL", 'STDOUT_SINGLELINE', "foo") # =-=-=-=-=-=-=- # call rebalance function - the thing were actually testing... finally. self.admin.assert_icommand("iadmin modresc pt rebalance") # =-=-=-=-=-=-=- # visualize our rebalance self.admin.assert_icommand("ils -AL", 'STDOUT_SINGLELINE', "foo") # =-=-=-=-=-=-=- # assert that all the appropriate repl numbers exist for all the children self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 1 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 2 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 3 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 4 ", " foo0"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 0 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 2 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 3 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 4 ", " foo1"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 0 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 1 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 3 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 4 ", " foo2"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 2 ", " foo3"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 3 ", " foo3"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 4 ", " foo3"]) self.admin.assert_icommand("ils -AL foo3", 'STDOUT_SINGLELINE', [" 5 ", " foo3"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 0 ", " foo4"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 3 ", " foo4"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 4 ", " foo4"]) self.admin.assert_icommand("ils -AL foo4", 'STDOUT_SINGLELINE', [" 5 ", " foo4"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 1 ", " foo5"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 3 ", " foo5"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 4 ", " foo5"]) self.admin.assert_icommand("ils -AL foo5", 'STDOUT_SINGLELINE', [" 5 ", " foo5"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 1 ", " foo6"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 2 ", " foo6"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 3 ", " foo6"]) self.admin.assert_icommand("ils -AL foo6", 'STDOUT_SINGLELINE', [" 4 ", " foo6"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 1 ", " foo7"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 2 ", " foo7"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 3 ", " foo7"]) self.admin.assert_icommand("ils -AL foo7", 'STDOUT_SINGLELINE', [" 4 ", " foo7"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 1 ", " foo8"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 2 ", " foo8"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 3 ", " foo8"]) self.admin.assert_icommand("ils -AL foo8", 'STDOUT_SINGLELINE', [" 4 ", " foo8"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 0 ", " foo9"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 2 ", " foo9"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 3 ", " foo9"]) self.admin.assert_icommand("ils -AL foo9", 'STDOUT_SINGLELINE', [" 4 ", " foo9"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 0 ", " & ", " foo10"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 1 ", " & ", " foo10"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 2 ", " & ", " foo10"]) self.admin.assert_icommand("ils -AL foo10", 'STDOUT_SINGLELINE', [" 3 ", " & ", " foo10"]) # =-=-=-=-=-=-=- # TEARDOWN for i in range(num_children): self.admin.assert_icommand("irm -f foo%d" % i) # unwire repl nods self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "replB")) # second tree teardown self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replB", "unixB2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replB", "unixB1")) self.admin.assert_icommand("iadmin rmresc %s" % "unixB2") self.admin.assert_icommand("iadmin rmresc %s" % "unixB1") self.admin.assert_icommand("iadmin rmresc %s" % "replB") # first tree teardown self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "unixA2")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("replA", "unixA1")) self.admin.assert_icommand("iadmin rmchildfromresc %s %s" % ("pt", "replA")) self.admin.assert_icommand("iadmin rmresc %s" % "unixA2") self.admin.assert_icommand("iadmin rmresc %s" % "unixA1") self.admin.assert_icommand("iadmin rmresc %s" % "replA") self.admin.assert_icommand("iadmin rmresc %s" % "pt") def test_iexecmd(self): test_file = "iput_test_file" lib.make_file(test_file, 10) self.admin.assert_icommand("iput %s foo" % test_file) self.admin.assert_icommand(['iexecmd', '-p', self.admin.session_collection + '/foo', 'hello'], 'STDOUT_SINGLELINE', "Hello world from irods") self.admin.assert_icommand("irm -f foo") def test_ibun(self): test_file = "ibun_test_file" lib.make_file(test_file, 1000) cmd = "tar cf somefile.tar " + test_file output = commands.getstatusoutput(cmd) tar_path = self.admin.session_collection + '/somefile.tar' dir_path = self.admin.session_collection + '/somedir' self.admin.assert_icommand("iput somefile.tar") self.admin.assert_icommand("imkdir " + dir_path) self.admin.assert_icommand("iput %s %s/foo0" % (test_file, dir_path)) self.admin.assert_icommand("iput %s %s/foo1" % (test_file, dir_path)) self.admin.assert_icommand("ibun -cD tar " + tar_path + " " + dir_path, 'STDERR_SINGLELINE', "OVERWRITE_WITHOUT_FORCE_FLAG") self.admin.assert_icommand("irm -rf " + dir_path) self.admin.assert_icommand("irm -rf " + tar_path) def test_rebalance_for_repl_node_with_different_users(self): output = commands.getstatusoutput("hostname") hostname = output[1] # =-=-=-=-=-=-=- # STANDUP self.admin.assert_icommand("iadmin mkresc repl replication", 'STDOUT_SINGLELINE', "Creating") self.admin.assert_icommand("iadmin mkresc leaf_a unixfilesystem " + hostname + ":/tmp/irods/pydevtest_leaf_a", 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin mkresc leaf_b unixfilesystem " + hostname + ":/tmp/irods/pydevtest_leaf_b", 'STDOUT_SINGLELINE', "Creating") # unix self.admin.assert_icommand("iadmin addchildtoresc repl leaf_a") self.admin.assert_icommand("iadmin addchildtoresc repl leaf_b") # =-=-=-=-=-=-=- # place data into the resource test_file = "rebalance_test_file" lib.make_file(test_file, 100) num_children = 3 for i in range(num_children): self.admin.assert_icommand("iput -R repl %s foo%d" % (test_file, i)) self.user0.assert_icommand("iput -R repl %s bar%d" % (test_file, i)) # =-=-=-=-=-=-=- # surgically trim repls so we can rebalance self.admin.assert_icommand("itrim -N1 -n 0 foo1") self.user0.assert_icommand("itrim -N1 -n 0 bar0") # =-=-=-=-=-=-=- # dirty up a foo10 repl to ensure that code path is tested also self.admin.assert_icommand("iadmin modresc leaf_a status down") self.user0.assert_icommand("iput -fR repl test_all_rules.py bar2") self.admin.assert_icommand("iadmin modresc leaf_a status up") # =-=-=-=-=-=-=- # visualize our pruning and dirtying self.admin.assert_icommand("ils -ALr /", 'STDOUT_SINGLELINE', self.admin.username) # =-=-=-=-=-=-=- # call rebalance function - the thing were actually testing... finally. self.admin.assert_icommand("iadmin modresc repl rebalance") # =-=-=-=-=-=-=- # visualize our rebalance self.admin.assert_icommand("ils -ALr /", 'STDOUT_SINGLELINE', self.admin.username) # =-=-=-=-=-=-=- # assert that all the appropriate repl numbers exist for all the children self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 0 ", " foo0"]) self.admin.assert_icommand("ils -AL foo0", 'STDOUT_SINGLELINE', [" 1 ", " foo0"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 1 ", " foo1"]) self.admin.assert_icommand("ils -AL foo1", 'STDOUT_SINGLELINE', [" 2 ", " foo1"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 0 ", " foo2"]) self.admin.assert_icommand("ils -AL foo2", 'STDOUT_SINGLELINE', [" 1 ", " foo2"]) self.user0.assert_icommand("ils -AL bar0", 'STDOUT_SINGLELINE', [" 1 ", " bar0"]) self.user0.assert_icommand("ils -AL bar0", 'STDOUT_SINGLELINE', [" 2 ", " bar0"]) self.user0.assert_icommand("ils -AL bar1", 'STDOUT_SINGLELINE', [" 0 ", " bar1"]) self.user0.assert_icommand("ils -AL bar1", 'STDOUT_SINGLELINE', [" 1 ", " bar1"]) self.user0.assert_icommand("ils -AL bar2", 'STDOUT_SINGLELINE', [" 0 ", " bar2"]) self.user0.assert_icommand("ils -AL bar2", 'STDOUT_SINGLELINE', [" 1 ", " bar2"]) # =-=-=-=-=-=-=- # TEARDOWN for i in range(num_children): self.admin.assert_icommand("irm -f foo%d" % i) self.user0.assert_icommand("irm -f bar%d" % i) self.admin.assert_icommand("iadmin rmchildfromresc repl leaf_b") self.admin.assert_icommand("iadmin rmchildfromresc repl leaf_a") self.admin.assert_icommand("iadmin rmresc leaf_b") self.admin.assert_icommand("iadmin rmresc leaf_a") self.admin.assert_icommand("iadmin rmresc repl") def test_rule_engine_2242(self): self.admin.assert_icommand_fail("irule -F rule1_2242.r", 'STDOUT_SINGLELINE', "failmsg") self.admin.assert_icommand("irule -F rule2_2242.r", "EMPTY") def test_hosts_config(self): addy1 = {} addy1['address'] = socket.gethostname() addy2 = {} addy2['address'] = 'jimbo' addresses = [addy1, addy2] remote = {} remote['address_type'] = 'local' remote['addresses'] = addresses cfg = {} cfg['host_entries'] = [remote] hosts_config = '' if os.path.isfile('/etc/irods/hosts_config.json'): hosts_config = '/etc/irods/hosts_config.json' else: hosts_config = os.path.join(lib.get_irods_config_dir(), 'hosts_config.json') orig_file = hosts_config + '.orig' os.system('cp %s %s' % (hosts_config, orig_file)) with open(hosts_config, 'w') as f: json.dump( cfg, f, sort_keys=True, indent=4, ensure_ascii=False) hostuser = getpass.getuser() temp_file = 'file_to_test_hosts_config' lib.make_file(temp_file, 10) self.admin.assert_icommand("iadmin mkresc jimboResc unixfilesystem jimbo:/tmp/%s/jimboResc" % hostuser, 'STDOUT_SINGLELINE', "jimbo") self.admin.assert_icommand("iput -R jimboResc " + temp_file + " jimbofile") self.admin.assert_icommand("irm -f jimbofile") self.admin.assert_icommand("iadmin rmresc jimboResc") os.system('mv %s %s' % (orig_file, hosts_config)) def test_host_access_control(self): my_ip = socket.gethostbyname(socket.gethostname()) # manipulate the core.re to enable host access control corefile = lib.get_core_re_dir() + "/core.re" origcorefile = corefile + '.orig' backupcorefile = corefile + "--" + self._testMethodName shutil.copy(corefile, backupcorefile) part1 = "sed -e '/^acChkHostAccessControl { }/i acChkHostAccessControl { msiCheckHostAccessControl; }' " part2 = part1 + corefile + ' > ' + origcorefile os.system(part2) time.sleep(1) # remove once file hash fix is commited #2279 os.system("cp " + origcorefile + " " + corefile) time.sleep(1) # remove once file hash fix is commited #2279 # restart the server to reread the new core.re lib.restart_irods_server() host_access_control = '' if os.path.isfile('/etc/irods/host_access_control_config.json'): host_access_control = '/etc/irods/host_access_control_config.json' else: host_access_control = os.path.join(lib.get_irods_config_dir(), 'host_access_control_config.json') orig_file = host_access_control + '.orig' os.system('cp %s %s' % (host_access_control, orig_file)) write_host_access_control(host_access_control, 'nope', 'nope', '', '') self.admin.assert_icommand_fail("ils", 'STDERR_SINGLELINE', "SYS_AGENT_INIT_ERR") write_host_access_control(host_access_control, 'all', 'all', my_ip, '255.255.255.255') self.admin.assert_icommand("ils", 'STDOUT_SINGLELINE', self.admin.zone_name) # restore the original host_access_control.json os.system('mv %s %s' % (orig_file, host_access_control)) # restore the original core.re shutil.copy(backupcorefile, corefile) os.remove(backupcorefile) def test_issue_2420(self): # manipulate the core.re to enable host access control corefile = lib.get_core_re_dir() + "/core.re" origcorefile = corefile + '.orig' backupcorefile = corefile + "--" + self._testMethodName shutil.copy(corefile, backupcorefile) part1 = "sed -e '/^acAclPolicy {msiAclPolicy(\"STRICT\"); }/iacAclPolicy {ON($userNameClient == \"quickshare\") { } }' " part2 = part1 + corefile + ' > ' + origcorefile os.system(part2) time.sleep(1) # remove once file hash fix is commited #2279 os.system("cp " + origcorefile + " " + corefile) time.sleep(1) # remove once file hash fix is commited #2279 # restart the server to reread the new core.re lib.restart_irods_server() self.admin.assert_icommand("ils", 'STDOUT_SINGLELINE', self.admin.zone_name) # look for the error "unable to read session variable $userNameClient." p = subprocess.Popen( ['grep "unable to read session variable $userNameClient." ../../iRODS/server/log/rodsLog.*'], shell=True, stdout=subprocess.PIPE) result = p.communicate()[0] # restore the original core.re shutil.copy(backupcorefile, corefile) os.remove(backupcorefile) # check the results for the error assert(-1 == result.find("userNameClient")) def test_server_config_environment_variables(self): # set log level to get all the things env = os.environ.copy() env['spLogLevel'] = '11' server_config_filename = lib.get_irods_config_dir() + "/server_config.json" with lib.file_backed_up(server_config_filename): # set a random environment value to find in the log with open(server_config_filename) as f: server_config = json.load(f) the_value = 'THIS_IS_THE_VALUE' server_config['environment_variables']['foo_bar'] = the_value lib.update_json_file_from_dict(server_config_filename, server_config) # bounce the server to get the new env variable lib.restart_irods_server(env=env) self.admin.assert_icommand('ils', 'STDOUT_SINGLELINE', self.admin.zone_name) # look for the error "unable to read session variable $userNameClient." _, out, _ = lib.run_command('grep "{0}" ../../iRODS/server/log/rodsLog.*'.format(the_value), use_unsafe_shell=True) lib.restart_irods_server() assert the_value in out def test_set_resource_comment_to_emptystring_ticket_2434(self): mycomment = "notemptystring" self.admin.assert_icommand_fail("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) self.admin.assert_icommand("iadmin modresc " + self.testresc + " comment '" + mycomment + "'") self.admin.assert_icommand("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) self.admin.assert_icommand("iadmin modresc " + self.testresc + " comment ''") self.admin.assert_icommand_fail("iadmin lr " + self.testresc, 'STDOUT_SINGLELINE', mycomment) def test_irmtrash_admin_2461(self): # 'irmtrash -M' was not deleting the r_objt_metamap entries for collections it was deleting # leading to orphaned avu's that 'iadmin rum' could never remove collection_basename = sys._getframe().f_code.co_name self.admin.assert_icommand('imkdir {collection_basename}'.format(**vars())) file_basename = 'dummy_file_to_trigger_recursive_rm' lib.make_file(file_basename, 10) file_irods_path = os.path.join(collection_basename, file_basename) self.admin.assert_icommand('iput {file_basename} {file_irods_path}'.format(**vars())) a, v, u = ('attribute_' + collection_basename, 'value_' + collection_basename, 'unit_' + collection_basename) self.admin.assert_icommand('imeta add -C {collection_basename} {a} {v} {u}'.format(**vars())) self.admin.assert_icommand('imeta ls -C {collection_basename}'.format(**vars()), 'STDOUT_MULTILINE', [a, v, u]) self.admin.assert_icommand('irm -r {collection_basename}'.format(**vars())) self.admin.assert_icommand('irmtrash -M') self.admin.assert_icommand('iadmin rum') self.admin.assert_icommand_fail('''iquest "select META_DATA_ATTR_NAME where META_DATA_ATTR_NAME = '{a}'"'''.format(**vars()), 'STDOUT_SINGLELINE', a) def test_msiset_default_resc__2712(self): hostname = lib.get_hostname() testresc1 = 'pydevtest_TestResc' corefile = lib.get_core_re_dir() + "/core.re" with lib.file_backed_up(corefile): initial_size_of_server_log = lib.get_log_size('server') rules_to_prepend = 'acSetRescSchemeForCreate{ msiSetDefaultResc("' + testresc1 + '","forced"); }\n' time.sleep(2) # remove once file hash fix is commited #2279 lib.prepend_string_to_file(rules_to_prepend, corefile) time.sleep(2) # remove once file hash fix is commited #2279 trigger_file = 'file_to_trigger_acSetRescSchemeForCreate' lib.make_file(trigger_file, 10) self.user0.assert_icommand(['iput', trigger_file]) self.user0.assert_icommand(['ils', '-L', trigger_file], 'STDOUT_SINGLELINE', testresc1) os.unlink(trigger_file) self.user0.assert_icommand('irm -f ' + trigger_file) time.sleep(2) # remove once file hash fix is commited #2279 @unittest.skipIf(configuration.TOPOLOGY_FROM_RESOURCE_SERVER, 'Skip for topology testing from resource server: reads re server log') def test_rule_engine_2309(self): corefile = lib.get_core_re_dir() + "/core.re" coredvm = lib.get_core_re_dir() + "/core.dvm" with lib.file_backed_up(coredvm): lib.prepend_string_to_file('oprType||rei->doinp->oprType\n', coredvm) with lib.file_backed_up(corefile): initial_size_of_server_log = lib.get_log_size('server') rules_to_prepend = ''' acSetNumThreads() { writeLine("serverLog","test_rule_engine_2309: put: acSetNumThreads oprType [$oprType]"); } ''' time.sleep(1) # remove once file hash fix is commited #2279 lib.prepend_string_to_file(rules_to_prepend, corefile) time.sleep(1) # remove once file hash fix is commited #2279 trigger_file = 'file_to_trigger_acSetNumThreads' lib.make_file(trigger_file, 4 * pow(10, 7)) self.admin.assert_icommand('iput {0}'.format(trigger_file)) assert 1 == lib.count_occurrences_of_string_in_log( 'server', 'writeLine: inString = test_rule_engine_2309: put: acSetNumThreads oprType [1]', start_index=initial_size_of_server_log) assert 0 == lib.count_occurrences_of_string_in_log('server', 'RE_UNABLE_TO_READ_SESSION_VAR', start_index=initial_size_of_server_log) os.unlink(trigger_file) with lib.file_backed_up(corefile): initial_size_of_server_log = lib.get_log_size('server') rules_to_prepend = ''' acSetNumThreads() { writeLine("serverLog","test_rule_engine_2309: get: acSetNumThreads oprType [$oprType]"); } ''' time.sleep(1) # remove once file hash fix is commited #2279 lib.prepend_string_to_file(rules_to_prepend, corefile) time.sleep(1) # remove once file hash fix is commited #2279 self.admin.assert_icommand('iget {0}'.format(trigger_file), use_unsafe_shell=True) assert 1 == lib.count_occurrences_of_string_in_log( 'server', 'writeLine: inString = test_rule_engine_2309: get: acSetNumThreads oprType [2]', start_index=initial_size_of_server_log) assert 0 == lib.count_occurrences_of_string_in_log('server', 'RE_UNABLE_TO_READ_SESSION_VAR', start_index=initial_size_of_server_log) os.unlink(trigger_file) def test_storageadmin_role(self): self.admin.assert_icommand_fail("iadmin mkuser nopes storageadmin", 'STDOUT_SINGLELINE', "CAT_INVALID_USER_TYPE") def test_domainadmin_role(self): self.admin.assert_icommand_fail("iadmin mkuser nopes domainadmin", 'STDOUT_SINGLELINE', "CAT_INVALID_USER_TYPE") def test_rodscurators_role(self): self.admin.assert_icommand_fail("iadmin mkuser nopes rodscurators", 'STDOUT_SINGLELINE', "CAT_INVALID_USER_TYPE") def test_izonereport_key_sanitization(self): self.admin.assert_icommand("izonereport | grep key | grep -v XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 'STDOUT_SINGLELINE', '"irods_encryption_key_size": 32,', use_unsafe_shell=True)
55.544434
187
0.635078
6,949
59,377
5.205497
0.088214
0.097531
0.155088
0.237802
0.800708
0.765239
0.730103
0.693003
0.653747
0.604843
0
0.017376
0.229466
59,377
1,068
188
55.596442
0.773256
0.088974
0
0.442799
0
0
0.331048
0.037421
0
0
0
0
0.531629
0
null
null
0.024226
0.02288
null
null
0.004038
0
0
0
null
0
0
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
7
82aec7ae287d519e029daad2c3ce9af4409d15e8
5,378
py
Python
acs_etl/load.py
cywujeremy/etl_demo
3e0ce84836ef4db0fd672d453909c3bcc163b05a
[ "Apache-2.0" ]
null
null
null
acs_etl/load.py
cywujeremy/etl_demo
3e0ce84836ef4db0fd672d453909c3bcc163b05a
[ "Apache-2.0" ]
null
null
null
acs_etl/load.py
cywujeremy/etl_demo
3e0ce84836ef4db0fd672d453909c3bcc163b05a
[ "Apache-2.0" ]
null
null
null
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_load.ipynb (unless otherwise specified). __all__ = ['database_connector', 'series_to_tuple_like_string', 'ACS_Blockgroup_Data_Loader', 'database_connector', 'series_to_tuple_like_string', 'ACS_Blockgroup_Data_Loader'] # Cell import os os.chdir('../') os.getcwd() # Cell from nbdev.showdoc import * from .acs import ACS_Blockgroup_Data_Pull import numpy as np import pandas as pd import psycopg2 import re # Cell def database_connector(func): def with_connection(*args, **kwargs): conn = psycopg2.connect( host='acs-db.mlpolicylab.dssg.io', database='acs_data_loading', user='mlpp_student', password='CARE-horse-most') cur = conn.cursor() try: func(*args, cur, **kwargs) conn.commit() except Exception as e: print(e) finally: cur.close() conn.close() return with_connection # Cell def series_to_tuple_like_string(series): '''Transform a pandas series into a tuple-like string to fit in SQL queries. ''' string = '(' for item in series: if not re.match(r'^[0-9]+$', str(item)): string = string + "'" + str(item) + "'" + ',' else: string = string + str(item) + ',' string = string.strip(',') + ')' return string # Cell class ACS_Blockgroup_Data_Loader: def __init__(self, df, db_dict, schema, table): self.df: pd.DataFrame = df self.db_dict: dict = db_dict self.schema: str = schema self.table: str = table self.host = db_dict['host'] self.database = db_dict['database'] self.user = db_dict['user'] self.password = db_dict['password'] @database_connector def create_table(self, cur): '''Create a table with the specified name. ''' cur.execute(f"CREATE TABLE acs.{self.table} (\ state_id INTEGER,\ state VARCHAR(4),\ county_id INTEGER,\ county VARCHAR(40),\ blockgroup INTEGER,\ tract INTEGER,\ total_population NUMERIC,\ median_age NUMERIC,\ per_capita_income NUMERIC,\ median_rent_to_household_income NUMERIC,\ avg_household_size NUMERIC,\ NAME VARCHAR(100)\ )") @database_connector def insert_data(self, cur): '''Insert rows in df into the specified table. ''' for i, row in self.df.iterrows(): row_string = series_to_tuple_like_string(row) cur.execute(f"INSERT INTO acs.{self.table} VALUES {row_string}") # Cell import os os.chdir('../') os.getcwd() # Cell from nbdev.showdoc import * from .acs import ACS_Blockgroup_Data_Pull import numpy as np import pandas as pd import psycopg2 import re # Cell def database_connector(func): def with_connection(*args, **kwargs): conn = psycopg2.connect( host='acs-db.mlpolicylab.dssg.io', database='acs_data_loading', user='mlpp_student', password='CARE-horse-most') cur = conn.cursor() try: func(*args, cur, **kwargs) conn.commit() except Exception as e: print(e) finally: cur.close() conn.close() return with_connection # Cell def series_to_tuple_like_string(series): '''Transform a pandas series into a tuple-like string to fit in SQL queries. ''' string = '(' for item in series: if not re.match(r'^[0-9]+$', str(item)): string = string + "'" + str(item) + "'" + ',' else: string = string + str(item) + ',' string = string.strip(',') + ')' return string # Cell class ACS_Blockgroup_Data_Loader: def __init__(self, df, db_dict, schema, table): self.df: pd.DataFrame = df self.db_dict: dict = db_dict self.schema: str = schema self.table: str = table self.host = db_dict['host'] self.database = db_dict['database'] self.user = db_dict['user'] self.password = db_dict['password'] @database_connector def create_table(self, cur): '''Create a table with the specified name. ''' cur.execute(f"CREATE TABLE acs.{self.table} (\ state_id INTEGER,\ state VARCHAR(4),\ county_id INTEGER,\ county VARCHAR(40),\ blockgroup INTEGER,\ tract INTEGER,\ total_population NUMERIC,\ median_age NUMERIC,\ per_capita_income NUMERIC,\ median_rent_to_household_income NUMERIC,\ avg_household_size NUMERIC,\ NAME VARCHAR(100)\ )") @database_connector def insert_data(self, cur): '''Insert rows in df into the specified table. ''' for i, row in self.df.iterrows(): row_string = series_to_tuple_like_string(row) cur.execute(f"INSERT INTO acs.{self.table} VALUES {row_string}")
28.606383
115
0.5582
617
5,378
4.672609
0.209076
0.029136
0.041623
0.03538
0.974679
0.974679
0.974679
0.974679
0.974679
0.974679
0
0.00614
0.333767
5,378
187
116
28.759358
0.798493
0.093343
0
0.985075
1
0
0.09514
0.032678
0
0
0
0
0
1
0.089552
false
0.029851
0.104478
0
0.238806
0.014925
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
82d8db67579882611bff962ef171a5904cc2afdc
40,327
py
Python
tests/test_sklearn_api_classification_binary.py
Trevor-Waite/vecstack
e9185909e8ece6500139e0f4305635fc1fc9fb50
[ "MIT" ]
693
2016-11-24T13:07:52.000Z
2022-03-24T16:30:07.000Z
tests/test_sklearn_api_classification_binary.py
Trevor-Waite/vecstack
e9185909e8ece6500139e0f4305635fc1fc9fb50
[ "MIT" ]
44
2017-09-14T15:53:09.000Z
2021-11-03T11:35:06.000Z
tests/test_sklearn_api_classification_binary.py
Trevor-Waite/vecstack
e9185909e8ece6500139e0f4305635fc1fc9fb50
[ "MIT" ]
94
2016-11-25T10:15:20.000Z
2022-02-27T10:13:24.000Z
# ----------------------------------------------------------------------------- # Exactly the same as multiclass but ``n_classes=2`` # and class name is ``TestSklearnClassificationBinary`` # ----------------------------------------------------------------------------- # !!! cross_val_predict uses stratified split # ----------------------------------------------------------------------------- # Main concept for testing returned arrays: # 1). create ground truth e.g. with cross_val_predict # 2). run vecstack # 3). compare returned arrays with ground truth # ----------------------------------------------------------------------------- from __future__ import print_function from __future__ import division import unittest from numpy.testing import assert_array_equal # from numpy.testing import assert_allclose from numpy.testing import assert_equal # import os # import glob import numpy as np import scipy.stats as st from sklearn.model_selection import cross_val_predict from sklearn.model_selection import cross_val_score # from sklearn.model_selection import train_test_split # from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold from sklearn.datasets import make_classification from sklearn.preprocessing import OneHotEncoder from sklearn.metrics import accuracy_score from sklearn.metrics import zero_one_loss from sklearn.metrics import log_loss from sklearn.metrics import roc_auc_score from sklearn.metrics import make_scorer from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.dummy import DummyClassifier from vecstack import StackingTransformer n_classes = 2 n_folds = 5 # temp_dir = 'tmpdw35lg54ms80eb42' X, y = make_classification(n_samples=500, n_features=5, n_informative=3, n_redundant=1, n_classes=n_classes, flip_y=0, random_state=0) # X_train, X_test, y_train, y_test = train_test_split(X, y, # test_size=0.2, # random_state=0) # Make train/test split by hand to avoid strange errors probably related to testing suit: # https://github.com/scikit-learn/scikit-learn/issues/1684 # https://github.com/scikit-learn/scikit-learn/issues/1704 # Note: Python 2.7, 3.4 - OK, but 3.5, 3.6 - error np.random.seed(0) ind = np.arange(500) np.random.shuffle(ind) ind_train = ind[:400] ind_test = ind[400:] X_train = X[ind_train] X_test = X[ind_test] y_train = y[ind_train] y_test = y[ind_test] #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- def roc_auc_score_universal(y_true, y_pred): """ROC AUC metric for both binary and multiclass classification. Parameters ---------- y_true - 1d numpy array True class labels y_pred - 2d numpy array Predicted probabilities for each class """ ohe = OneHotEncoder(sparse=False) y_true = ohe.fit_transform(y_true.reshape(-1, 1)) #@@@@ if len(y_pred.shape) == 1: y_pred = np.c_[y_pred, y_pred] y_pred[:, 0] = 1 - y_pred[:, 1] #@@@@ auc_score = roc_auc_score(y_true, y_pred) return auc_score #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- class TestSklearnClassificationBinary(unittest.TestCase): # ------------------------------------------------------------------------- # Test returned arrays in variant B. Labels # ------------------------------------------------------------------------- def test_variant_B_labels(self): # reference model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) model = model.fit(X_train, y_train) S_test_1 = model.predict(X_test).reshape(-1, 1) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test returned arrays in variant A. Labels # ------------------------------------------------------------------------- def test_variant_A_labels(self): S_test_temp = np.zeros((X_test.shape[0], n_folds)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') model = model.fit(X_tr, y_tr) S_test_temp[:, fold_counter] = model.predict(X_test) S_test_1 = st.mode(S_test_temp, axis=1)[0] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='A', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test returned arrays in variant B. Probabilities # ------------------------------------------------------------------------- def test_variant_B_proba(self): # reference model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') model = model.fit(X_train, y_train) S_test_1 = model.predict_proba(X_test) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test returned arrays in variant A. Probabilities # ------------------------------------------------------------------------- def test_variant_A_proba(self): S_test_1 = np.zeros((X_test.shape[0], n_classes)) S_test_temp = np.zeros((X_test.shape[0], n_folds * n_classes)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') model = model.fit(X_tr, y_tr) col_slice_fold = slice(fold_counter * n_classes, fold_counter * n_classes + n_classes) S_test_temp[:, col_slice_fold] = model.predict_proba(X_test) for class_id in range(n_classes): S_test_1[:, class_id] = np.mean(S_test_temp[:, class_id::n_classes], axis=1) model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='A', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) #--------------------------------------------------------------------------- # Test ``shuffle`` and ``random_state`` parameters in variant A #--------------------------------------------------------------------------- def test_variant_A_proba_shuffle_random_state(self): S_test_1 = np.zeros((X_test.shape[0], n_classes)) S_test_temp = np.zeros((X_test.shape[0], n_folds * n_classes)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=True, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') model = model.fit(X_tr, y_tr) col_slice_fold = slice(fold_counter * n_classes, fold_counter * n_classes + n_classes) S_test_temp[:, col_slice_fold] = model.predict_proba(X_test) for class_id in range(n_classes): S_test_1[:, class_id] = np.mean(S_test_temp[:, class_id::n_classes], axis=1) model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') # !!! Important. Here we pass CV-generator ``cv=kf`` not number of folds S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=kf, n_jobs=1, verbose=0, method='predict_proba') # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=True, variant='A', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test default metric and scores. Labels # ``metric`` parameter and its default values depends on ``regression`` parameter. # Important. We use ``greater_is_better=True`` in ``make_scorer`` # for any error function because we need raw scores (without minus sign) # ------------------------------------------------------------------------- def test_default_metric_and_scores_labels(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') scorer = make_scorer(accuracy_score) scores_1 = cross_val_score(model, X_train, y=y_train, cv=n_folds, scoring=scorer, n_jobs=1, verbose=0) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) scores_2 = stack.scores_[0].copy() # fit_transform # also check refitting already fitted transformer _ = stack.fit_transform(X_train, y_train) scores_3 = stack.scores_[0].copy() assert_array_equal(scores_1, scores_2) assert_array_equal(scores_1, scores_3) # mean and std mean_1 = np.mean(scores_1) std_1 = np.std(scores_1) mean_2 = stack.mean_std_[0][1] std_2 = stack.mean_std_[0][2] assert_equal(mean_1, mean_2) assert_equal(std_1, std_2) # ------------------------------------------------------------------------- # Test custom metric and scores. Labels # ------------------------------------------------------------------------- def test_custom_metric_and_scores_labels(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') scorer = make_scorer(zero_one_loss) scores_1 = cross_val_score(model, X_train, y=y_train, cv=n_folds, scoring=scorer, n_jobs=1, verbose=0) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, metric=zero_one_loss, verbose=0) stack = stack.fit(X_train, y_train) scores_2 = stack.scores_[0].copy() # fit_transform # also check refitting already fitted transformer _ = stack.fit_transform(X_train, y_train) scores_3 = stack.scores_[0].copy() assert_array_equal(scores_1, scores_2) assert_array_equal(scores_1, scores_3) # mean and std mean_1 = np.mean(scores_1) std_1 = np.std(scores_1) mean_2 = stack.mean_std_[0][1] std_2 = stack.mean_std_[0][2] assert_equal(mean_1, mean_2) assert_equal(std_1, std_2) # ------------------------------------------------------------------------- # Test default metric and scores. Probabilities # ------------------------------------------------------------------------- def test_default_metric_and_scores_proba(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') scorer = make_scorer(log_loss, needs_proba=True) scores_1 = cross_val_score(model, X_train, y=y_train, cv=n_folds, scoring=scorer, n_jobs=1, verbose=0) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) scores_2 = stack.scores_[0].copy() # fit_transform # also check refitting already fitted transformer _ = stack.fit_transform(X_train, y_train) scores_3 = stack.scores_[0].copy() assert_array_equal(scores_1, scores_2) assert_array_equal(scores_1, scores_3) # mean and std mean_1 = np.mean(scores_1) std_1 = np.std(scores_1) mean_2 = stack.mean_std_[0][1] std_2 = stack.mean_std_[0][2] assert_equal(mean_1, mean_2) assert_equal(std_1, std_2) # ------------------------------------------------------------------------- # Test custom metric and scores. Probabilities # ------------------------------------------------------------------------- def test_custom_metric_and_scores_proba(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') scorer = make_scorer(roc_auc_score_universal, needs_proba=True) scores_1 = cross_val_score(model, X_train, y=y_train, cv=n_folds, scoring=scorer, n_jobs=1, verbose=0) # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, needs_proba=True, metric=roc_auc_score_universal, verbose=0) stack = stack.fit(X_train, y_train) scores_2 = stack.scores_[0].copy() # fit_transform # also check refitting already fitted transformer _ = stack.fit_transform(X_train, y_train) scores_3 = stack.scores_[0].copy() assert_array_equal(scores_1, scores_2) assert_array_equal(scores_1, scores_3) # mean and std mean_1 = np.mean(scores_1) std_1 = np.std(scores_1) mean_2 = stack.mean_std_[0][1] std_2 = stack.mean_std_[0][2] assert_equal(mean_1, mean_2) assert_equal(std_1, std_2) # ------------------------------------------------------------------------- # Test several estimators in one run. Variant B. Labels # ------------------------------------------------------------------------- def test_variant_B_2_estimators_labels(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1_e1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) model = model.fit(X_train, y_train) S_test_1_e1 = model.predict(X_test).reshape(-1, 1) model = GaussianNB() S_train_1_e2 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) model = model.fit(X_train, y_train) S_test_1_e2 = model.predict(X_test).reshape(-1, 1) S_train_1 = np.c_[S_train_1_e1, S_train_1_e2] S_test_1 = np.c_[S_test_1_e1, S_test_1_e2] # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr')), ('bayes', GaussianNB())] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test several estimators in one run. Variant B. Probabilities # ------------------------------------------------------------------------- def test_variant_B_2_estimators_proba(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1_e1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') model = model.fit(X_train, y_train) S_test_1_e1 = model.predict_proba(X_test) model = GaussianNB() S_train_1_e2 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') model = model.fit(X_train, y_train) S_test_1_e2 = model.predict_proba(X_test) S_train_1 = np.c_[S_train_1_e1, S_train_1_e2] S_test_1 = np.c_[S_test_1_e1, S_test_1_e2] # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr')), ('bayes', GaussianNB())] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test several estimators in one run. Variant A. Labels # ------------------------------------------------------------------------- def test_variant_A_2_estimators_labels(self): # Estimator 1 S_test_temp_e1 = np.zeros((X_test.shape[0], n_folds)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') model = model.fit(X_tr, y_tr) S_test_temp_e1[:, fold_counter] = model.predict(X_test) S_test_1_e1 = st.mode(S_test_temp_e1, axis=1)[0] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1_e1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) # Estimator 2 S_test_temp_e2 = np.zeros((X_test.shape[0], n_folds)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = GaussianNB() model = model.fit(X_tr, y_tr) S_test_temp_e2[:, fold_counter] = model.predict(X_test) S_test_1_e2 = st.mode(S_test_temp_e2, axis=1)[0] model = GaussianNB() S_train_1_e2 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) S_train_1 = np.c_[S_train_1_e1, S_train_1_e2] S_test_1 = np.c_[S_test_1_e1, S_test_1_e2] # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr')), ('bayes', GaussianNB())] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='A', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test several estimators in one run. Variant A. Probabilities # ------------------------------------------------------------------------- def test_variant_A_2_estimators_proba(self): # Estimator 1 S_test_1_e1 = np.zeros((X_test.shape[0], n_classes)) S_test_temp_e1 = np.zeros((X_test.shape[0], n_folds * n_classes)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') model = model.fit(X_tr, y_tr) col_slice_fold = slice(fold_counter * n_classes, fold_counter * n_classes + n_classes) S_test_temp_e1[:, col_slice_fold] = model.predict_proba(X_test) for class_id in range(n_classes): S_test_1_e1[:, class_id] = np.mean(S_test_temp_e1[:, class_id::n_classes], axis=1) model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1_e1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') # Estimator 2 S_test_1_e2 = np.zeros((X_test.shape[0], n_classes)) S_test_temp_e2 = np.zeros((X_test.shape[0], n_folds * n_classes)) # Using StratifiedKFold because by defauld cross_val_predict uses StratifiedKFold kf = StratifiedKFold(n_splits=n_folds, shuffle=False, random_state=0) for fold_counter, (tr_index, te_index) in enumerate(kf.split(X_train, y_train)): # Split data and target X_tr = X_train[tr_index] y_tr = y_train[tr_index] # X_te = X_train[te_index] # y_te = y_train[te_index] model = GaussianNB() model = model.fit(X_tr, y_tr) col_slice_fold = slice(fold_counter * n_classes, fold_counter * n_classes + n_classes) S_test_temp_e2[:, col_slice_fold] = model.predict_proba(X_test) for class_id in range(n_classes): S_test_1_e2[:, class_id] = np.mean(S_test_temp_e2[:, class_id::n_classes], axis=1) model = GaussianNB() S_train_1_e2 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') S_train_1 = np.c_[S_train_1_e1, S_train_1_e2] S_test_1 = np.c_[S_test_1_e1, S_test_1_e2] # fit then transform estimators = [('logit', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr')), ('bayes', GaussianNB())] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='A', random_state=0, stratified=True, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test default (dummy) classifier. Labels # ------------------------------------------------------------------------- def test_variant_B_default_classifier_labels(self): # reference model = DummyClassifier(strategy='constant', constant=1) S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) model = model.fit(X_train, y_train) S_test_1 = model.predict(X_test).reshape(-1, 1) # fit then transform stack = StackingTransformer(estimators=None, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) # ------------------------------------------------------------------------- # Test default (dummy) classifier. Probabilities # ------------------------------------------------------------------------- def test_variant_B_default_classifier_proba(self): # reference model = DummyClassifier(strategy='constant', constant=1) S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict_proba') model = model.fit(X_train, y_train) S_test_1 = model.predict_proba(X_test) # fit then transform stack = StackingTransformer(estimators=None, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, needs_proba=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # compare assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) #--------------------------------------------------------------------------- # Testing ``verbose`` parameter #--------------------------------------------------------------------------- def test_variant_B_verbose(self): model = LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr') S_train_1 = cross_val_predict(model, X_train, y=y_train, cv=n_folds, n_jobs=1, verbose=0, method='predict').reshape(-1, 1) model = model.fit(X_train, y_train) S_test_1 = model.predict(X_test).reshape(-1, 1) # verbose=0 # fit then transform estimators = [('lr', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=0) stack = stack.fit(X_train, y_train) S_train_2 = stack.transform(X_train) S_test_2 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_3 = stack.fit_transform(X_train, y_train) S_test_3 = stack.transform(X_test) # verbose=1 # fit then transform estimators = [('lr', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=1) stack = stack.fit(X_train, y_train) S_train_4 = stack.transform(X_train) S_test_4 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_5 = stack.fit_transform(X_train, y_train) S_test_5 = stack.transform(X_test) # verbose=2 # fit then transform estimators = [('lr', LogisticRegression(random_state=0, solver='liblinear', multi_class='ovr'))] stack = StackingTransformer(estimators, regression=False, n_folds=n_folds, shuffle=False, variant='B', random_state=0, stratified=True, verbose=2) stack = stack.fit(X_train, y_train) S_train_6 = stack.transform(X_train) S_test_6 = stack.transform(X_test) # fit_transform # also check refitting already fitted transformer S_train_7 = stack.fit_transform(X_train, y_train) S_test_7 = stack.transform(X_test) assert_array_equal(S_train_1, S_train_2) assert_array_equal(S_test_1, S_test_2) assert_array_equal(S_train_1, S_train_3) assert_array_equal(S_test_1, S_test_3) assert_array_equal(S_train_1, S_train_4) assert_array_equal(S_test_1, S_test_4) assert_array_equal(S_train_1, S_train_5) assert_array_equal(S_test_1, S_test_5) assert_array_equal(S_train_1, S_train_6) assert_array_equal(S_test_1, S_test_6) assert_array_equal(S_train_1, S_train_7) assert_array_equal(S_test_1, S_test_7) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if __name__ == '__main__': unittest.main() #------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
45.982896
107
0.539837
4,723
40,327
4.253441
0.05145
0.034098
0.025088
0.047389
0.895415
0.871522
0.856389
0.837871
0.820648
0.8091
0
0.021305
0.298163
40,327
876
108
46.035388
0.688478
0.205173
0
0.785441
0
0
0.022406
0
0
0
0
0
0.141762
1
0.032567
false
0
0.04023
0
0.076628
0.001916
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
81a2796f5fcdb8746f39ed5036ffa81be7e3b462
213
py
Python
palindrome.py
brupoon/mustachedNinja
7a44167fa2655ffa206b7f68808efc979b2b6e16
[ "MIT" ]
null
null
null
palindrome.py
brupoon/mustachedNinja
7a44167fa2655ffa206b7f68808efc979b2b6e16
[ "MIT" ]
null
null
null
palindrome.py
brupoon/mustachedNinja
7a44167fa2655ffa206b7f68808efc979b2b6e16
[ "MIT" ]
null
null
null
#palindrome, ch 6 ex 6 #cc-by-sa 4.0, bpoon 2014 def first(word): return word[0] def last(word): return word[-1] def middle(word): return word[1:-1] if __name__ == '__main__': pass
15.214286
27
0.586854
35
213
3.342857
0.628571
0.25641
0.358974
0.25641
0
0
0
0
0
0
0
0.077419
0.2723
213
14
28
15.214286
0.677419
0.211268
0
0
0
0
0.051948
0
0
0
0
0
0
1
0.375
false
0.125
0
0.375
0.75
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
7
81bdb0a49c5a7725fb8a04e28d2c73d9c3b7ba65
20,334
py
Python
tests/test_deploy.py
FrithiofJensen/slam
cf68a4bbc16d909718f8a9e71072b822e0a3d94b
[ "MIT" ]
79
2017-01-02T21:40:22.000Z
2022-02-22T11:07:51.000Z
tests/test_deploy.py
FrithiofJensen/slam
cf68a4bbc16d909718f8a9e71072b822e0a3d94b
[ "MIT" ]
17
2017-01-02T23:04:42.000Z
2020-10-09T19:08:39.000Z
tests/test_deploy.py
FrithiofJensen/slam
cf68a4bbc16d909718f8a9e71072b822e0a3d94b
[ "MIT" ]
13
2017-02-09T22:52:30.000Z
2020-09-21T01:48:18.000Z
from copy import deepcopy import mock import sys import unittest import boto3 import botocore from slam import cfn from slam import cli BUILTIN = '__builtin__' if sys.version_info >= (3, 0): BUILTIN = 'builtins' config = { 'name': 'foo', 'description': 'bar', 'stage_environments': {'dev': {'log': True, 'variables': {'STAGE': 'x'}}, 'prod': {'log': False, 'variables': {'FOO': 'bar'}}, 'staging': {'log': False}}, 'environment': {'abc': 'def'}, 'devstage': 'dev', 'aws': {'s3_bucket': 'bucket', 'lambda_timeout': 7, 'lambda_memory': 512} } describe_stacks_response = {'Stacks': [{ 'Parameters': [ {'ParameterKey': 'LambdaS3Bucket', 'ParameterValue': 'bucket'}, {'ParameterKey': 'LambdaS3Key', 'ParameterValue': 'lambda-old.zip'}, {'ParameterKey': 'DevVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'ProdVersion', 'ParameterValue': '2'}, {'ParameterKey': 'StagingVersion', 'ParameterValue': '1'} ], 'Outputs': [ {'OutputKey': 'FunctionArn', 'OutputValue': 'arn:lambda:foo'}, {'OutputKey': 'ApiId', 'OutputValue': '123abc'}, {'OutputKey': 'DevEndpoint', 'OutputValue': 'https://a.com'}, {'OutputKey': 'ProdEndpoint', 'OutputValue': 'https://b.com'}, {'OutputKey': 'StagingEndpoint', 'OutputValue': 'https://c.com'}, ] }]} class DeployTests(unittest.TestCase): def test_get_from_stack(self): stack = { 'Parameters': [ {'ParameterKey': 'foo', 'ParameterValue': 'bar'}, {'ParameterKey': 'key', 'ParameterValue': 'value'} ], 'Outputs': [ {'OutputKey': 'foo', 'OutputValue': 'bar'}, {'OutputKey': 'key', 'OutputValue': 'value'} ] } self.assertEqual(cli._get_from_stack(stack, 'Parameter', 'foo'), 'bar') self.assertEqual(cli._get_from_stack(stack, 'Parameter', 'key'), 'value') self.assertEqual(cli._get_from_stack(stack, 'Parameter', 'x'), None) self.assertEqual(cli._get_from_stack(stack, 'Output', 'foo'), 'bar') self.assertEqual(cli._get_from_stack(stack, 'Output', 'key'), 'value') self.assertEqual(cli._get_from_stack(stack, 'Output', 'x'), None) self.assertRaises(ValueError, cli._get_from_stack, stack, 'Foo', 'bar') def test_get_template(self): tpl = cfn.get_cfn_template(config) self.assertTrue(tpl.startswith( '{"AWSTemplateFormatVersion": "2010-09-09"')) try: client = boto3.client('cloudformation') except botocore.exceptions.BotoCoreError: pass else: client.validate_template(TemplateBody=tpl) # TODO: find an offline cloudformation validator that can be used here # without having to have aws creds @mock.patch('slam.cli.boto3.client') @mock.patch(BUILTIN + '.print') def test_print_status(self, mock_print, client): mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = {'Stacks': [{ 'Outputs': [ {'OutputKey': 'FunctionArn', 'OutputValue': 'arn:lambda:foo'}, {'OutputKey': 'DevEndpoint', 'OutputValue': 'https://a.com'}, {'OutputKey': 'ProdEndpoint', 'OutputValue': 'https://b.com'}, {'OutputKey': 'StagingEndpoint', 'OutputValue': 'https://c.com'}, ] }]} mock_lmb = mock.MagicMock() mock_lmb.get_function.side_effect = [ {'Configuration': {'Version': '$LATEST'}}, {'Configuration': {'Version': '23'}}, {'Configuration': {'Version': '$LATEST'}}, ] client.side_effect = [mock_cfn, mock_lmb] cli._print_status(config) output = ''.join([c[0][0] + '\n' for c in mock_print.call_args_list]) self.assertEqual(output, ('foo is deployed!\n' ' Function name: foo\n' ' S3 bucket: bucket\n' ' Stages:\n' ' dev:$LATEST\n' ' prod:23\n' ' staging:$LATEST\n')) @mock.patch('slam.cli.boto3.client') @mock.patch(BUILTIN + '.print') def test_print_status_with_api_gateway(self, mock_print, client): api_config = deepcopy(config) api_config['wsgi'] = {'deploy_api_gateway': True} mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = {'Stacks': [{ 'Outputs': [ {'OutputKey': 'FunctionArn', 'OutputValue': 'arn:lambda:foo'}, {'OutputKey': 'DevEndpoint', 'OutputValue': 'https://a.com'}, {'OutputKey': 'ProdEndpoint', 'OutputValue': 'https://b.com'}, {'OutputKey': 'StagingEndpoint', 'OutputValue': 'https://c.com'}, ] }]} mock_lmb = mock.MagicMock() mock_lmb.get_function.side_effect = [ {'Configuration': {'Version': '$LATEST'}}, {'Configuration': {'Version': '23'}}, {'Configuration': {'Version': '$LATEST'}}, ] client.side_effect = [mock_cfn, mock_lmb] cli._print_status(api_config) output = ''.join([c[0][0] + '\n' for c in mock_print.call_args_list]) self.assertEqual(output, ('foo is deployed!\n' ' Function name: foo\n' ' S3 bucket: bucket\n' ' Stages:\n' ' dev:$LATEST: https://a.com\n' ' prod:23: https://b.com\n' ' staging:$LATEST: https://c.com\n')) @mock.patch('slam.cli.boto3.client') @mock.patch(BUILTIN + '.print') def test_print_status_without_api_gateway(self, mock_print, client): api_config = deepcopy(config) api_config['wsgi'] = {'deploy_api_gateway': False} mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = {'Stacks': [{ 'Outputs': [ {'OutputKey': 'FunctionArn', 'OutputValue': 'arn:lambda:foo'}, ] }]} mock_lmb = mock.MagicMock() mock_lmb.get_function.side_effect = [ {'Configuration': {'Version': '$LATEST'}}, {'Configuration': {'Version': '23'}}, {'Configuration': {'Version': '$LATEST'}}, ] client.side_effect = [mock_cfn, mock_lmb] cli._print_status(api_config) output = ''.join([c[0][0] + '\n' for c in mock_print.call_args_list]) self.assertEqual(output, ('foo is deployed!\n' ' Function name: foo\n' ' S3 bucket: bucket\n' ' Stages:\n' ' dev:$LATEST\n' ' prod:23\n' ' staging:$LATEST\n')) @mock.patch('slam.cli.boto3.client') @mock.patch(BUILTIN + '.print') def test_print_status_not_deployed(self, mock_print, client): mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') mock_lmb = mock.MagicMock() mock_lmb.get_function.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_cfn, mock_lmb] cli._print_status(config) output = ''.join([c[0][0] + '\n' for c in mock_print.call_args_list]) self.assertEqual(output, 'foo has not been deployed yet.\n') @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_first(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy']) mock_cfn.describe_stacks.assert_called_once_with(StackName='foo') _build.assert_called_once_with(config, rebuild_deps=False) _ensure_bucket_exists.assert_called_once_with(mock_s3, 'bucket', 'us-east-1') mock_s3.upload_file.assert_called_with('lambda.zip', 'bucket', 'lambda.zip') remove.assert_called_once_with('lambda.zip') mock_cfn.create_stack.assert_called_once_with( StackName='foo', TemplateBody='cfn-template', Parameters=[ {'ParameterKey': 'LambdaS3Bucket', 'ParameterValue': 'bucket'}, {'ParameterKey': 'LambdaS3Key', 'ParameterValue': 'lambda.zip'}, {'ParameterKey': 'DevVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'ProdVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'StagingVersion', 'ParameterValue': '$LATEST'}], Capabilities=['CAPABILITY_IAM']) mock_cfn.get_waiter.assert_called_once_with('stack_create_complete') mock_cfn.get_waiter().wait.assert_called_once_with(StackName='foo') _print_status.assert_called_once_with(config) @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_update(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = describe_stacks_response client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy']) mock_cfn.describe_stacks.assert_called_once_with(StackName='foo') _build.assert_called_once_with(config, rebuild_deps=False) _ensure_bucket_exists.assert_called_once_with(mock_s3, 'bucket', 'us-east-1') mock_s3.upload_file.assert_called_with('lambda.zip', 'bucket', 'lambda.zip') remove.assert_called_once_with('lambda.zip') mock_cfn.update_stack.assert_called_once_with( StackName='foo', TemplateBody='cfn-template', Parameters=[ {'ParameterKey': 'LambdaS3Bucket', 'ParameterValue': 'bucket'}, {'ParameterKey': 'LambdaS3Key', 'ParameterValue': 'lambda.zip'}, {'ParameterKey': 'DevVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'ProdVersion', 'ParameterValue': '2'}, {'ParameterKey': 'StagingVersion', 'ParameterValue': '1'}], Capabilities=['CAPABILITY_IAM']) mock_s3.delete_object(Bucket='bucket', Key='lambda-old.zip') mock_cfn.get_waiter.assert_called_once_with('stack_update_complete') mock_cfn.get_waiter().wait.assert_called_once_with(StackName='foo') _print_status.assert_called_once_with(config) @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_with_package(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy', '--lambda-package', 'my-lambda.zip']) _build.assert_not_called() mock_s3.upload_file.assert_called_with('my-lambda.zip', 'bucket', 'my-lambda.zip') try: remove.assert_called_once_with('my-lambda.zip') except AssertionError: pass else: raise AssertionError('file should not have been deleted') @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_no_lambda(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = describe_stacks_response client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy', '--no-lambda']) _build.assert_not_called() mock_s3.upload_file.assert_not_called() mock_cfn.update_stack.assert_called_once_with( StackName='foo', TemplateBody='cfn-template', Parameters=[ {'ParameterKey': 'LambdaS3Bucket', 'ParameterValue': 'bucket'}, {'ParameterKey': 'LambdaS3Key', 'ParameterValue': 'lambda-old.zip'}, {'ParameterKey': 'DevVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'ProdVersion', 'ParameterValue': '2'}, {'ParameterKey': 'StagingVersion', 'ParameterValue': '1'}], Capabilities=['CAPABILITY_IAM']) print(mock_s3.delete_object.call_args_list) mock_s3.delete_object.assert_not_called() @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_rebuild(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy', '--rebuild-deps']) _build.assert_called_once_with(config, rebuild_deps=True) @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_stage(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = describe_stacks_response client.side_effect = [mock_s3, mock_cfn] cli.main(['deploy', '--stage', 'staging']) mock_cfn.update_stack.assert_called_once_with( StackName='foo', TemplateBody='cfn-template', Parameters=[ {'ParameterKey': 'LambdaS3Bucket', 'ParameterValue': 'bucket'}, {'ParameterKey': 'LambdaS3Key', 'ParameterValue': 'lambda.zip'}, {'ParameterKey': 'DevVersion', 'ParameterValue': '$LATEST'}, {'ParameterKey': 'ProdVersion', 'ParameterValue': '2'}, {'ParameterKey': 'StagingVersion', 'ParameterValue': '$LATEST'}], Capabilities=['CAPABILITY_IAM']) @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_fail(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') mock_cfn.get_waiter().wait.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_s3, mock_cfn] self.assertRaises(botocore.exceptions.ClientError, cli.main, ['deploy']) mock_s3.delete_object.assert_called_once_with(Bucket='bucket', Key='lambda.zip') @mock.patch('slam.cli.os.remove') @mock.patch('slam.cli._print_status') @mock.patch('slam.cli.get_cfn_template', return_value='cfn-template') @mock.patch('slam.cli._ensure_bucket_exists') @mock.patch('slam.cli._build', return_value='lambda.zip') @mock.patch('slam.cli._get_aws_region', return_value='us-east-1') @mock.patch('slam.cli.boto3.client') @mock.patch('slam.cli._load_config', return_value=config) def test_deploy_fail_no_lambda(self, _load_config, client, _get_aws_region, _build, _ensure_bucket_exists, get_cfn_template, _print_status, remove): mock_s3 = mock.MagicMock() mock_cfn = mock.MagicMock() mock_cfn.describe_stacks.return_value = describe_stacks_response mock_cfn.get_waiter().wait.side_effect = \ botocore.exceptions.ClientError({'Error': {}}, 'operation') client.side_effect = [mock_s3, mock_cfn] self.assertRaises(botocore.exceptions.ClientError, cli.main, ['deploy', '--no-lambda']) mock_s3.delete_object.assert_not_called()
47.178654
79
0.58503
2,142
20,334
5.264706
0.09057
0.057462
0.07839
0.09648
0.877538
0.869824
0.869025
0.862286
0.838787
0.804026
0
0.007347
0.270385
20,334
430
80
47.288372
0.752764
0.004967
0
0.748111
0
0
0.264805
0.064162
0
0
0
0.002326
0.11335
1
0.035264
false
0.005038
0.020151
0
0.057935
0.088161
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
81e5931075032dc4177e995b718be1707e0c3ad8
14,751
py
Python
paypalcheckoutsdk/orders/orders_get_request.py
taqma/Checkout-Python-SDK
ebb26e78408cc70a159436b7b43ac249cc169766
[ "BSD-Source-Code" ]
null
null
null
paypalcheckoutsdk/orders/orders_get_request.py
taqma/Checkout-Python-SDK
ebb26e78408cc70a159436b7b43ac249cc169766
[ "BSD-Source-Code" ]
null
null
null
paypalcheckoutsdk/orders/orders_get_request.py
taqma/Checkout-Python-SDK
ebb26e78408cc70a159436b7b43ac249cc169766
[ "BSD-Source-Code" ]
null
null
null
# This class was generated on Mon, 02 Jul 2018 17:09:03 PDT by version 0.1.0-dev+0ee05a-dirty of Braintree SDK Generator # orders_get_request.py # @version 0.1.0-dev+0ee05a-dirty # @type request # @data H4sIAAAAAAAC/+y9fW8bt7Iw/v/vUxA+F2gMSHJsJzm9AX7A49hu4tMm8eOXHlzkFhK1O5J4zCW3JNeyenC++wMOyX2X7TSy2jT8I61FcndnyOG8cWb4750PNIOd1ztSpaD0aA5mZ7BzAjpRLDdMip3XO5cLudQkBUMZ12QmFaGC4PgBma7I2cloZ7DzfwtQq3OqaAYGlN55/emXwc47oCmodusPUmXttnNqFo22f+9crXILmDaKifnOYOdnqhidcqgDPGbpzmDnR1j5xg7sVwsgZydEzohZgAMaMVguWLIgRhK9kMuAm8XjSCm6cp9+Pti5AJp+FHy183pGuQbb8GvBFKQ7r40qYLBzrmQOyjDQO69Fwfl/fnFjQBv3Ettom3QuhQbXVuL20cLTRe1hlBwivwds31CH++G5ThRQA2PDMmjA1mzvgplSA4SKlNgRA8IE+XQmDCgBptln1ySj5pdnC2Ny/Xpvz0jJ9YiBmY2kmu8tTMb31Cw5PDz8779pSOw3hi9Hr3ZH5BISKVJNqAKiPJp2eTmQmaI4knKia6Nk7hpH/1s8f36YTLlMbn4tpAH87f6baKOkmLuWD9LAa9e8V28nFkcF84JTReAuV6A1k4LkSt6yFDSZFyylIgEyLQxJJWgipCEK/gWJIZRzwsQt5SzFydAenr02QF+4vEiWg3KN30sBq+4Sz5XUekwzWQjTWONWR3eRk0IpEMkKF9ONc0yCzJigImGUE6Oo0G4xBkQXyYJQTSiZUo7TIxXJ6SoDYUhawBbo2YM8TmTaouhWTxfdT2ahAIbJglrqAkXOLj8OXxzs/72aCPvsL8/2UpnoPSYMzBW1L9hLmYLE7CnQZi8MHtrBem+XmAU1hKUgDJsx0MivwqBNMKbBg7NyS3nRnI3Q0p0F7Bl4Npqx+cKQadgjBa9vJM7cryNBcC48A/aoWUw5uwEy+cf5/0zcJNg9aveJWeUsoZyvahs57JHw1tY3SAoJyygvn+j/1tWHk9q3dDFNmd2wqYVQErOQhaYiNQvd/7m9gOEPUuE6lXxHFNkUlBU3AZCc0wS81GxSyIBoAPLpOLQdW0L4XLLZiMh6BG205Cz+fFDSjjbLudbCJgy0mFbZ1IXRdVnRD8wsQJGE5qZQUHIglmWQMmqAryxjooVZSMV+A0LLIXUdiNCZ5QLubxSITIoNY/4TEzekjkpnDjgTN7oxBaGlOQNHglALl10n5fSUoQJODaTk07ujq9OPR5cEHw2USHO2J29B3TJY7v1tQQ1Iqoc4ZHdEriRJZJZzMJZbaSMzOyO5lYCUD0ihAclh4ppggu8mS2YWrv3t6dWEZGAWMkX5kUrc+uE5HI0bVaMSis9cnJ6cXZwelw+2JvvV5uUFiARH1Oe3auvSGBKQ5V+W3Gq6ZjHNmCk5BmjUguiWtslCwayBgW/okehhRQ1VczDk+uInXOmM3oCH3lGM5c4DO3zKhOvxS+kXmGny6frijFxBltsnhk7NM5A+qOm9evn357u4/iNi2WyuYJgrmVgVS8ytLpnwIvXU9V+TAZk8mwyQhCa7E1JKZz1CJW1icZ0Q5ijoBlYk0LrFVQrkCJbMkK4tp/ZT4HB0+FC7gNounDDYvKWFQ2rq0F+99T4KHFhVK4UZE5Bac+3TxQ/H5OD5i1fVEiyXy2oB1Cyx/+yIkbkzuyPPeKZeJ3FbEglja/hbmmoh75u6mL+7ujoPZFjKZbOGeLeEgQLeAN/97tEtcXIRQKu72OV7cKO8/O/vvy9Nohe7QSfToG5Bo5otrFx2CkjFTwtBsymbF7LQfEXSxhJryKgwLNFBmrtteGnVFRRFFx5C3aIhKijCRrVmc2FFpd6zzw4DSu2fozuLxu5TiMvLZAEZ7a6FDu3VcpRN3RWp82mrDWyQ+iuxI6fWIOyCStOUObX3zEDWFO/dvibwm53RI87Jxxmxn+oBk/OPTckSWtbrHrqYDt20ew6NE5wV2hC0iNE5MKdMaGco18d/obhvoyZW96AmVm3UfMtmUJMCjd9MOjPkiVBcR18oFZCKmrTVbH9KuloPWQ4idTZbC7RGx1PCto6ZzxSdW9Z2AVrywqvjFYS93X/EHLIOz2C9nMIa5gayJ+DBmzFTcMSGd8R7qx6t0bS6WtZDOr7VOhMpDNyZIYhEpkzMCW7lLfiypkxQtTr1n20A3+nqU/XRHO6A7YT9+4IblhcqlxpI6bl9Txknp3cGhLYsgjx7f/b+dJecU2XIRwGvrb6eUWPXrnoGtKZzIG9kykA/qNQcPH/xcndLyplpa9bmYaX6d8/P1VK+Jkh9xIL1qJl4tZmZ+OURPEPIph/F/X5K7vVRwHrxKwW0xG9o2Zz4rcZvmMeso7ecmsWloao50/XWFuVJQvOcr5w97UAl6KYEYrGgIgH9Hbm+ONMDou0rsMv+rtnh6LAdbUfy5NbEV6L2ZAvTTu8fIR/zNeA9LVy/PNZOcUbGZddaaXVEmyXaLNFmiTZLtFmizRJtlmizRJsl2izRZok2yxPZLGs5EjO8xZJ8S5cnOYPEdm+cSRz7GIS+BV5hc31RXUtfSJuPZFgupI9mAI0iM6crF8xTBbmQxhNME8q1JDdCLgWh7kANv7Q5sXoulbGYkXOpDeXkKE0VaMu0IWVFNnyrKBOQ7vZaZ3Zk2yrzbd2JyMOXGAoK6qMpc/dd/+SIvKe5ttv7k4fkZ8e0mBTvwVDLzCqZMWdmUUxHicz25lLOObD978UeZ1P/Nibywuwt2Q3bW/u2XVyLd1fvfyIvR/vk01Fh5IxxbpWBmVQZqghKcv0ap58WRpYxDdQYxaaFgebZ5fIQRdjVBUqxl/t7GhIMV9Aj2/A3Wn0Cm4fhE0OzgGH9C8PyC7ubW/KwxCcu5Hftyo7TckBnhWt93ZUWUgzL1a4M9bDGZfh3FTUnMzAsA00EQAqpi7Szc8Asdx8QxfTNwFqKEsOsdAKCKiY1WS5AAZkxAcO5pdTyG0y4+BAmRRlT6N8+Ih+kqcgRZUQis0wKKyqU3ZjKuBBUmYPQslAJjMgFpIVIqTDhCfww8FS7qBK4o3bRBmQS5ih8YhQaOBMw3sfYkUIXGI5IfciLg1TOqqdDRLY2CsCMXTjgxIWlhDaaQbPFKmeTLSjdBeNWXUYImjp3q6elqBDbnBIuE3do72hAQa5AgzCexSnImIYRuS4nKbwWn7eEEKIjLZ1w7kIW7PSFgTrE2fiVbT7XWjEXipnI1EdJHyt6C4K8k4UOYZpV55bU8hQ4uwW1GmtQtyyBlhug09kTMe8HET9ohDyeyNmMJUCm8m5ApnTuZwR3V17rtxO2JVRr1NyMpWi0dxF0/Q5S8g+r4U5OVKFWE8KE/5P8RMWXb4jPxAMntBeT0LMeF0eeW4W3YwA229fC6gzBxkay26aAAZnKgsMtVemAKElTJC6f1LCkq22hV0zHgR008Wt2dBGcMaXN0IXhgjDMrMgUuFwS6vlXyY6kKnlZLyuz1lUPO9NMzDlUr7G8ygqvz2BmI3JMhRVqlMw4Ndb0kWo1IDMupbLTLjOcdmqlWQbCjLalvjelXa/2UHatmXur1kOIGCtVwwapVQLAkWNbCO///ZDUWQAJyKFygUYxCKNW3nsVdA38adUNkiwgubEKqWUsVkOz6oWFZ1bwSl/dDik35u1g/ZQe9O9XTFh6xJzqghloEM12GVIDl8P1aB72oumUtx4sB4TNSt2vya8CL3MKdxmQ/0bR3xgfEJcugZsb7kyVbjQRcIdx//+kPKPKTNxWI5yKNKPqxgogKsiZSBkVW6eVjIkxVUA7m6/R0Z3ABZsvwG4+uAV35JSyW4ZpaJ45FXbHhLDQhhaLeWqoq2tDDeB8nF1+HB7uv3o1PAh5MfZdo+AfnXmNg/JSVWlv4uMjp94KacjkmHI2k0owOhmRn13S0HRVQcX0vUlD1z+OyJEbvbo/9ef60o5EPO4feEwFTakdHNC/f/w/aE6FGw4zSEyhHnjgcsnMb6AsWdnHbqgwUjyQSLR1KjtYR2UHPfp/wsxqQIxcCiSRW8Y5ncOIXGaUc1BWiAprA5UvQWIc70+2v3sO1+F12IOX3S1WE+CIny6mhZoOiAA2X0ylWkjplKCU2Q8n5kGEDwKNP0TWjlWNyKX/5JQypSR+rP71++kMGRW+o0SiBW2lajdMa+bSUClf0pUm9JYyjkb1tDAux6H3fSQJqouzT+xUEIv8n420X6wjgRf9jo/Gci9R//2cRT+c2OETq5+GaXssGTgPGzJTLZWxSqU1WX0qqOXUmJJI3haghAan9mRUrMgPCkSyIAaUYkYqBrqSc77vbYHh+PeSkNPdgh8GUoLYWcypYbfghIq2IBwvmPhzrLQXHT2pu82OvszdpWzm7RKUdPuPS9h1r78/X9eNsQShYM5Ktv+FKebhtUgcVgK/VUANeaMY6rdMd5whb990XCClTG6Pvf6xZ2xFfBYvI/OhUzBSmdlPWp4S/ODUBACtteQzso4PJl2wkYjIUiqeLplvs0ocVch/CuF9qhxSkiuWAHl2fH2+67N5LJsUNyTBHYoGgJJaD6fO5KtlmG8kkf53Z1G7Dd0lz2Z7n6sdGYHLDC6VNTuZv7HczaFVs34t2C3l1jQkV2V+tKqbSW7aLUl6A7T2ZuISV+tvwUPh2pDKLQ5itGQ3LAcrZ6SaO6f8eYXH7tbM0ylTZjFOqWk5LuvNfT4PKtIh5VK4UhRPVIHiSlYeBKJzwIoHHOaUuxNMXS95gB+VM4KgD8hKFkQvZMFTzHnFOhBu3YQkVGuZMExWQxDtdmMZDH/zCNER+ecCBNwCKuWaTa0CHnJnEXuqUjJJQ5GOiff/XC2Y7itcUZaoqE6dOffFKZpa/g8wVQVVK3K4T9xJLUsDh1lYQcZ0OAKbysKaJzQnK6BqWxYVZJTxcd95V7unP0W8POxiv0FK8JnSJvxipn6dWzv01YtaniqeqVDO5RJSMoWZVI42D16+XDfKJZ7bpW6z9P/T5eiazcWIvJNLSy0DfGoOApQzBZMEcktmGb1jWZERDmJuFiHPvYG9XdmDly86Kbb+iNxqh0EgUmOfLgROUvpYKAncMW22VA1lLfncIQnwdoGhZnuXdEI/Xw19FZi0VhUhnBJveA98cM72dlxM2zW/1ifvzllm/qhamdXTH0ZR7rYYjGcF591jhP7+Jugnp+cXp8dHV6cngQKVWX2nSfls2+c6LTQTloRt+4AIlty4v5DMV/6gEmfDqTVUWGY4BaJzzoyrDoK+zgHhVIdTjIaTsvYVdyS5xTOZ/qlcP4E4aaC0FOXcoZ90iyDP2S2ILsyN5geBxtG4in5xtohAxtKUQxeDZvuDKLjhnqCsFo1BJEbiCQGQDIP2ONTHaV8DwUpbt3OtiFllLHFTQS01f6cHjXdvZ1JyBTN21wpR8k09U4FdA6feGKtd+EixrW8gXczacJdNPeoldpXRQGEptwqv6h7Alm0PEp0f6qglY9zPNTnqBDD1cTtWExgY9uRffy/9+k+2aTdr0m4mA+368VszNDBSqy30a43dOT2nq3PKXYgXOTup2W6UZFTfQGpVIu1PB031BE3QUguHYliXKMTRWB0+xEH64BYGXtFqP2c1efzClK8IiEStUJXDamwkVzJXDIxV1W8tqgJjnN9QDYcHpY/JSILB1KFAhi74pot7nC+k6FFSct9cm2zf0kO9tqfuydxgRN090PXFBrQ61sEawjSYIMxoq09IYU32Vjjdp9PR/qsXfrTdEjmnomOQYoUNU4yYMHsKkr2r4cXp8RAf3QPxpZXAPj2h4610BFEXooeU9uz4eHdLM+OdaFilKA22jd+Mx8fOBYBqsP+q31kYf+0VwDlWuvRO4P2XJGVzZvyGbD+XSKGtBWM/QaveFLQJMWNuBj6cHLtIRl1MXf2VMkbq2eWH3e1U/YMQ9N9H5z2d/TYPDtruwXOY2D64u319Vk9j2f4EtLh2n/ylSfRRYhn5bSfoqdG8jgmjy2vT+sMVvSNnlSTqS9+9G1tR1UrdLRt7QiHsK7uugu2Hl68N8bfQp12E0ntj6L/THrMRuSzyXCrjdRzTUJ4wjMOX7ZKCr2rubeet8tPDNNnfr3vEuHRB34QJrOJZUO5C9fdf9A4L5jlsyxPp5qhLvM32R0xgyOL6nFncDN3XKf+8UMmCaiDXgvVlqPjucSGYaWWptLvWJ0SFoQSHjsgpTRbNRgLa0ClnegGuXp8wdqnJFMwSACNfynKUIiUZ2GeF6X1VLf7P1wSlzhGCdYmVYZT7+p7oFjKNDYlqO2Y/lC+dKZn5aoj+qxurUHnk6iujbfBGAb1J5bKH+/TUcb6ngrORpsSQ1j5ARVkrm0zDx9wclCWufcR7dcRhyhcyA5l/38A3WUIOLXrB8hxrOS6oSDn+NWczQ5aK5lYa60K5TAIsDMo0ikcXGEZFCAeaqj0fDjFzhyk5JGy2IhP3mVEJ98SxEY8f/Ip8YmJhHCNsE5LzQpOJ3ZaNhgBn+B2gDb8tzGMLc2goIZ+QjIn6K8YBi0kb+qsKNJTp6K/MpWZ4Du8lLi5KWVhYQeLivJyl55jAUJfcwX2BkoWC2f//vztBQUnhFrglrVFOVznlmInzOTWH/3fHgRyavZ+ebibSvkPq91D5tNZVOxSstXZpvaLjEG/o6KT6Toe2K9LeBllvbP7WFXoP5NpyuFatscR7LPEeS7z/ZUu8r+ELgVs1S0RXjZErRK4QucK3xhVKdaV1vULVGvlC5AuRL3xzfKG0mzvVusrmyBkiZ4ic4VvjDMH/0QxKqRojV4hcIXKFb5UrlB7wXvZQ7418IvKJyCe+NT5Rnr51jsqjVRH5QuQLf1G+8JgYsLhn4p6Je+ZzoiZdkFI7Zq/e2qWRo/MzjD8FVSUwhqRGDOK79gkDChIpEsYbj+AVDC5huZaP7wJXfJRaI1GfHOU5UIUlJmodLuIUjPHlnRTkUhm9tSqO9YuW6wUc6+094aYh/qs2cGtXYN9KlkB7qRvNn7nW/tlwdygW5HYFjzeMU38Z9c+4CaKMGsQRfTF6OqwNFgh+uui8tRuRGphLtWruw6qxJwXdQEbCiM2FMD8d8btYKcuNLeTb3wGPz3ZGAEPe2+aqkD8M4q8FxbqUDTBrjWtADSN8VUOMDFwuJIctFx69KZo+G/zdV3RDJjfkBiC3mw3ja59d/ni9W0YrP8HFLeuNybYZGQ3IqAxHZfgbdCxZRjTuCYtvtkfeEHlD5A3fnKFcqKa/2f3u0sX1xU/W9EW1rJ6H7gpq2V5as2dbOVw183bBsPD3xrMSz+kKoL+oAXQqGqy7L8wZRXj1jYIE2K3frrNCpC6zblbwGeNcty/BKZ9dm6W4Qe53wnTO6QorB74PH743JTN1T4xTapoX5rU67pmU1qI/DuXSyeHLmtRyx1zBclmYQcMvMvAlt3D+c6NdrsgTUNAjbg1RVKQ9V4bUm++vKFWl3j1qHoKo/EPm45GyJOSQjhGs1l0qra5YXu4bLi+3pq5ISSTd8iedrq+utsjv01ljcZFYXCQWF4nFRTZeXOSXWCw2SvMnrgHpNdz28VuzPZaO+xK7Fm2CM6GNKpJ+884bDmPWGNSweXv626eJq/rll8EWqT3inB1+HdyfygjL9bw1o0fkVFiwNJkBNYXy/pHcjdP+Egd1A8Z5TyqXYQqcrgCLAkwLpd3Zt7vqqn7DGLXCweA9pzNvXnK7h9JCuevNUguOZdili4jmFpA0IKTxhgs33PfhiwuzkAp5WBj49JpfHdlx1lb/+np77h9D10Tp8loAT4kUZAoLymcdO3TDKn5Yix96XS++dzyD9p3NrZ71x9p288nCkpMllkRmGcNy7XpADMu1u65EOhGkN3eYvcaR/nmlZaL7PLrPo/v8r3K0FpydVgf4MjdzKK0TggK+GrdzNCGiCRFNiK/FhPil14w4LtXptVaE7jMd9BoHZF05D0NdOfvGGYZj883Sg+7OUc/MmtecdpXxQVeRdychCpBLbrD2mv/4mpM0Wu9uTlWna71e24Nh3xzh3ZuNSUuoIAt6C+Q3UNLVi7ds6kHrJSrDURmOynBUhp826QI95XjdWnO/NNp7NOL6bXRPdFPdJV4q7rS6ciWWC8ahRjj+6nE3KtR/3cxFlj1XzpXFNucFS5HFTQtTXUSn4F+QGLyGjgl3y5y7ju4Pvh0sZ47kuuvc7Ytr/TWvdTul5j49fOhMHOMufQu2bVcx+VNnBQWTY5jCDM8Ra6iEpKAyI+jJcfuJiRty0kg+aWHJmbhp6qChZb3qqYDjKn16d3R1+vHokuAjQaTQnO3JW1C3DJZ7f1tQA5LqIQ7ZffpkIRDJVbtWfNXWt14po5giZBmJ0zOMtLI6Y6YUuqCNuzJ0O6S3UDBrVhJ1DX3mk7V3DBBD1RwMub74Ca9UzehNMAjdWlkFZxBOt73TCAvdB1NVk0/XF2fkCrLcPjF0vNNA+iD7fPXy7893kQacEZYrGOZKJpZvifnAX1blrzb+r8mATJ5NnOU12Z10PBMTi+sk3N57AysSqMziKgVGt1mVCikKi9e7KXA4hmt7dTHVduGEweZt3WdnqalDf/XW+yhw4I6xHN+Yrsinix+OycHzF69aMQxhAdQssf/siJG5M7sjv9WnXq23M+QJY2v4W5pqIe+bupi/u7o6D2RYClmzhni3hIGCZkSi+91jnuHkIoBWONvle3CjvPzv778v9YwXu8Gs0aBuQaOlKoK4oH7xLKEXgmZTNi9kofnKJweGJdaQUWFYooODym1DvJYamf+Fh1C3aIgKdys11ZrNBdr7e/bZYUCp/XN0Z9HYfQoBdZksIKM9SXOhvZY3F5q6K1Ln09bS3yD1V2JHTq2W1ePKKI+9zzqpt92+JvCbndEjzsnHGenPC6acf5y1rop1LeulvS6mQzftnkPjBGN4U3XR9ZwyoZ32WR//heK+jZpY3YOaWLVR8y2bQU0KKJ1lT4fiOvpCqcC6DsNm+1PS1XrIchCpc3u0QGt0PCVsa6/0VXRuWdsFaMmLTkxLb/cfMYefka7/BPm/lgdvxjDAERveEe+terRG0+pqWQ/p+C4eSBi4M0M8NmFiTnArb8EdPGWCqtWp/2wzcL3d1afqCwOiC7YT9u/xjthC5VIDKd0h7ynj5DQEAWvy7P3Z+9NdjLoiHwW8tvp6RvFYqXoGtKZzIG9kykA/qNQcPH/xcndbl4F1bgF7WKn+3fNztZSvCVIfsWA9aiZe7W48em8dzxCyeXLifj8l9/ooYL34lQJa4je0bE78VuM3zGPW32dsFpeGKtM6z6xaW5QnCc1zvnL2tAM15GtZLKhIQH9Hri/O9IBo+wrssr9rdjieeYy2I3l8HEDtyRamnd4/Qj7ma8B7Wrh+eayd4oyMy6610uqINku0WaLNEm2WaLNEmyXaLNFmiTZLtFmizRJtlieyWdZyJGZ4iyX5li5PcgbJxso81sG7BM5BkXMlzbpwYo1Dxnl9SO0sqKe3BwO4BY6xxeU4ImczUJC2j1t9cHcHMDyRC+kbrYO02jXQhd5bwpTmud7L8nxPQ1IoZlZ7Ds5h9f3dreQF5oWBsS+C2tFz+7rXM71ECmcO1tIEE3mLcxiCW2qht1vidNpQUzTxKpuauJyJlFlUNVkuAK+ob0FMmCbA2ZxNuQvPcWtWo5nRtnbn47Fy9UJt1x8fLFXkaW/cZrM9xvL9eWP56rR57BIl+koxY4dulWIuG+9hIZ0k6i9IVui8LKYqxFSFmKoQUxViqkIUeRut5/+Vl9eYSsmB9lhWVg7xcVLK+ZqDudXzkCZdK/jSlfFWfE+BZDStnbeIPjWV/GzZJ2H6Xo7ZTkq227eTlzwi/yML+2lLVxhL2gUsALMuDJ/8cwGCCGkpmLOEmZ5BPvV5YG1IWnDMoH8cgPdy7PYrcJXXI+kwvHcVHkL2fo7+tSSKtPH+6tJEPCsIWSJO+9GEai0Tdy1Q5W97YmRj3kjMG4l5IzFvJOaNxLyRmDcSY7BiDFaMwYoxWDEGK8ZgxRisGIMVY7BiDFaMwYoxWDFvJNos0WaJNku0WaLNEm2WaLNEmyXaLNFmiTZLzBuJeSMxbyTmjTxJ3kh5jcwF3vOCN3i/UUBvUrlcvxVUOXg8rQ3ubIo149ZdQWM3QBhWXpW54dCkimhP7yzmcyAX1EBfXWnXPVauu15VutnTd1Gqf7Ud4Yg1BQMqY8KfmPswfiMtVd+CMmSmZIayuoxhNpJQIZFQflec+u/asloWKoFx+GBzVTt9X2H0/hfo0OgR65+abt83NTWfk9ngY8SqrBbcCiNy+mvBbikHty3sTsCcHc8HHO1VeHn7yzj5GRIfpCrzAhAApxvadxlZXZUbFEuFaRX+A2U+gWRi87dmrkkEmiup9bgnHajVEZOCYlJQTAr6617m188dBJg+3tBojpwhcobIGb41zuDs/fGse8dn1Rw5Q+QMkTP8ZTnD0991Xt5sX92Y33fvuVRkquQNKDoH7Pfr1Uk0e9CZEwstRP4Y+WPkj/GC9HhBerwgPV6Q/s1dkP6g3Vc7UOtRbfp6o5YTtZyo5fzFtJwnq/z4RIfuLYK+dB87cWrVOtDHadnfRqHWtV5bW4OLR/XpmZYCqluxQmVTXw6G7SLLxeo+qK0Ympyffjg5+/B2Ytnw5OT0w9npyWRrBUVjac6/UmnOC7AWSx/toiXTIt7Qdl9NHmcBfUE1Tv+K6BqKSlNUmqLSFGtwRtn256oM6ATU114P0GGDHpEnQCdW/IsV/2LFv1jxL1b8ixX/YsW/WD0jVs+I1TNi9YxYPSNWz4jVM2L1jFg9I1bPiNUzYvWMWPEv2izRZok2S7RZos0SbZZos0SbJdos0WaJNkus+PeUFf/WgSekgbGRY0xPabOLRs/a6N0nDREpE9rO6eqRddpyN/L+Im19g7oYdgqzbQbHT7FCUgzZjCGbMWQzVkiKnCFyhsgZPpszfABDjtweLhWiNXZXxRbWaERrBqy3yiqtCMmrKhFgDeZQ2PICTKEEhmuDaOySpi5FmCYpw6LQwteD7RvcyoleLkBBsyzBQvIUtyNTZDvJNL6ILaR93LinM/LkyJMjT/7L8uRYWjuW1o6ltWNp7T+ytHZwa/UoJJ2uqI5EdSSqI3/hIimxjG7kDZE3RN7wVZXRvfc0MRZEiUwwMsHIBGOt3FgrN9bKjbVyY63cjk9RGsrHTnnqP5haNyJqO1HbidpOrJn7e2rmfs2lcn0YwldRINfDuvDKYLMo7g9HZz+dnkw2hEmsjfsN1cb95VG1mjBGp1uWr9XRXemj8zMsKuUuYnf8GO7QSOD1GoOtyrkBcOzPMDuHtwZpF120koVLCnE0V1lUxCyULOYLMjk/ujp+N9k0n1qwPGdifg+n8iOaPKpq7OGv4Z2eTW2OI51LZTCE/lxqQzk58hbJs/eQsiIbvlWUCUh3e3OXO3bgfRZgHr7UMAVJ7r4b7EDynuZ4dPrJQ/KzS+lhUrwHQ1NqaLXn58wsiine9T+Xcs6B7X8v9jib+rcxkRdmb8lu2N7at+0iS3l39f4n8nK0Tz4dFUZaE9zONvoqEymMkly/diEVhZFlxT9qjGLTwkCzstfyEFnQ1QVyoZf7exoSLOanR7bhb7T6BDYPwyeGZgHD+heG5Rd2N7fkYYnX0qefvV5R2u3rrrSQYliudpXGXlq7QdZWKpnMwDJ1TQRAsNBwDphlhgOimL5Bv7ALVNEJCKqY1D7kb8YEDOeWUiuLWjgBYblrUFj920fkgzQVOaIVmMgsk6JmDDr7RuYgXEyA5TxpIVL037gn8MPAU+1qLsIdtYs2IJMwR+ETo9DAmYDx/sRZhYVzE/iCkA5SOaueDltdGwVgxk7XnLiijaGNZtBsMascJltISS0YT5mYIwTNjNRWT+swgNjmlHCZuJJ2jgYUWEkIwnh3loKMaRiR63KSwmvxeUsIQfW2dMK5k+8YhuoH6lCF0q9s87nWirW9KMeK3oIg72ShoeNQ2VKwSwqc3YJajTWoW5ZAK0m+09mn0rpBxA8aIY8ncjZjVsGQdwMypXM/I7i78lq/nbAtoVqj5pbaXm/vszpsv4OU/MOK+smJKtRqYvVG9yf5iQqYbBkPnNBeTELPelwceW4V3k56dLN9LawuTbqxkey2KWBAprLgcEtVOiBK0hSJy6u7S7qtcDFdTMeBHTTxa3Z0EZwxpc3QKYsgDDMrMgUul4R6/lWyI6lKXtbLynQxHfawM83EnEP1GsurrPD6DGY2IsdUWKFGyYxTMyDaSLUakBmXUtlplxlOO7XSbGM31zzGJmhKu17toexaM/fEDgi2eKkaNkitEgCOHNtCeP/vh6TOApqWA6aMgzBq5Ws7BF0Df1p1gyQLSG6sQmoZi9XQrHrhTmt4pa9uh5Qb83awfkoP+vcrmrKPmFNdMAMNotkuQ2rgcrgezcP+kE9U3nqwHBA2K3W/Jr8KvMwp3IixJY83iv7G+IA4XxxubrgzlS97IuAOA0j/SXlGlZm4rUY4FWlG1Y0VQFSQM5EyKrZOKxkTY6qAdjZfo6M7gQs2X4DdfHALriBTym4ZOig8cyrsjqkdwFRaLNrwqKtrQw3gfJxdfhwe7r96NTwITlf7rhBUixPtrb+gqrQ38fGRU2+FNGRyTDmbSSUYnYzIz84jPV1VUDF9r0f6+scROXKjV/f7la8v7UjE4/6Bx1TQlOJ1Ph79+8f/g+ZUuOEwgwSdpPc+cLlk5jdQlqzsYzdUGCke8FJvncoO1lHZQY/+nzCzGhAjlwJJ5JZxTucwIpcZ+oKsEBXWBipfgsQ43p9sf/ccrsPrsAcvu1usJsARP11MCzUdEAFsvphKtZDSKUEpsx9OzIMIHwQaf4isHasakUv/ySllSkn8WP3r99MZMip8R4lEC9pK1W6Y1sw5KClf0pUm9JYyjkb1tDDuBoDe9+F9V6i6OPvETgWxyP/ZSPvFOhJ40e/4aCz3EvXfz1n0Q+ezt/ppmLbHkoHzsCEz1VIZq1T642ZqylNoJsjbApTQ4NSejIoV+UGBSBbEgFLMSMVAV3LO970tsFj9vSTkdLfgh4GUIHYWc2rYLTihoi0Ixwsm/hwr7UVHz7lws6PvWHgpm4fCBCXd/uNOg93r7z8MdmMsQSiYs5Ltf+HhQ3gtEoeVwG8VUEPeKIb6LdMdZ8jbN92YkiCT22Ovf+wZWxGfxcvIfOgUjFRm9pOWp4QgKWoCgNZa8veVHB9MumAjEZGlVDxdMt9mlTiqkP8UwvtUOaQkVywB8uz4+nzX33Vh2aS4IQnuUDQAlNR6OPXnA1X4wkaOWH73Eb3b0F3ybLb3udqREbhj51JZs5P5G8vdHFo1q0yFGpGr8vBd1c0kN+2WJL0BWnsz8YFMtbdgybTakMotDmK0ZDcsBytnpJo7p/x5hcfu1szTz7sgpTx5cWPaCur15fnlOVUJ8E0rKB+c16udt9/2ka11jjmH58zHByqzhaxOyt3BDoytidz15/X3N0E/OT2/OD0+ujo9CSFwyqy+06R8tu38mBaaCdAa2wdEsOTG/YXkufInBjgbjr9QYTnXFIjOOTMuBgSdDgPCqQ7uxIa3oPYVdzawRedo/1Sun0CcNFBainLu0GGxRZDn7BZEF+ZG84NA42hcRb84W0QgY2nKoYtBs/1BFNxwT1BWnGHkrpHoqoPq9Lo2TvuruizHcTvXCvBVxhI3FdRS83d60Hj3dibF2qzsrlVJzzf1TAV2IdBYu24Q0mG3voF0MWvDXTb18HvsqqIP/FJuFV7VPQkp2x4kOj/UUUvGuJ9rctSJGu/jdqwmMFyErXv9vfTrP9mm3axJu5kMtOvHj7YXpqLlzIxTP3WydTbT6euZ4xCuWg4jMtSv0UZmFi+SKEjxLmflAsecO1HOynjihl65LXXn8wL5nAK8wWCxGCr2TVyjvnPsykz7taZ5zpk7Ftv7lwtjfGdM/t7p2a933p5e7Qx2zqlZ7Lze2bs92MPDFlmYPSRAvfdv/P+Ypf/ZGexc3rC8/PrpXQ6JgdSFgx5bE+j1wfPn//n//h8AAAD//w== # DO NOT EDIT import braintreehttp try: from urllib.parse import quote # Python 2.X except ImportError: from urllib.parse import quote # Python 3+ class OrdersGetRequest: """ Shows details for an order, by ID. """ def __init__(self, order_id): self.verb = "GET" self.path = "/v2/checkout/orders/{order_id}?".replace("{order_id}", quote(str(order_id))) self.headers = {} self.headers["Content-Type"] = "application/json" self.body = None
567.346154
14,044
0.953224
526
14,751
26.712928
0.922053
0.001993
0.001281
0.001423
0.007971
0.007971
0.003416
0
0
0
0
0.15013
0.010643
14,751
25
14,045
590.04
0.812663
0.96929
0
0.166667
1
0
0.167442
0.072093
0
1
0
0
0
1
0.083333
false
0
0.333333
0
0.5
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
1
0
0
0
null
1
0
0
0
0
0
0
0
1
0
0
0
0
7
81e67a207c368e3e459b974be361a089d84b4cee
3,600
py
Python
src/test_SocrataDataFormatter.py
usdot-its-jpo-data-portal/datahub-ingest
c095ccf35574ea0402a976223e723921e1abd762
[ "Apache-2.0" ]
null
null
null
src/test_SocrataDataFormatter.py
usdot-its-jpo-data-portal/datahub-ingest
c095ccf35574ea0402a976223e723921e1abd762
[ "Apache-2.0" ]
2
2021-01-21T21:49:22.000Z
2021-06-02T01:20:20.000Z
src/test_SocrataDataFormatter.py
usdot-its-jpo-data-portal/datahub-ingest
c095ccf35574ea0402a976223e723921e1abd762
[ "Apache-2.0" ]
1
2021-12-14T18:05:52.000Z
2021-12-14T18:05:52.000Z
import unittest from SocrataDataFormatter import SocrataDataFormatter from UtilsTest import UtilsTest class TestSocrataDataFormatter(unittest.TestCase): def test_getSocrataDataObjects(self): test_results = UtilsTest().get_dtg_mock_data() test_socrata_data_formatter = SocrataDataFormatter() formatted_results = test_socrata_data_formatter.get_data_objects(test_results, "dtg") assert len(formatted_results) == 2 assert formatted_results[0].dh_source_name == "dtg" def test_validate_fields_dtg(self): test_input = UtilsTest().get_dtg_mock_data() test_socrata_data_formatter = SocrataDataFormatter() formatted_results = test_socrata_data_formatter.get_data_objects(test_input, "dtg") doc = test_input['results'][0] data = formatted_results[0] self.assertEqual(data.dh_type, 'Dataset') self.assertEqual(data.dh_source_name, 'dtg', 'Invalid dh_source_name') self.assertEqual(data.dh_id, '{}-{}'.format(data.dh_source_name, doc['resource']['id']), 'Invalid dh_id') self.assertEqual(data.id, doc['resource']['id'], 'Invalid ID') self.assertEqual(data.name, doc['resource']['name'], 'Invalid name') self.assertEqual(data.description, doc['resource']['description'], 'Invalid description') self.assertEqual(data.access_level, 'Public', 'Invalid access_level') udt = doc['resource']['updatedAt'] udt = udt[0: 19] + 'Z' self.assertEqual(data.last_updated, udt, 'Invalid last_updated') self.assertEqual(len(data.tags), len(doc['classification']['domain_tags']), 'Invalid number of tags') self.assertEqual(data.source_url, doc['link'], 'Invalid source_url') self.assertEqual(data.metrics['downloadsTotal'], doc['resource']['download_count']) self.assertEqual(data.metrics['pageViewsLastMonth'], doc['resource']['page_views']['page_views_last_month']) self.assertEqual(data.metrics['pageViewsTotal'], doc['resource']['page_views']['page_views_total']) def test_validate_fields_scgc(self): test_input = UtilsTest().get_scgc_mock_data() test_socrata_data_formatter = SocrataDataFormatter() formatted_results = test_socrata_data_formatter.get_data_objects(test_input, "scgc") doc = test_input['results'][0] data = formatted_results[0] self.assertEqual(data.dh_type, 'Dataset') self.assertEqual(data.dh_source_name, 'scgc', 'Invalid dh_source_name') self.assertEqual(data.dh_id, '{}-{}'.format(data.dh_source_name, doc['resource']['id']), 'Invalid dh_id') self.assertEqual(data.id, doc['resource']['id'], 'Invalid ID') self.assertEqual(data.name, doc['resource']['name'], 'Invalid name') self.assertEqual(data.description, doc['resource']['description'], 'Invalid description') self.assertEqual(data.access_level, 'Public', 'Invalid access_level') udt = doc['resource']['updatedAt'] udt = udt[0: 19] + 'Z' self.assertEqual(data.last_updated, udt, 'Invalid last_updated') self.assertEqual(len(data.tags), len(doc['classification']['domain_tags']), 'Invalid number of tags') self.assertEqual(data.source_url, doc['link'], 'Invalid source_url') self.assertEqual(data.metrics['downloadsTotal'], doc['resource']['download_count']) self.assertEqual(data.metrics['pageViewsLastMonth'], doc['resource']['page_views']['page_views_last_month']) self.assertEqual(data.metrics['pageViewsTotal'], doc['resource']['page_views']['page_views_total'])
57.142857
116
0.697222
423
3,600
5.685579
0.158392
0.162162
0.189605
0.059875
0.866528
0.850728
0.850728
0.850728
0.850728
0.850728
0
0.00395
0.156111
3,600
62
117
58.064516
0.787689
0
0
0.673077
0
0
0.238889
0.011667
0
0
0
0
0.538462
1
0.057692
false
0
0.057692
0
0.134615
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
81e6d7e4c5225a328154ae28bad91fad114eb558
3,710
py
Python
maskrcnn/settings.py
hqbao/dlp_tf
e8fe3281470faebbe8e36caf55025c270e84c44f
[ "MIT" ]
null
null
null
maskrcnn/settings.py
hqbao/dlp_tf
e8fe3281470faebbe8e36caf55025c270e84c44f
[ "MIT" ]
null
null
null
maskrcnn/settings.py
hqbao/dlp_tf
e8fe3281470faebbe8e36caf55025c270e84c44f
[ "MIT" ]
1
2021-12-30T08:55:37.000Z
2021-12-30T08:55:37.000Z
def settings(mode): settings_for = mode if settings_for == 'non-fpn-train': return { 'start_example_index': 0, 'num_of_train_examples': 2000, 'num_of_validation_examples': 0, 'asizes': [[91, 181], [128, 128], [181, 91]], 'ishape': [1024, 1024, 3], 'ssize': [32, 32], 'resnet': [[16, 16, 64], [3, [2, 2]], [4, [2, 2]], [6, [2, 2]], [3, [1, 1]]], 'max_num_of_rois': 7, 'unified_roi_size': [7, 7], 'rpn_head_dim': 256, 'fc_denses': [1024, 1024], 'iou_thresholds': [0.3, 0.5], 'nsm_iou_threshold': 0.1, 'nsm_score_threshold': 0.1, 'num_of_samples': 64, 'classes': ['face', 'none'], 'mapping': {0: 0}, 'frame_mode': True, 'num_of_epoches': 500, 'base_block_trainable': True, 'weight_loading': False, 'dataset_anno_file_path': '../datasets/coco/annotations/instances_face.json', 'dataset_image_dir_path': '../datasets/coco/images/face', 'output_path': 'output' } if settings_for == 'non-fpn-inference': return { 'start_example_index': 0, 'num_of_train_examples': 0, 'num_of_validation_examples': 0, 'num_of_test_examples': 400, 'asizes': [[91, 181], [128, 128], [181, 91]], 'ishape': [1024, 1024, 3], 'ssize': [32, 32], 'resnet': [[16, 16, 64], [3, [2, 2]], [4, [2, 2]], [6, [2, 2]], [3, [1, 1]]], 'max_num_of_rois': 7, 'unified_roi_size': [7, 7], 'rpn_head_dim': 256, 'fc_denses': [1024, 1024], 'iou_thresholds': [0.3, 0.5], 'nsm_iou_threshold': 0.1, 'nsm_score_threshold': 0.1, 'num_of_samples': 64, 'classes': ['face', 'none'], 'mapping': {0: 0}, 'frame_mode': True, 'dataset_anno_file_path': '../datasets/coco/annotations/instances_face.json', 'dataset_image_dir_path': '../datasets/coco/images/face', 'output_path': 'output' } if settings_for == 'fpn-train': return { 'start_example_index': 0, 'num_of_train_examples': 6700, 'num_of_validation_examples': 0, 'asizes': [ [[32, 32]], [[64, 64]], [[128, 128]], [[256, 256]], ], 'ishape': [1024, 1024, 3], 'ssizes': [[128, 128], [64, 64], [32, 32], [16, 16]], 'resnet': [[64, 64, 256], [3, [2, 2]], [4, [2, 2]], [6, [2, 2]], [3, [2, 2]]], 'max_num_of_rois': 7, 'unified_roi_size': [7, 7], 'rpn_head_dim': 512, 'fc_denses': [8], 'iou_thresholds': [0.3, 0.5], 'k0': 5, 'top_down_pyramid_size': 512, 'nsm_iou_threshold': 0.2, 'nsm_score_threshold': 0.1, 'num_of_samples': 64, 'classes': ['face', 'none'], 'mapping': {0: 0}, 'frame_mode': True, 'num_of_epoches': 500, 'base_block_trainable': True, 'weight_loading': False, 'dataset_anno_file_path': '../datasets/coco/annotations/instances_face.json', 'dataset_image_dir_path': '../datasets/coco/images/face', 'output_path': 'output' } if settings_for == 'fpn-inference': return { 'start_example_index': 0, 'num_of_train_examples': 0, 'num_of_validation_examples': 0, 'num_of_test_examples': 6700, 'asizes': [ [[32, 32]], [[64, 64]], [[128, 128]], [[256, 256]], ], 'ishape': [1024, 1024, 3], 'ssizes': [[128, 128], [64, 64], [32, 32], [16, 16]], 'resnet': [[64, 64, 256], [3, [2, 2]], [4, [2, 2]], [6, [2, 2]], [3, [2, 2]]], 'max_num_of_rois': 7, 'unified_roi_size': [7, 7], 'rpn_head_dim': 512, 'fc_denses': [8], 'iou_thresholds': [0.3, 0.5], 'k0': 5, 'top_down_pyramid_size': 512, 'nsm_iou_threshold': 0.2, 'nsm_score_threshold': 0.1, 'classes': ['face', 'none'], 'mapping': {0: 0}, 'frame_mode': True, 'dataset_anno_file_path': '../datasets/coco/annotations/instances_face.json', 'dataset_image_dir_path': '../datasets/coco/images/face', 'output_path': 'output' }
29.212598
81
0.581671
536
3,710
3.740672
0.169776
0.047382
0.02394
0.045885
0.977556
0.96808
0.94414
0.94414
0.94414
0.94414
0
0.118019
0.189218
3,710
126
82
29.444444
0.548537
0
0
0.882353
0
0
0.463323
0.191478
0
0
0
0
0
1
0.008403
false
0
0
0
0.042017
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c49f53ee0105a4eec6de2b4a26e230d48c639c1a
111
py
Python
mct_tracking_2d/src/mct_tracking_2d/__init__.py
iorodeo/mct
fa8b85f36533c9b1486ca4f6b0c40c3daa6f4e11
[ "Apache-2.0" ]
null
null
null
mct_tracking_2d/src/mct_tracking_2d/__init__.py
iorodeo/mct
fa8b85f36533c9b1486ca4f6b0c40c3daa6f4e11
[ "Apache-2.0" ]
null
null
null
mct_tracking_2d/src/mct_tracking_2d/__init__.py
iorodeo/mct
fa8b85f36533c9b1486ca4f6b0c40c3daa6f4e11
[ "Apache-2.0" ]
null
null
null
import stitched_image_labeler_master import three_point_tracker_master import three_point_tracker_synchronizer
27.75
39
0.945946
15
111
6.4
0.6
0.25
0.354167
0.458333
0.604167
0
0
0
0
0
0
0
0.054054
111
3
40
37
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
c4b0fb6480b062791f6c744890787e70ffdfb65b
1,979
py
Python
food/migrations/0004_auto_20180218_1354.py
Pantura/fodmap-db
14ad68c902c3a62ea358c51b9c0bd0ec32aea2d1
[ "MIT" ]
1
2019-02-14T01:46:16.000Z
2019-02-14T01:46:16.000Z
food/migrations/0004_auto_20180218_1354.py
Pantura/fodmap-db
14ad68c902c3a62ea358c51b9c0bd0ec32aea2d1
[ "MIT" ]
null
null
null
food/migrations/0004_auto_20180218_1354.py
Pantura/fodmap-db
14ad68c902c3a62ea358c51b9c0bd0ec32aea2d1
[ "MIT" ]
null
null
null
# Generated by Django 2.0.2 on 2018-02-18 13:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('food', '0003_auto_20180218_1253'), ] operations = [ migrations.AlterField( model_name='food', name='name', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='food', name='name_en', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='food', name='name_fi', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodcategory', name='name', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodcategory', name='name_en', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodcategory', name='name_fi', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodclassification', name='name', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodclassification', name='name_en', field=models.CharField(blank=True, default='', max_length=120, null=True), ), migrations.AlterField( model_name='foodclassification', name='name_fi', field=models.CharField(blank=True, default='', max_length=120, null=True), ), ]
33.542373
86
0.568469
197
1,979
5.573604
0.208122
0.163934
0.204918
0.237705
0.86612
0.86612
0.86612
0.836066
0.836066
0.836066
0
0.041877
0.300152
1,979
58
87
34.12069
0.750903
0.022739
0
0.865385
1
0
0.094721
0.011905
0
0
0
0
0
1
0
false
0
0.019231
0
0.076923
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
c4d9d852f9bd1eb5b9c9215e89852b239709c0e5
39,276
py
Python
dataUncert/testVariable.py
jacobv95/dataProcessing
1ba5f2a2b07f2246ad6aea24dafb2e8dc08eaf8c
[ "MIT" ]
null
null
null
dataUncert/testVariable.py
jacobv95/dataProcessing
1ba5f2a2b07f2246ad6aea24dafb2e8dc08eaf8c
[ "MIT" ]
null
null
null
dataUncert/testVariable.py
jacobv95/dataProcessing
1ba5f2a2b07f2246ad6aea24dafb2e8dc08eaf8c
[ "MIT" ]
null
null
null
import unittest import numpy as np from random import uniform try: from dataUncert.variable import variable except ModuleNotFoundError: from variable import variable class test(unittest.TestCase): def testSingleNumber(self): A = variable(1.3, 'm') B = variable(2.0, 'm', 0.01) C = variable([1.0, 1.3], 'L/min', np.array([20, 30])) D = variable(np.array([11, 1111]), 'L/min', [2.1, 3.9]) self.assertEqual(A.value, 1.3) self.assertEqual(A.unit, 'm') self.assertEqual(A.uncert, 0) self.assertEqual(B.value, 2.0) self.assertEqual(B.unit, 'm') self.assertEqual(B.uncert, 0.01) np.testing.assert_equal(C.value, [1.0, 1.3]) self.assertEqual(C.unit, 'L/min') np.testing.assert_equal(C.uncert, [20, 30]) np.testing.assert_equal(D.value, [11.0, 1111.0]) self.assertEqual(D.unit, 'L/min') np.testing.assert_equal(D.uncert, [2.1, 3.9]) with self.assertRaises(Exception) as context: variable(1.3, 'm', 'hej') self.assertTrue("could not convert string to float: 'hej'" in str(context.exception)) with self.assertRaises(Exception) as context: variable('med', 'm', 1.0) self.assertTrue("could not convert string to float: 'med'" in str(context.exception)) with self.assertRaises(Exception) as context: variable(1.3, 'm', [1.0, 2.3]) self.assertTrue("The value is a number but the uncertanty is a <class 'list'>" in str(context.exception)) with self.assertRaises(Exception) as context: variable(1.3, 'm', np.array([1.0, 2.3])) self.assertTrue("The value is a number but the uncertanty is a <class 'numpy.ndarray'>" in str(context.exception)) with self.assertRaises(Exception) as context: variable(np.array([1.0, 2.3]), 'm', 1.5) self.assertTrue("The value is a list-like object but the uncertanty is a number" in str(context.exception)) with self.assertRaises(Exception) as context: variable([1.0, 2.3], 'm', 1.5) self.assertTrue("The value is a list-like object but the uncertanty is a number" in str(context.exception)) def test_add(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'L/min', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'L/min', uncert=[53.9, 24.75, 6.4]) C = A + B self.assertAlmostEqual(C.value, 12.3 + 745.1) self.assertEqual(C.unit, 'L/min') self.assertAlmostEqual(C.uncert, np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2)) C.convert('m3/s') self.assertAlmostEqual(C.value, (12.3 + 745.1) / 1000 / 60) self.assertEqual(C.unit, 'm3/s') self.assertAlmostEqual(C.uncert, np.sqrt((1 * 2.6 / 1000 / 60)**2 + (1 * 53.9 / 1000 / 60)**2)) C_vec = A_vec + B_vec np.testing.assert_array_equal(C_vec.value, np.array([12.3 + 745.1, 54.3 + 496.13, 91.3 + 120.54])) self.assertEqual(C_vec.unit, 'L/min') np.testing.assert_array_equal( C_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2), np.sqrt((1 * 5.4)**2 + (1 * 24.75)**2), np.sqrt((1 * 10.56)**2 + (1 * 6.4)**2), ])) C_vec.convert('mL/h') np.testing.assert_almost_equal(C_vec.value, np.array([(12.3 + 745.1) * 1000 * 60, (54.3 + 496.13) * 1000 * 60, (91.3 + 120.54) * 1000 * 60])) self.assertEqual(C_vec.unit, 'mL/h') np.testing.assert_almost_equal( C_vec.uncert, np.array([ np.sqrt((1 * 2.6 * 1000 * 60)**2 + (1 * 53.9 * 1000 * 60)**2), np.sqrt((1 * 5.4 * 1000 * 60)**2 + (1 * 24.75 * 1000 * 60)**2), np.sqrt((1 * 10.56 * 1000 * 60)**2 + (1 * 6.4 * 1000 * 60)**2), ])) def test_sub(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'L/min', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'L/min', uncert=[53.9, 24.75, 6.4]) C = A - B self.assertAlmostEqual(C.value, 12.3 - 745.1) self.assertEqual(C.unit, 'L/min') self.assertAlmostEqual(C.uncert, np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2)) C.convert('kL/s') self.assertAlmostEqual(C.value, (12.3 - 745.1) / 1000 / 60) self.assertEqual(C.unit, 'kL/s') self.assertAlmostEqual(C.uncert, np.sqrt((1 * 2.6 / 1000 / 60)**2 + (1 * 53.9 / 1000 / 60)**2)) C_vec = A_vec - B_vec np.testing.assert_array_equal(C_vec.value, np.array([12.3 - 745.1, 54.3 - 496.13, 91.3 - 120.54])) self.assertEqual(C_vec.unit, 'L/min') np.testing.assert_array_equal( C_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2), np.sqrt((1 * 5.4)**2 + (1 * 24.75)**2), np.sqrt((1 * 10.56)**2 + (1 * 6.4)**2), ])) C_vec.convert('mm3 / h') np.testing.assert_almost_equal(C_vec.value, np.array([12.3 - 745.1, 54.3 - 496.13, 91.3 - 120.54]) * 1000000 * 60, decimal=5) self.assertEqual(C_vec.unit, 'mm3/h') np.testing.assert_almost_equal( C_vec.uncert, np.array([ np.sqrt((1 * 2.6 * 1000000 * 60)**2 + (1 * 53.9 * 1000000 * 60)**2), np.sqrt((1 * 5.4 * 1000000 * 60)**2 + (1 * 24.75 * 1000000 * 60)**2), np.sqrt((1 * 10.56 * 1000000 * 60)**2 + (1 * 6.4 * 1000000 * 60)**2), ]), decimal=5) with self.assertRaises(Exception) as context: A.convert('m') self.assertTrue('You cannot convert from [L/min] to [m]' in str(context.exception)) def test_add_with_different_units(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) with self.assertRaises(Exception) as context: A + B self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec + B_vec self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A.convert('m') self.assertTrue('You cannot convert from [L/min] to [m]' in str(context.exception)) def test_sub_with_different_units(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) with self.assertRaises(Exception) as context: A - B self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec - B_vec self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A.convert('m') self.assertTrue('You cannot convert from [L/min] to [m]' in str(context.exception)) def test_multiply(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) C = A * B self.assertAlmostEqual(C.value, 12.3 * 745.1) self.assertEqual(C.unit, 'L-m/min') self.assertAlmostEqual(C.uncert, np.sqrt((745.1 * 2.6)**2 + (12.3 * 53.9)**2)) C_vec = A_vec * B_vec np.testing.assert_array_equal(C_vec.value, np.array([12.3 * 745.1, 54.3 * 496.13, 91.3 * 120.54])) self.assertEqual(C_vec.unit, 'L-m/min') np.testing.assert_array_equal( C_vec.uncert, np.array([ np.sqrt((745.1 * 2.6)**2 + (12.3 * 53.9)**2), np.sqrt((496.13 * 5.4)**2 + (54.3 * 24.75)**2), np.sqrt((120.54 * 10.56)**2 + (91.3 * 6.4)**2), ])) C_vec.convert('m3-km / s') np.testing.assert_array_equal(C_vec.value, np.array([12.3 * 745.1, 54.3 * 496.13, 91.3 * 120.54]) / 1000 / 1000 / 60) self.assertEqual(C_vec.unit, 'm3-km/s') np.testing.assert_almost_equal( C_vec.uncert, np.array([ np.sqrt((745.1 / 1000 * 2.6 / 1000 / 60)**2 + (12.3 / 1000 / 60 * 53.9 / 1000)**2), np.sqrt((496.13 / 1000 * 5.4 / 1000 / 60)**2 + (54.3 / 1000 / 60 * 24.75 / 1000)**2), np.sqrt((120.54 / 1000 * 10.56 / 1000 / 60)**2 + (91.3 / 1000 / 60 * 6.4 / 1000)**2), ]), decimal=7) def test_divide(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) C = A / B self.assertAlmostEqual(C.value, 12.3 / 745.1) self.assertEqual(C.unit, 'L/min-m') self.assertAlmostEqual(C.uncert, np.sqrt((1 / 745.1 * 2.6)**2 + (12.3 / (745.1**2) * 53.9)**2)) C.convert('m3/h-mm') self.assertAlmostEqual(C.value, 12.3 / 745.1 / 1000 * 60 / 1000) self.assertEqual(C.unit, 'm3/h-mm') self.assertAlmostEqual(C.uncert, np.sqrt((1 / (745.1 * 1000) * 2.6 / 1000 * 60)**2 + (12.3 / ((745.1)**2) * 53.9 / 1000 * 60 / 1000)**2)) C_vec = A_vec / B_vec np.testing.assert_array_equal(C_vec.value, np.array([12.3 / 745.1, 54.3 / 496.13, 91.3 / 120.54])) self.assertEqual(C_vec.unit, 'L/min-m') np.testing.assert_array_equal( C_vec.uncert, np.array([ np.sqrt((1 / 745.1 * 2.6)**2 + (12.3 / (745.1)**2 * 53.9)**2), np.sqrt((1 / 496.13 * 5.4)**2 + (54.3 / (496.13)**2 * 24.75)**2), np.sqrt((1 / 120.54 * 10.56)**2 + (91.3 / (120.54)**2 * 6.4)**2), ])) C_vec.convert('m3 / h -mm') np.testing.assert_almost_equal(C_vec.value, np.array([12.3 / 745.1, 54.3 / 496.13, 91.3 / 120.54]) / 1000 * 60 / 1000) self.assertEqual(C_vec.unit, 'm3/h-mm') np.testing.assert_almost_equal( C_vec.uncert, np.array([ np.sqrt((1 / 745.1 * 2.6 / 1000 * 60 / 1000)**2 + (12.3 / (745.1)**2 * 53.9 / 1000 * 60 / 1000)**2), np.sqrt((1 / 496.13 * 5.4 / 1000 * 60 / 1000)**2 + (54.3 / (496.13)**2 * 24.75 / 1000 * 60 / 1000)**2), np.sqrt((1 / 120.54 * 10.56 / 1000 * 60 / 1000)**2 + (91.3 / (120.54)**2 * 6.4 / 1000 * 60 / 1000)**2), ])) def test_add_unit_order(self): A = variable(10, 'm-K') B = variable(3, 'K-m') A_vec = variable([12.3, 54.3, 91.3], 'K-m', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm-K', uncert=[53.9, 24.75, 6.4]) C = A + B C_vec = A_vec + B_vec def test_sub_unit_order(self): A = variable(10, 'm-K') B = variable(3, 'K-m') A_vec = variable([12.3, 54.3, 91.3], 'K-m', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm-K', uncert=[53.9, 24.75, 6.4]) C = A - B C_vec = A_vec - B_vec def test_pow(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) C = variable(745.1, '1', uncert=53.9) D = variable(0.34, '1', uncert=0.01) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) C_vec = variable([745.1, 496.13, 120.54], '1', uncert=[53.9, 24.75, 6.4]) D_vec = variable([0.34, 0.64, 0.87], '1', uncert=[0.01, 0.084, 0.12]) with self.assertRaises(Exception) as context: A ** B self.assertTrue('The exponent can not have a unit' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec ** B_vec self.assertTrue('The exponent can not have a unit' in str(context.exception)) E = C**D self.assertAlmostEqual(E.value, 745.1**0.34) self.assertEqual(E.unit, '1') self.assertAlmostEqual(E.uncert, np.sqrt((0.34 * 745.1**(0.34 - 1) * 53.9)**2 + (745.1**0.34 * np.log(745.1) * 0.01)**2)) E_vec = C_vec**D_vec np.testing.assert_array_equal(E_vec.value, np.array([745.1**0.34, 496.13**0.64, 120.54**0.87])) self.assertEqual(E_vec.unit, '1') np.testing.assert_array_equal( E_vec.uncert, np.array([ np.sqrt((0.34 * 745.1**(0.34 - 1) * 53.9)**2 + (745.1**0.34 * np.log(745.1) * 0.01)**2), np.sqrt((0.64 * 496.13**(0.64 - 1) * 24.75)**2 + (496.13**0.64 * np.log(496.13) * 0.084)**2), np.sqrt((0.87 * 120.54**(0.87 - 1) * 6.4)**2 + (120.54**0.87 * np.log(120.54) * 0.12)**2) ])) F = A**2 self.assertAlmostEqual(F.value, (12.3)**2) self.assertEqual(F.unit, 'L2/min2') self.assertAlmostEqual(F.uncert, np.sqrt((2 * 12.3**(2 - 1) * 2.6)**2)) F.convert('m6/s2') self.assertAlmostEqual(F.value, (12.3 / 1000 / 60)**2) self.assertEqual(F.unit, 'm6/s2') self.assertAlmostEqual(F.uncert, np.sqrt((2 * (12.3 / 1000 / 60)**(2 - 1) * 2.6 / 1000 / 60)**2)) F_vec = A_vec**2 np.testing.assert_array_equal(F_vec.value, np.array([(12.3)**2, 54.3**2, 91.3**2])) self.assertEqual(F_vec.unit, 'L2/min2') np.testing.assert_array_equal( F_vec.uncert, np.array([ np.sqrt((2 * 12.3**(2 - 1) * 2.6)**2), np.sqrt((2 * 54.3**(2 - 1) * 5.4)**2), np.sqrt((2 * 91.3**(2 - 1) * 10.56)**2) ])) F_vec.convert('m6 / s2') np.testing.assert_almost_equal(F_vec.value, np.array([(12.3 / 1000 / 60)**2, (54.3 / 1000 / 60)**2, (91.3 / 1000 / 60)**2])) self.assertEqual(F_vec.unit, 'm6/s2') np.testing.assert_almost_equal( F_vec.uncert, np.array([ np.sqrt((2 * 12.3 / 1000 / 60**(2 - 1) * 2.6 / 1000 / 60)**2), np.sqrt((2 * 54.3 / 1000 / 60**(2 - 1) * 5.4 / 1000 / 60)**2), np.sqrt((2 * 91.3 / 1000 / 60**(2 - 1) * 10.56 / 1000 / 60)**2) ])) G = 2.54**D self.assertAlmostEqual(G.value, 2.54**0.34) self.assertEqual(G.unit, '1') self.assertAlmostEqual(G.uncert, np.sqrt((2.54**0.34 * np.log(2.54) * 0.01)**2)) G_vec = 2.54**D_vec np.testing.assert_array_equal(G_vec.value, np.array([2.54**0.34, 2.54**0.64, 2.54**0.87])) self.assertEqual(G_vec.unit, '1') np.testing.assert_array_equal( G_vec.uncert, np.array([ 2.54**0.34 * np.log(2.54) * 0.01, 2.54**0.64 * np.log(2.54) * 0.084, 2.54**0.87 * np.log(2.54) * 0.12 ])) def test_log(self): A = variable(12.3, 'L/min', uncert=2.6) C = variable(745.1, '1', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) C_vec = variable([745.1, 496.13, 120.54], '1', uncert=[53.9, 24.75, 6.4]) with self.assertRaises(Exception) as context: np.log(A) self.assertTrue('You can only take the natural log of a variable if it has no unit' in str(context.exception)) with self.assertRaises(Exception) as context: np.log10(A) self.assertTrue('You can only take the base 10 log of a variable if it has no unit' in str(context.exception)) with self.assertRaises(Exception) as context: np.log(A_vec) self.assertTrue('You can only take the natural log of a variable if it has no unit' in str(context.exception)) with self.assertRaises(Exception) as context: np.log10(A_vec) self.assertTrue('You can only take the base 10 log of a variable if it has no unit' in str(context.exception)) D = np.log(C) self.assertAlmostEqual(D.value, np.log(745.1)) self.assertEqual(D.unit, '1') self.assertAlmostEqual(D.uncert, np.sqrt((1 / 745.1) * 53.9)**2) D_vec = np.log(C_vec) np.testing.assert_array_equal(D_vec.value, np.array([np.log(745.1), np.log(496.13), np.log(120.54)])) self.assertEqual(D_vec.unit, '1') np.testing.assert_array_equal( D_vec.uncert, np.array([ np.sqrt(((1 / 745.1) * 53.9)**2), np.sqrt(((1 / 496.13) * 24.75)**2), np.sqrt(((1 / 120.54) * 6.4)**2) ])) E = np.log10(C) self.assertAlmostEqual(E.value, np.log10(745.1)) self.assertEqual(E.unit, '1') self.assertAlmostEqual(E.uncert, np.sqrt((1 / (745.1 * np.log10(745.1))) * 53.9)**2) E_vec = np.log10(C_vec) np.testing.assert_array_equal(E_vec.value, np.array([np.log10(745.1), np.log10(496.13), np.log10(120.54)])) self.assertEqual(E_vec.unit, '1') np.testing.assert_array_equal( E_vec.uncert, np.array([ np.sqrt(((1 / (745.1 * np.log10(745.1))) * 53.9)**2), np.sqrt(((1 / (496.13 * np.log10(496.13))) * 24.75)**2), np.sqrt(((1 / (120.54 * np.log10(120.54))) * 6.4)**2) ])) def test_exp(self): A = variable(12.3, 'L/min', uncert=2.6) C = variable(12.3, '1', uncert=5.39) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) C_vec = variable([12.3, 54.3, 91.3], '1', uncert=[2.6, 5.4, 10.56]) with self.assertRaises(Exception) as context: np.exp(A) self.assertTrue('The exponent can not have a unit' in str(context.exception)) with self.assertRaises(Exception) as context: np.exp(A_vec) self.assertTrue('The exponent can not have a unit' in str(context.exception)) D = np.exp(C) self.assertAlmostEqual(D.value, np.e**12.3) self.assertEqual(D.unit, '1') self.assertAlmostEqual(D.uncert, np.sqrt((np.e**12.3 * np.log(np.e) * 5.39)**2)) D_vec = np.exp(C_vec) np.testing.assert_array_equal(D_vec.value, np.array([np.e**12.3, np.e**54.3, np.e**91.3])) self.assertEqual(D_vec.unit, '1') np.testing.assert_array_equal( D_vec.uncert, np.array([ np.sqrt((np.e**12.3 * np.log(np.e) * 2.6)**2), np.sqrt((np.e**54.3 * np.log(np.e) * 5.4)**2), np.sqrt((np.e**91.3 * np.log(np.e) * 10.56)**2) ])) def testIndex(self): A = variable(12.3, 'L/min', uncert=2.6) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) a = A[0] self.assertEqual(a.value, 12.3) self.assertEqual(a.unit, 'L/min') self.assertEqual(a.uncert, 2.6) a_vec = A_vec[0, 1] np.testing.assert_equal(a_vec.value, [12.3, 54.3]) self.assertEqual(a_vec.unit, 'L/min') np.testing.assert_equal(a_vec.uncert, [2.6, 5.4]) a_vec = A_vec[0, 2] np.testing.assert_equal(a_vec.value, [12.3, 91.3]) self.assertEqual(a_vec.unit, 'L/min') np.testing.assert_equal(a_vec.uncert, [2.6, 10.56]) a_vec = A_vec[2, 0] np.testing.assert_equal(a_vec.value, [91.3, 12.3]) self.assertEqual(a_vec.unit, 'L/min') np.testing.assert_equal(a_vec.uncert, [10.56, 2.6]) with self.assertRaises(Exception) as context: a = A[1] self.assertTrue('index 1 is out of bounds for axis 0 with size 1' in str(context.exception)) with self.assertRaises(Exception) as context: a = A[23] self.assertTrue('index 23 is out of bounds for axis 0 with size 1' in str(context.exception)) def testAddEqual(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'L/min', uncert=53.9) A += B self.assertEqual(A.value, 12.3 + 745.1) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2)) A = variable(12.3, 'L/min', uncert=2.6) A += 2 self.assertEqual(A.value, 12.3 + 2) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((1 * 2.6)**2)) A = variable(12.3, 'L/min', uncert=2.6) B = 2 B += A self.assertEqual(B.value, 2 + 12.3) self.assertEqual(B.unit, 'L/min') self.assertEqual(B.uncert, np.sqrt((1 * 2.6)**2)) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'L/min', uncert=[53.9, 24.75, 6.4]) A_vec += B_vec np.testing.assert_array_equal(A_vec.value, np.array([12.3 + 745.1, 54.3 + 496.13, 91.3 + 120.54])) self.assertEqual(A_vec.unit, 'L/min') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2), np.sqrt((1 * 5.4)**2 + (1 * 24.75)**2), np.sqrt((1 * 10.56)**2 + (1 * 6.4)**2), ])) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) A = variable(12.3, 'L/min', uncert=2.6) A_vec += A np.testing.assert_array_equal(A_vec.value, np.array([12.3 + 12.3, 54.3 + 12.3, 91.3 + 12.3])) self.assertEqual(A_vec.unit, 'L/min') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 2.6)**2), np.sqrt((1 * 5.4)**2 + (1 * 2.6)**2), np.sqrt((1 * 10.56)**2 + (1 * 2.6)**2), ])) A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) with self.assertRaises(Exception) as context: A += B self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B += A self.assertTrue('You tried to add a variable in [m] to a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec += B_vec self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B_vec += A_vec self.assertTrue('You tried to add a variable in [m] to a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec += B self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B_vec += A self.assertTrue('You tried to add a variable in [m] to a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A += B_vec self.assertTrue('You tried to add a variable in [L/min] to a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B += A_vec self.assertTrue('You tried to add a variable in [m] to a variable in [L/min], but the units does not match' in str(context.exception)) def testSubEqual(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'L/min', uncert=53.9) A -= B self.assertEqual(A.value, 12.3 - 745.1) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2)) A = variable(12.3, 'L/min', uncert=2.6) A -= 2 self.assertEqual(A.value, 12.3 - 2) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((1 * 2.6)**2)) A = variable(12.3, 'L/min', uncert=2.6) B = 2 B -= A self.assertEqual(B.value, 2 - 12.3) self.assertEqual(B.unit, 'L/min') self.assertEqual(B.uncert, np.sqrt((1 * 2.6)**2)) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'L/min', uncert=[53.9, 24.75, 6.4]) A_vec -= B_vec np.testing.assert_array_equal(A_vec.value, np.array([12.3 - 745.1, 54.3 - 496.13, 91.3 - 120.54])) self.assertEqual(A_vec.unit, 'L/min') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 53.9)**2), np.sqrt((1 * 5.4)**2 + (1 * 24.75)**2), np.sqrt((1 * 10.56)**2 + (1 * 6.4)**2), ])) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) A = variable(12.3, 'L/min', uncert=2.6) A_vec -= A np.testing.assert_array_equal(A_vec.value, np.array([12.3 - 12.3, 54.3 - 12.3, 91.3 - 12.3])) self.assertEqual(A_vec.unit, 'L/min') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 * 2.6)**2 + (1 * 2.6)**2), np.sqrt((1 * 5.4)**2 + (1 * 2.6)**2), np.sqrt((1 * 10.56)**2 + (1 * 2.6)**2), ])) A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) with self.assertRaises(Exception) as context: A -= B self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B -= A self.assertTrue('You tried to subtract a variable in [L/min] from a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec -= B_vec self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B_vec -= A_vec self.assertTrue('You tried to subtract a variable in [L/min] from a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A_vec -= B self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B_vec -= A self.assertTrue('You tried to subtract a variable in [L/min] from a variable in [m], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: A -= B_vec self.assertTrue('You tried to subtract a variable in [m] from a variable in [L/min], but the units does not match' in str(context.exception)) with self.assertRaises(Exception) as context: B -= A_vec self.assertTrue('You tried to subtract a variable in [L/min] from a variable in [m], but the units does not match' in str(context.exception)) def testMultiEqual(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A *= B self.assertEqual(A.value, 12.3 * 745.1) self.assertEqual(A.unit, 'L-m/min') self.assertEqual(A.uncert, np.sqrt((745.1 * 2.6)**2 + (12.3 * 53.9)**2)) A = variable(12.3, 'L/min', uncert=2.6) A *= 2 self.assertEqual(A.value, 12.3 * 2) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((2 * 2.6)**2)) A = variable(12.3, 'L/min', uncert=2.6) B = 2 B *= A self.assertEqual(B.value, 12.3 * 2) self.assertEqual(B.unit, 'L/min') self.assertEqual(B.uncert, np.sqrt((2 * 2.6)**2)) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) A_vec *= B_vec np.testing.assert_array_equal(A_vec.value, np.array([12.3 * 745.1, 54.3 * 496.13, 91.3 * 120.54])) self.assertEqual(A_vec.unit, 'L-m/min') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((745.1 * 2.6)**2 + (12.3 * 53.9)**2), np.sqrt((496.13 * 5.4)**2 + (54.3 * 24.75)**2), np.sqrt((120.54 * 10.56)**2 + (91.3 * 6.4)**2), ])) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) A = variable(12.3, 'L/min', uncert=2.6) A_vec *= A np.testing.assert_array_equal(A_vec.value, np.array([12.3 * 12.3, 54.3 * 12.3, 91.3 * 12.3])) self.assertEqual(A_vec.unit, 'L2/min2') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((12.3 * 2.6)**2 + (12.3 * 2.6)**2), np.sqrt((12.3 * 5.4)**2 + (54.3 * 2.6)**2), np.sqrt((12.3 * 10.56)**2 + (91.3 * 2.6)**2), ])) def testDivEqual(self): A = variable(12.3, 'L/min', uncert=2.6) B = variable(745.1, 'm', uncert=53.9) A /= B self.assertEqual(A.value, 12.3 / 745.1) self.assertEqual(A.unit, 'L/min-m') self.assertEqual(A.uncert, np.sqrt((1 / 745.1 * 2.6)**2 + (12.3 / (745.1**2) * 53.9)**2)) A = variable(12.3, 'L/min', uncert=2.6) A /= 2 self.assertEqual(A.value, 12.3 / 2) self.assertEqual(A.unit, 'L/min') self.assertEqual(A.uncert, np.sqrt((1 / 2 * 2.6)**2)) A = variable(12.3, 'L/min', uncert=2.6) B = 2 B /= A self.assertEqual(B.value, 2 / 12.3) self.assertEqual(B.unit, 'min/L') self.assertEqual(B.uncert, np.sqrt((2 / (12.3**2) * 2.6)**2)) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) B_vec = variable([745.1, 496.13, 120.54], 'm', uncert=[53.9, 24.75, 6.4]) A_vec /= B_vec np.testing.assert_array_equal(A_vec.value, np.array([12.3 / 745.1, 54.3 / 496.13, 91.3 / 120.54])) self.assertEqual(A_vec.unit, 'L/min-m') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 / 745.1 * 2.6)**2 + (12.3 / (745.1**2) * 53.9)**2), np.sqrt((1 / 496.13 * 5.4)**2 + (54.3 / (496.13**2) * 24.75)**2), np.sqrt((1 / 120.54 * 10.56)**2 + (91.3 / (120.54**2) * 6.4)**2), ])) A_vec = variable([12.3, 54.3, 91.3], 'L/min', uncert=[2.6, 5.4, 10.56]) A = variable(12.3, 'L/min', uncert=2.6) A_vec /= A np.testing.assert_array_equal(A_vec.value, np.array([12.3 / 12.3, 54.3 / 12.3, 91.3 / 12.3])) self.assertEqual(A_vec.unit, '1') np.testing.assert_array_equal( A_vec.uncert, np.array([ np.sqrt((1 / 12.3 * 2.6)**2 + (12.3 / (12.3**2) * 2.6)**2), np.sqrt((1 / 12.3 * 5.4)**2 + (54.3 / (12.3**2) * 2.6)**2), np.sqrt((1 / 12.3 * 10.56)**2 + (91.3 / (12.3**2) * 2.6)**2), ])) def testPrintValueAndUncertScalar(self): A = variable(123456789 * 10**(0), 'm', uncert=123456789 * 10**(-2), nDigits=3) self.assertEqual(A.__str__(), '123000000 +/- 1000000 [m]') A = variable(123456789 * 10**(-2), 'm', uncert=123456789 * 10**(-4), nDigits=3) self.assertEqual(A.__str__(), '1230000 +/- 10000 [m]') A = variable(123456789 * 10**(-4), 'm', uncert=123456789 * 10**(-6), nDigits=3) self.assertEqual(A.__str__(), '12300 +/- 100 [m]') A = variable(123456789 * 10**(-6), 'm', uncert=123456789 * 10**(-8), nDigits=3) self.assertEqual(A.__str__(), '123 +/- 1 [m]') A = variable(123456789 * 10**(-7), 'm', uncert=123456789 * 10**(-9), nDigits=3) self.assertEqual(A.__str__(), '12.3 +/- 0.1 [m]') A = variable(123456789 * 10**(-8), 'm', uncert=123456789 * 10**(-10), nDigits=3) self.assertEqual(A.__str__(), '1.23 +/- 0.01 [m]') A = variable(123456789 * 10**(-9), 'm', uncert=123456789 * 10**(-11), nDigits=3) self.assertEqual(A.__str__(), '0.123 +/- 0.001 [m]') A = variable(123456789 * 10**(-10), 'm', uncert=123456789 * 10**(-12), nDigits=3) self.assertEqual(A.__str__(), '0.0123 +/- 0.0001 [m]') A = variable(123456789 * 10**(-12), 'm', uncert=123456789 * 10**(-14), nDigits=3) self.assertEqual(A.__str__(), '0.000123 +/- 1e-06 [m]') A = variable(123456789 * 10**(-14), 'm', uncert=123456789 * 10**(-16), nDigits=3) self.assertEqual(A.__str__(), '0.00000123 +/- 1e-08 [m]') A = variable(123456789 * 10**(-16), 'm', uncert=123456789 * 10**(-18), nDigits=3) self.assertEqual(A.__str__(), '0.0000000123 +/- 1e-10 [m]') A = variable(10.0, 'm', uncert=0.1) self.assertEqual(A.__str__(), '10.0 +/- 0.1 [m]') def testPrintValueScalar(self): A = variable(123456789 * 10**(0), 'm', nDigits=6) self.assertEqual(A.__str__(), '1.23457e+08 [m]') A = variable(123456789 * 10**(-2), 'm', nDigits=7) self.assertEqual(A.__str__(), '1234568 [m]') A = variable(123456789 * 10**(-4), 'm', nDigits=3) self.assertEqual(A.__str__(), '1.23e+04 [m]') A = variable(123456789 * 10**(-6), 'm', nDigits=3) self.assertEqual(A.__str__(), '123 [m]') A = variable(123456789 * 10**(-7), 'm', nDigits=3) self.assertEqual(A.__str__(), '12.3 [m]') A = variable(123456789 * 10**(-8), 'm', nDigits=3) self.assertEqual(A.__str__(), '1.23 [m]') A = variable(123456789 * 10**(-9), 'm', nDigits=2) self.assertEqual(A.__str__(), '0.12 [m]') A = variable(123456789 * 10**(-10), 'm', nDigits=3) self.assertEqual(A.__str__(), '0.0123 [m]') A = variable(123456789 * 10**(-12), 'm', nDigits=3) self.assertEqual(A.__str__(), '0.000123 [m]') A = variable(123456789 * 10**(-14), 'm', nDigits=5) self.assertEqual(A.__str__(), '1.2346e-06 [m]') A = variable(123456789 * 10**(-16), 'm', nDigits=3) self.assertEqual(A.__str__(), '1.23e-08 [m]') def testRoot(self): A = variable(10, 'L2/min2') a = np.sqrt(A) self.assertEqual(a.value, np.sqrt(10)) self.assertEqual(a.unit, 'L/min') a = A**(1 / 2) self.assertEqual(a.value, 10**(1 / 2)) self.assertEqual(a.unit, 'L/min') for i in range(1, 1000): u = f'L{i+1}/min{i+1}' A = variable(10, u) power = 1 / (i + 1) a = A**power self.assertEqual(a.value, 10**(1 / (i + 1))) self.assertEqual(a.unit, 'L/min') scale = uniform(0.5, 0.99) with self.assertRaises(Exception) as context: A ** (power * scale) self.assertTrue(f'You can not raise a variable with the unit {u} to the power of {power * scale}' in str(context.exception)) scale = uniform(1.01, 1.5) with self.assertRaises(Exception) as context: A ** (power * scale) self.assertTrue(f'You can not raise a variable with the unit {u} to the power of {power * scale}' in str(context.exception)) A = variable(10, 'L2/m') with self.assertRaises(Exception) as context: np.sqrt(A) self.assertTrue('You can not raise a variable with the unit L2/m to the power of 0.5' in str(context.exception)) def testLargerUncertThenValue(self): A = variable(0.003, 'L/min', 0.2) self.assertEqual(A.__str__(), '0.0 +/- 0.2 [L/min]') A = variable(1, 'L/min', 10) self.assertEqual(A.__str__(), '0 +/- 10 [L/min]') A = variable(1, 'L/min', 2.3) self.assertEqual(A.__str__(), '1 +/- 2 [L/min]') A = variable(105, 'L/min', 135.653) self.assertEqual(A.__str__(), '100 +/- 100 [L/min]') A = variable(10.5, 'L/min', 135.653) self.assertEqual(A.__str__(), '0 +/- 100 [L/min]') A = variable(0.0543, 'L/min', 0.07) self.assertEqual(A.__str__(), '0.05 +/- 0.07 [L/min]') A = variable(0.0543, 'L/min', 0.7) self.assertEqual(A.__str__(), '0.0 +/- 0.7 [L/min]') def testUnitless(self): with self.assertRaises(Exception) as context: A = variable(10, 'P', 1) self.assertTrue('The unit (P) was not found. Therefore it was interpreted as a prefix and a unit. However the prefix (P) was not found' in str(context.exception)) A = variable(10, '1', 1) self.assertEqual(A.value, 10) self.assertEqual(A.unit, '1') self.assertEqual(A.uncert, 1) A = variable(10, '', 1) self.assertEqual(A.value, 10) self.assertEqual(A.unit, '1') self.assertEqual(A.uncert, 1) def testPrettyPrint(self): a = variable(12.3, 'm') b = variable(12.3, 'm', 2.5) c = variable([12.3, 56.2], 'm') d = variable([12.3, 56.2], 'm', [2.5, 7.3]) self.assertEqual(a.__str__(pretty=False), '12.3 [m]') self.assertEqual(b.__str__(pretty=False), '12 +/- 2 [m]') self.assertEqual(c.__str__(pretty=False), '[12.3, 56.2] [m]') self.assertEqual(d.__str__(pretty=False), '[12, 56] +/- [2, 7] [m]') self.assertEqual(a.__str__(pretty=True), '12.3\\ \\left [m\\right ]') self.assertEqual(b.__str__(pretty=True), '12 \pm 2\\ \\left [m\\right ]') self.assertEqual(c.__str__(pretty=True), '[12.3, 56.2]\\ \\left [m\\right ]') self.assertEqual(d.__str__(pretty=True), '[12, 56] \pm [2, 7]\\ \\left [m\\right ]') if __name__ == '__main__': unittest.main()
44.179978
170
0.534627
6,429
39,276
3.191321
0.033598
0.021641
0.066286
0.025735
0.887459
0.848272
0.812351
0.740459
0.709168
0.68509
0
0.150216
0.274391
39,276
888
171
44.22973
0.569704
0
0
0.49101
0
0.031812
0.116432
0
0
0
0
0
0.42462
1
0.031812
false
0
0.006916
0
0.040111
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
7
1ef9dd4fa7ce3feeb1cc569ea300161209c50e85
36
py
Python
src/latest/__init__.py
laffra/Tempo
a80be869617c7ad6573a02f5e609f01c397e7aaa
[ "BSD-2-Clause" ]
1
2020-02-11T18:49:18.000Z
2020-02-11T18:49:18.000Z
src/latest/__init__.py
laffra/Tempo
a80be869617c7ad6573a02f5e609f01c397e7aaa
[ "BSD-2-Clause" ]
null
null
null
src/latest/__init__.py
laffra/Tempo
a80be869617c7ad6573a02f5e609f01c397e7aaa
[ "BSD-2-Clause" ]
null
null
null
import main def run(): main.run()
9
12
0.638889
6
36
3.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.194444
36
4
12
9
0.793103
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0
0.666667
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
7
4803862847c9d6d1226a4e4e3747308e0fc970e8
231
py
Python
lytrax_afm/__init__.py
boyank/afm-python
dca18a68dcf3604d352d715d69c1e6d919003c3b
[ "MIT" ]
null
null
null
lytrax_afm/__init__.py
boyank/afm-python
dca18a68dcf3604d352d715d69c1e6d919003c3b
[ "MIT" ]
null
null
null
lytrax_afm/__init__.py
boyank/afm-python
dca18a68dcf3604d352d715d69c1e6d919003c3b
[ "MIT" ]
null
null
null
__author__ = 'lytrax' from ._validation import validate_afm from ._generation import generate_afm, generate_valid_afm, generate_invalid_afm __all__ = ['validate_afm', 'generate_afm', 'generate_valid_afm', 'generate_invalid_afm']
33
88
0.818182
29
231
5.758621
0.413793
0.329341
0.227545
0.287425
0.538922
0.538922
0.538922
0.538922
0
0
0
0
0.090909
231
6
89
38.5
0.795238
0
0
0
1
0
0.294372
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
7
481bce0f976e0b6232173522fef34beb310e50a6
20,608
py
Python
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Pmv/VisionInterface/APBSIsoContour_net.py
J-E-J-S/aaRS-Pipeline
43f59f28ab06e4b16328c3bc405cdddc6e69ac44
[ "MIT" ]
8
2021-12-14T21:30:01.000Z
2022-02-14T11:30:03.000Z
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Pmv/VisionInterface/APBSIsoContour_net.py
J-E-J-S/aaRS-Pipeline
43f59f28ab06e4b16328c3bc405cdddc6e69ac44
[ "MIT" ]
null
null
null
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Pmv/VisionInterface/APBSIsoContour_net.py
J-E-J-S/aaRS-Pipeline
43f59f28ab06e4b16328c3bc405cdddc6e69ac44
[ "MIT" ]
null
null
null
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by ######################################################################## # # Vision Network - Python source code - file generated by vision # Wednesday 11 April 2007 13:25:04 # # The Scripps Research Institute (TSRI) # Molecular Graphics Lab # La Jolla, CA 92037, USA # # Copyright: Daniel Stoffler, Michel Sanner and TSRI # # revision: Guillaume Vareille # ######################################################################### # # $Header: /opt/cvs/python/packages/share1.5/Pmv/VisionInterface/APBSIsoContour_net.py,v 1.41 2009/09/30 21:06:46 vareille Exp $ # # $Id: APBSIsoContour_net.py,v 1.41 2009/09/30 21:06:46 vareille Exp $ # from traceback import print_exc ## loading libraries ## from Pmv.VisionInterface.PmvNodes import pmvlib masterNet.getEditor().addLibraryInstance(pmvlib,"Pmv.VisionInterface.PmvNodes", "pmvlib") from Vision.StandardNodes import stdlib masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib") from Volume.VisionInterface.VolumeNodes import vollib masterNet.getEditor().addLibraryInstance(vollib,"Volume.VisionInterface.VolumeNodes", "vollib") from DejaVu.VisionInterface.DejaVuNodes import vizlib masterNet.getEditor().addLibraryInstance(vizlib,"DejaVu.VisionInterface.DejaVuNodes", "vizlib") try: ## saving node VolumeStats ## from Volume.VisionInterface.VolumeNodes import VolumeStats VolumeStats_1 = VolumeStats(constrkw = {}, name='VolumeStats', library=vollib) masterNet.addNode(VolumeStats_1,271,173) except: print "WARNING: failed to restore VolumeStats named VolumeStats in network masterNet" print_exc() VolumeStats_1=None try: ## saving node GenSurf ## from Vision.StandardNodes import Generic GenSurf_2 = Generic(constrkw = {}, name='GenSurf', library=stdlib) masterNet.addNode(GenSurf_2,411,235) apply(GenSurf_2.addInputPort, (), {'name': 'value', 'cast': True, 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) apply(GenSurf_2.addInputPort, (), {'name': 'geom1', 'cast': True, 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) apply(GenSurf_2.addOutputPort, (), {'name': 'out0', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) apply(GenSurf_2.addOutputPort, (), {'name': 'out1', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) code = """def doit(self, value, geom1): geom1.inheritMaterial = False geom1.inheritFrontPolyMode = False # geom1.inheritBackPolyMode = False from opengltk.OpenGL import GL geom1.frontPolyMode = GL.GL_FILL # geom1.backPolyMode = GL.GL_FILL R = 0. B = 0. if value < 0: R = 1. else: B = 1 geom1.Set( depthMask = 1) geom1.SetMaterial([(0.0,0.0,0.0,0.0),],2) geom1.SetMaterial([(0.9,0.9,0.9,1.0),],3) geom1.Set(materials=[(R,0.,B,0.8),]) # geom1.Set(culling='None') # if hasattr(self, 'Label') and # hasattr(self.Label, 'viewer') and # hasattr(self.Label.viewer, 'RemoveObject'): # self.Label.viewer.RemoveObject(self.Label) from DejaVu.glfSticker import Sticker self.Label = Sticker(name='LeftLabel', label=str(value)[0:7], position=(0, 1), anchor=(0, 1), frameSpace=(2.,.5), frameColor=(R,0,B,.8), fontColor=(1,1,1,1), framePolygonMode=GL.GL_FILL, immediateRendering=True, # just to make sure it's on top of other transparencies transparent=True, ) self.outputData(out0=geom1, out1=self.Label) ## to ouput data on port out1 use ## self.outputData(out1=data) """ GenSurf_2.configure(function=code) except: print "WARNING: failed to restore Generic named GenSurf in network masterNet" print_exc() GenSurf_2=None try: ## saving node GenSurf ## from Vision.StandardNodes import Generic GenSurf_3 = Generic(constrkw = {}, name='GenSurf', library=stdlib) masterNet.addNode(GenSurf_3,67,243) apply(GenSurf_3.addInputPort, (), {'name': 'value', 'cast': True, 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) apply(GenSurf_3.addInputPort, (), {'name': 'geom1', 'cast': True, 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) apply(GenSurf_3.addOutputPort, (), {'name': 'out0', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) apply(GenSurf_3.addOutputPort, (), {'name': 'out1', 'datatype': 'geom', 'height': 8, 'width': 12, 'shape': 'rect', 'color': 'red'}) code = """def doit(self, value, geom1): geom1.inheritMaterial = False geom1.inheritFrontPolyMode = False geom1.inheritBackPolyMode = False geom1.inheritCulling = False from opengltk.OpenGL import GL # geom1.frontPolyMode = GL.GL_FILL geom1.backPolyMode = GL.GL_FILL R = 0. B = 0. if value < 0: R = 1. else: B = 1 geom1.Set( depthMask = 1) geom1.SetMaterial([(0.0,0.0,0.0,0.0),],2) geom1.SetMaterial([(0.9,0.9,0.9,1.0),],3) geom1.Set(culling='front') geom1.Set(materials=[(R,0.,B,0.8),],) # if hasattr(self,'Label') and # hasattr(self.Label,'viewer') and # hasattr(self.Label.viewer,'RemoveObject'): # self.Label.viewer.RemoveObject(self.Label) from DejaVu.glfSticker import Sticker self.Label = Sticker( name='RightLabel', label=str(value)[0:7], position=(1, 1), anchor=(1, 1), frameSpace=(2., .5), frameColor=(R,0,B,.8), fontColor=(1,1,1,1), framePolygonMode=GL.GL_FILL, immediateRendering=True, # just to make sure it's on top of other transparencies transparent=True, ) self.outputData(out0=geom1,out1 = self.Label ) ## to ouput data on port out1 use ## self.outputData(out1=data) """ GenSurf_3.configure(function=code) except: print "WARNING: failed to restore Generic named GenSurf in network masterNet" print_exc() GenSurf_3=None try: ## saving node -polygons ## from DejaVu.VisionInterface.GeometryNodes import IndexedPolygonsNE _polygons_4 = IndexedPolygonsNE(constrkw = {}, name='-polygons', library=vizlib) masterNet.addNode(_polygons_4,15,105) _polygons_4.inputPortByName['name'].widget.set("", run=False) except: print "WARNING: failed to restore IndexedPolygonsNE named -polygons in network masterNet" print_exc() _polygons_4=None try: ## saving node +polygons ## from DejaVu.VisionInterface.GeometryNodes import IndexedPolygonsNE _polygons_5 = IndexedPolygonsNE(constrkw = {}, name='+polygons', library=vizlib) masterNet.addNode(_polygons_5,403,124) _polygons_5.inputPortByName['name'].widget.set("", run=False) except: print "WARNING: failed to restore IndexedPolygonsNE named +polygons in network masterNet" print_exc() _polygons_5=None try: ## saving node Pmv Viewer ## from Pmv.VisionInterface.PmvNodes import PmvViewer Pmv_Viewer_6 = PmvViewer(viewer=masterNet.editor.vf.GUI.VIEWER, constrkw = {'viewer': 'masterNet.editor.vf.GUI.VIEWER'}, name='Pmv Viewer', library=pmvlib) masterNet.addNode(Pmv_Viewer_6,256,312) state = {'localViewer': False, 'twoSide': 0, 'ambient': (0.20000000000000001, 0.20000000000000001, 0.20000000000000001, 1.0)} apply(Pmv_Viewer_6.vi.lightModel.Set, (), state) except: print "WARNING: failed to restore PmvViewer named Pmv Viewer in network masterNet" print_exc() Pmv_Viewer_6=None try: ## saving node Left_Isocontour ## from Volume.VisionInterface.VolumeNodes import Isocontour Left_Isocontour_7 = Isocontour(constrkw = {}, name='Left_Isocontour', library=vollib) masterNet.addNode(Left_Isocontour_7,35,38) apply(Left_Isocontour_7.addOutputPort, (), {'name': 'isovalue', 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) apply(Left_Isocontour_7.inputPortByName['isovalue'].widget.configure, (), {'max': 401.27560424804688, 'min': -556.299072265625}) Left_Isocontour_7.inputPortByName['isovalue'].widget.set(-1.0, run=False) Left_Isocontour_7.inputPortByName['calculatesignatures'].widget.set(1, run=False) code = """def doit(self, grid3D, isovalue, calculatesignatures, verbosity): from UTpackages.UTisocontour import isocontour if verbosity is not None and verbosity!=self.verbosity: isocontour.setVerboseLevel(verbosity) self.verbosity = verbosity #return data = grid3D.data if self.inputPortByName['grid3D'].hasNewValidData(): origin = Numeric.array(grid3D.origin).astype('f') stepsize = Numeric.array(grid3D.stepSize).astype('f') # add 1 dimension for time steps amd 1 for multiple variables if data.dtype.char!=Numeric.Float32: print 'converting from ', data.dtype.char data = data.astype('f')#Numeric.Float32) self.newgrid3D = Numeric.ascontiguousarray(Numeric.reshape( Numeric.transpose(data), (1, 1)+tuple(data.shape) ), data.dtype.char) # destroy the ConDataset structure if self.data: isocontour.delDatasetReg(self.data) self.data = isocontour.newDatasetRegFloat3D( self.newgrid3D, origin, stepsize) w = self.inputPortByName['isovalue'].widget if w and grid3D is not None: mymin, mymax, mymean, mystdev = grid3D.stats() if (isinstance(mymin, Numeric.ArrayType)) and (mymin.shape == () ): mymin = mymin[0] if (isinstance(mymax, Numeric.ArrayType)) and (mymax.shape == () ): mymax = mymax[0] w.widget.setMin(mymin) w.widget.setMax(mymax) #print 'isovalue in doit():', isovalue if (isovalue < mymin) or (isovalue > mymax): isovalue = mymean w.widget.set( isovalue ) warnings.warn('%s: isovalue was outside data range, isovalue is now set to the mean'%self.name) if self.data: isoc = isocontour.getContour3d(self.data, 0, 0, isovalue, isocontour.NO_COLOR_VARIABLE) vert = Numeric.zeros((isoc.nvert,3)).astype('f') norm = Numeric.zeros((isoc.nvert,3)).astype('f') col = Numeric.zeros((isoc.nvert)).astype('f') tri = Numeric.zeros((isoc.ntri,3)).astype('i') isocontour.getContour3dData(isoc, vert, norm, col, tri, 0) if grid3D.crystal: vert = grid3D.crystal.toCartesian(vert) self.outputData(coords=vert, indices=tri, normals=-norm, isovalue=isovalue) """ Left_Isocontour_7.configure(function=code) except: print "WARNING: failed to restore Isocontour named Left_Isocontour in network masterNet" print_exc() Left_Isocontour_7=None try: ## saving node Right_Isocontour ## from Volume.VisionInterface.VolumeNodes import Isocontour Right_Isocontour_8 = Isocontour(constrkw = {}, name='Right_Isocontour', library=vollib) masterNet.addNode(Right_Isocontour_8,517,34) apply(Right_Isocontour_8.addOutputPort, (), {'name': 'isovalue', 'datatype': 'float', 'height': 12, 'width': 12, 'shape': 'circle', 'color': 'green'}) apply(Right_Isocontour_8.inputPortByName['isovalue'].widget.configure, (), {'max': 401.27560424804688, 'min': -556.299072265625}) Right_Isocontour_8.inputPortByName['isovalue'].widget.set(1.0, run=False) Right_Isocontour_8.inputPortByName['calculatesignatures'].widget.set(1, run=False) code = """def doit(self, grid3D, isovalue, calculatesignatures=None, verbosity=None): from UTpackages.UTisocontour import isocontour if verbosity is not None and verbosity!=self.verbosity: isocontour.setVerboseLevel(verbosity) self.verbosity = verbosity #return data = grid3D.data if self.inputPortByName['grid3D'].hasNewValidData(): origin = Numeric.array(grid3D.origin).astype('f') stepsize = Numeric.array(grid3D.stepSize).astype('f') # add 1 dimension for time steps amd 1 for multiple variables if data.dtype.char!=Numeric.Float32: print 'converting from ', data.dtype.char data = data.astype('f')#Numeric.Float32) self.newgrid3D = Numeric.ascontiguousarray(Numeric.reshape( Numeric.transpose(data), (1, 1)+tuple(data.shape) ), data.dtype.char) # destroy the ConDataset structure if self.data: isocontour.delDatasetReg(self.data) self.data = isocontour.newDatasetRegFloat3D( self.newgrid3D, origin, stepsize) w = self.inputPortByName['isovalue'].widget if w and grid3D is not None: mymin, mymax, mymean, mystdev = grid3D.stats() if (isinstance(mymin, Numeric.ArrayType)) and (mymin.shape == () ): mymin = mymin[0] if (isinstance(mymax, Numeric.ArrayType)) and (mymax.shape == () ): mymax = mymax[0] w.widget.setMin(mymin) w.widget.setMax(mymax) #print 'isovalue in doit():', isovalue if (isovalue < mymin) or (isovalue > mymax): isovalue = mymean w.widget.set( isovalue ) warnings.warn('%s: isovalue was outside data range, isovalue is now set to the mean'%self.name) if self.data: isoc = isocontour.getContour3d(self.data, 0, 0, isovalue, isocontour.NO_COLOR_VARIABLE) vert = Numeric.zeros((isoc.nvert,3)).astype('f') norm = Numeric.zeros((isoc.nvert,3)).astype('f') col = Numeric.zeros((isoc.nvert)).astype('f') tri = Numeric.zeros((isoc.ntri,3)).astype('i') isocontour.getContour3dData(isoc, vert, norm, col, tri, 0) if grid3D.crystal: vert = grid3D.crystal.toCartesian(vert) self.outputData(coords=vert, indices=tri, normals=norm, isovalue=isovalue) """ Right_Isocontour_8.configure(function=code) except: print "WARNING: failed to restore Isocontour named Right_Isocontour in network masterNet" print_exc() Right_Isocontour_8=None try: ## saving node Pmv Grids ## from Volume.VisionInterface.VolumeNodes import PmvGridChooser Pmv_Grids_9 = PmvGridChooser(constrkw = {}, name='Pmv Grids', library=vollib) masterNet.addNode(Pmv_Grids_9,200,9) apply(Pmv_Grids_9.configure, (), {'expanded': True}) except: print "WARNING: failed to restore PmvGridChooser named Pmv Grids in network masterNet" print_exc() Pmv_Grids_9=None masterNet.freeze() ## saving connections for network APBSIsoContour ## if GenSurf_2 is not None and Pmv_Viewer_6 is not None: try: masterNet.connectNodes( GenSurf_2, Pmv_Viewer_6, "out0", "geometries", blocking=True) except: print "WARNING: failed to restore connection between GenSurf_2 and Pmv_Viewer_6 in network masterNet" if GenSurf_2 is not None and Pmv_Viewer_6 is not None: try: masterNet.connectNodes( GenSurf_2, Pmv_Viewer_6, "out1", "geometries", blocking=True) except: print "WARNING: failed to restore connection between GenSurf_2 and Pmv_Viewer_6 in network masterNet" if Left_Isocontour_7 is not None and _polygons_4 is not None: try: masterNet.connectNodes( Left_Isocontour_7, _polygons_4, "coords", "coords", blocking=True) except: print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" if Left_Isocontour_7 is not None and _polygons_4 is not None: try: masterNet.connectNodes( Left_Isocontour_7, _polygons_4, "indices", "indices", blocking=True) except: print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" if Left_Isocontour_7 is not None and _polygons_4 is not None: try: masterNet.connectNodes( Left_Isocontour_7, _polygons_4, "normals", "vnormals", blocking=True) except: print "WARNING: failed to restore connection between Left_Isocontour_7 and _polygons_4 in network masterNet" if GenSurf_3 is not None and Pmv_Viewer_6 is not None: try: masterNet.connectNodes( GenSurf_3, Pmv_Viewer_6, "out0", "geometries", blocking=True) except: print "WARNING: failed to restore connection between GenSurf_3 and Pmv_Viewer_6 in network masterNet" if GenSurf_3 is not None and Pmv_Viewer_6 is not None: try: masterNet.connectNodes( GenSurf_3, Pmv_Viewer_6, "out1", "geometries", blocking=True) except: print "WARNING: failed to restore connection between GenSurf_3 and Pmv_Viewer_6 in network masterNet" if Right_Isocontour_8 is not None and _polygons_5 is not None: try: masterNet.connectNodes( Right_Isocontour_8, _polygons_5, "coords", "coords", blocking=True) except: print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" if Right_Isocontour_8 is not None and _polygons_5 is not None: try: masterNet.connectNodes( Right_Isocontour_8, _polygons_5, "indices", "indices", blocking=True) except: print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" if Right_Isocontour_8 is not None and _polygons_5 is not None: try: masterNet.connectNodes( Right_Isocontour_8, _polygons_5, "normals", "vnormals", blocking=True) except: print "WARNING: failed to restore connection between Right_Isocontour_8 and _polygons_5 in network masterNet" if _polygons_4 is not None and GenSurf_3 is not None: try: masterNet.connectNodes( _polygons_4, GenSurf_3, "indexedPolygons", "geom1", blocking=True) except: print "WARNING: failed to restore connection between _polygons_4 and GenSurf_3 in network masterNet" if Left_Isocontour_7 is not None and GenSurf_3 is not None: try: masterNet.connectNodes( Left_Isocontour_7, GenSurf_3, "isovalue", "value", blocking=True) except: print "WARNING: failed to restore connection between Left_Isocontour_7 and GenSurf_3 in network masterNet" if _polygons_5 is not None and GenSurf_2 is not None: try: masterNet.connectNodes( _polygons_5, GenSurf_2, "indexedPolygons", "geom1", blocking=True) except: print "WARNING: failed to restore connection between _polygons_5 and GenSurf_2 in network masterNet" if Right_Isocontour_8 is not None and GenSurf_2 is not None: try: masterNet.connectNodes( Right_Isocontour_8, GenSurf_2, "isovalue", "value", blocking=True) except: print "WARNING: failed to restore connection between Right_Isocontour_8 and GenSurf_2 in network masterNet" if Pmv_Grids_9 is not None and Left_Isocontour_7 is not None: try: masterNet.connectNodes( Pmv_Grids_9, Left_Isocontour_7, "grid", "grid3D", blocking=True) except: print "WARNING: failed to restore connection between Pmv_Grids_9 and Left_Isocontour_7 in network masterNet" if Pmv_Grids_9 is not None and Right_Isocontour_8 is not None: try: masterNet.connectNodes( Pmv_Grids_9, Right_Isocontour_8, "grid", "grid3D", blocking=True) except: print "WARNING: failed to restore connection between Pmv_Grids_9 and Right_Isocontour_8 in network masterNet" if Pmv_Grids_9 is not None and VolumeStats_1 is not None: try: masterNet.connectNodes( Pmv_Grids_9, VolumeStats_1, "grid", "grid", blocking=True) except: print "WARNING: failed to restore connection between Pmv_Grids_9 and VolumeStats_1 in network masterNet" masterNet.unfreeze() #masterNet.run()
44.70282
159
0.651495
2,471
20,608
5.316876
0.130312
0.014462
0.026031
0.047496
0.842442
0.812909
0.782539
0.764652
0.755518
0.722865
0
0.038338
0.229183
20,608
460
160
44.8
0.788732
0.041246
0
0.659574
1
0.021277
0.585921
0.140328
0
0
0
0
0
0
null
null
0
0.053191
null
null
0.106383
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
484141a5f5d24161261164621d438929fb429c82
496
py
Python
spotdl/metadata/exceptions.py
Sigill/spotify-downloader
f65f2f97a10e46b7528f8a1666be30eac6de8a73
[ "MIT" ]
null
null
null
spotdl/metadata/exceptions.py
Sigill/spotify-downloader
f65f2f97a10e46b7528f8a1666be30eac6de8a73
[ "MIT" ]
null
null
null
spotdl/metadata/exceptions.py
Sigill/spotify-downloader
f65f2f97a10e46b7528f8a1666be30eac6de8a73
[ "MIT" ]
null
null
null
class MetadataNotFoundError(Exception): __module__ = Exception.__module__ def __init__(self, message=None): super().__init__(message) class SpotifyMetadataNotFoundError(MetadataNotFoundError): __module__ = Exception.__module__ def __init__(self, message=None): super().__init__(message) class YouTubeMetadataNotFoundError(MetadataNotFoundError): __module__ = Exception.__module__ def __init__(self, message=None): super().__init__(message)
23.619048
58
0.741935
42
496
7.619048
0.285714
0.1875
0.196875
0.225
0.715625
0.715625
0.715625
0.715625
0.715625
0.715625
0
0
0.167339
496
20
59
24.8
0.774818
0
0
0.75
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.75
0
0
0
0
null
0
1
1
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
9
4842475a32cf8d7c934daa91abe32a5844699f5b
25,243
py
Python
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/addremove/lag/iosxe/addremove.py
kecorbin/genielibs
5d3951b8911013691822e73e9c3d0f557ca10f43
[ "Apache-2.0" ]
null
null
null
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/addremove/lag/iosxe/addremove.py
kecorbin/genielibs
5d3951b8911013691822e73e9c3d0f557ca10f43
[ "Apache-2.0" ]
null
null
null
pkgs/sdk-pkg/src/genie/libs/sdk/triggers/addremove/lag/iosxe/addremove.py
kecorbin/genielibs
5d3951b8911013691822e73e9c3d0f557ca10f43
[ "Apache-2.0" ]
null
null
null
'''IOSXE Implementation for Lag addremove triggers''' # python from functools import partial # import genie.libs from genie.libs.sdk.libs.utils.mapping import Mapping from genie.libs.sdk.triggers.addremove.addremove import TriggerAddRemove from genie.libs.sdk.libs.abstracted_libs.iosxe.processors import check_interface_counters # ATS from ats import aetest from ats.utils.objects import NotExists, Not # Which key to exclude for ACL Ops comparison lag_exclude = ['maker', 'counters', 'system_priority'] interface_exclude = ['maker', 'last_change','in_rate','in_rate_pkts', 'out_rate', 'out_rate_pkts', 'in_octets', 'in_pkts', 'in_unicast_pkts', 'out_octets', 'out_pkts', 'out_unicast_pkts', 'out_multicast_pkts', 'in_multicast_pkts', 'last_clear', 'in_broadcast_pkts', 'out_broadcast_pkts', 'in_errors', '(Tunnel.*)', 'status', 'accounting'] class TriggerAddRemoveTrunkEtherchannelLacp(TriggerAddRemove): """Apply the Etherchannel in LACP mode, and remove the added Etherchannel in LACP mode """ __description__ = """Apply the Etherchannel in LACP mode, and remove the added Etherchannel in LACP mode. trigger_datafile: Mandatory: timeout: max_time (`int`): Maximum wait time for the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 method (`str`): Method to recover the device configuration, Support methods: 'checkpoint': Rollback the configuration by checkpoint (nxos), archive file (iosxe), load the saved running-config file on disk (iosxr) Optional: tgn_timeout (`int`): Maximum wait time for all traffic threads to be restored to the reference rate, in second. Default: 60 tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed, in second. Default: 10 timeout_recovery: Buffer recovery timeout make sure devices are recovered at the end of the trigger execution. Used when previous timeouts have been exhausted. max_time (`int`): Maximum wait time for the last step of the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 steps: 1. Learn Interface Ops object to select trunk interfaces. Learn LAG ops object to find port-channle interfaces which does not have the learned interfaces as memebers. 2. Save the current device configurations through "method" which user uses 3. Add the configuration of Etherchannel in LACP mode with interface Conf object 4. Verify the interfaces are in the por-channle interfaces from step 3 has configured 5. Remove the Etherchannel configurations. 6. Recover the device configurations to the one in step 2 7. Learn LAG Ops again and verify it is the same as the Ops in step 1 """ # The added new values BUNDLE_ID = 10 BUNDLE_ID_INTF = 'Port-channel' + str(BUNDLE_ID) @aetest.processors(post=[partial(check_interface_counters, ports=[BUNDLE_ID_INTF], keys = [['interface', BUNDLE_ID_INTF, 'out', 'ucast_pkts', '(.*)']], threshold='islargerthan(100)')]) @aetest.test def verify_configuration(self, uut, abstract, steps): super().verify_configuration(uut, abstract, steps) mapping = Mapping(requirements={'ops.lag.lag.Lag':{ 'requirements': [['info', 'interfaces', NotExists({BUNDLE_ID_INTF})], [NotExists('info')]], 'all_keys': True, 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_mode', 'trunk'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up']], 'kwargs': {'attributes': ['info[(.*)][switchport_mode]', 'info[(.*)][enabled]', 'info[(.*)][oper_status]', 'info[(.*)][port_channel]']}, 'exclude': interface_exclude}}, config_info={'conf.interface.Interface':{ 'requirements':[['lag_bundle_id', BUNDLE_ID], ['lag_activity', 'active']], 'verify_conf':False, 'kwargs':{'mandatory':{'name': '(?P<intf>.*)', 'attach': False}}}}, verify_ops={'ops.lag.lag.Lag':{ 'requirements': [\ ['info', 'interfaces', BUNDLE_ID_INTF, 'bundle_id', BUNDLE_ID], ['info', 'interfaces', BUNDLE_ID_INTF, 'protocol', 'lacp'], ['info', 'interfaces', BUNDLE_ID_INTF, 'oper_status', 'up'], ['info', 'interfaces', BUNDLE_ID_INTF, 'name', 'Port-channel10'], ['info', 'interfaces', BUNDLE_ID_INTF, 'members', '(?P<intf>.*)', 'bundled', True]], 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_mode', 'trunk'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'port_channel', 'port_channel_member', True], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'port_channel', 'port_channel_int', BUNDLE_ID_INTF], ['info', BUNDLE_ID_INTF, 'oper_status', 'up'], ['info', BUNDLE_ID_INTF, 'enabled', True], ['info', BUNDLE_ID_INTF, 'oper_status', 'up'], ['info', BUNDLE_ID_INTF, 'port_channel', 'port_channel_member', True], ['info', BUNDLE_ID_INTF, 'port_channel', 'port_channel_member_intfs', '(.*)'], ['info', BUNDLE_ID_INTF, 'switchport_enable', True], ['info', BUNDLE_ID_INTF, 'switchport_mode', 'trunk'],], 'kwargs': {'attributes': ['info']}, 'exclude': interface_exclude}}, num_values={'intf':'all', 'bundle_id': 1}) class TriggerAddRemoveAccessEtherchannelPagp(TriggerAddRemove): """Apply the Etherchannel in PAGP mode, and remove the added Etherchannel in PAGP mode """ __description__ = """Apply the Etherchannel in PAGP mode, and remove the added Etherchannel in PAGP mode. trigger_datafile: Mandatory: timeout: max_time (`int`): Maximum wait time for the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 method (`str`): Method to recover the device configuration, Support methods: 'checkpoint': Rollback the configuration by checkpoint (nxos), archive file (iosxe), load the saved running-config file on disk (iosxr) Optional: tgn_timeout (`int`): Maximum wait time for all traffic threads to be restored to the reference rate, in second. Default: 60 tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed, in second. Default: 10 timeout_recovery: Buffer recovery timeout make sure devices are recovered at the end of the trigger execution. Used when previous timeouts have been exhausted. max_time (`int`): Maximum wait time for the last step of the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 steps: 1. Learn Interface Ops object to select trunk interfaces. Learn LAG ops object to find port-channle interfaces which does not have the learned interfaces as memebers. 2. Save the current device configurations through "method" which user uses 3. Add the configuration of Etherchannel in PAGP mode with interface Conf object 4. Verify the interfaces are in the por-channle interfaces from step 3 has configured 5. Remove the Etherchannel configurations. 6. Recover the device configurations to the one in step 2 7. Learn LAG Ops again and verify it is the same as the Ops in step 1 """ BUNDLE_ID = 10 BUNDLE_ID_INTF = 'Port-channel' + str(BUNDLE_ID) mapping = Mapping(requirements={'ops.lag.lag.Lag':{ 'requirements':[\ ['info', 'interfaces', NotExists(BUNDLE_ID_INTF)], [NotExists('info')]], 'all_keys': True, 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_mode', 'static access'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up']], 'kwargs': {'attributes': ['info[(.*)][switchport_mode]', 'info[(.*)][enabled]', 'info[(.*)][oper_status]', 'info[(.*)][port_channel]']}, 'exclude': interface_exclude}}, config_info={'conf.interface.Interface':{ 'requirements':[['lag_bundle_id', BUNDLE_ID], ['lag_activity', 'desirable']], 'verify_conf':False, 'kwargs':{'mandatory':{'name': '(?P<intf>.*)', 'attach': False}}}}, verify_ops={'ops.lag.lag.Lag':{ 'requirements': [\ ['info', 'interfaces', BUNDLE_ID_INTF, 'bundle_id', BUNDLE_ID], ['info', 'interfaces', BUNDLE_ID_INTF, 'protocol', 'pagp'], ['info', 'interfaces', BUNDLE_ID_INTF, 'oper_status', 'up'], ['info', 'interfaces', BUNDLE_ID_INTF, 'name', 'Port-channel10'], ['info', 'interfaces', BUNDLE_ID_INTF, 'members', '(?P<intf>.*)', 'bundled', True]], 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_mode', 'static access'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up'], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'port_channel', 'port_channel_member', True], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'port_channel', 'port_channel_int', BUNDLE_ID_INTF], ['info', BUNDLE_ID_INTF, 'oper_status', 'up'], ['info', BUNDLE_ID_INTF, 'enabled', True], ['info', BUNDLE_ID_INTF, 'port_channel', 'port_channel_member', True], ['info', BUNDLE_ID_INTF, 'port_channel', 'port_channel_member_intfs', '(.*)'], ['info', BUNDLE_ID_INTF, 'switchport_mode', 'static access']], 'kwargs': {'attributes': ['info']}, 'exclude': interface_exclude}}, num_values={'intf':'all', 'bundle_id': 1}) class TriggerAddRemoveL3EtherchannelPagp(TriggerAddRemove): """Apply the configuration for L3 Etherchannel in PAGP mode, and remove the added Etherchannel in PAGP mode """ __description__ = """Apply the configuration for L3 Etherchannel in PAGP mode, and remove the added Etherchannel in PAGP mode. trigger_datafile: Mandatory: timeout: max_time (`int`): Maximum wait time for the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 method (`str`): Method to recover the device configuration, Support methods: 'checkpoint': Rollback the configuration by checkpoint (nxos), archive file (iosxe), load the saved running-config file on disk (iosxr) Optional: tgn_timeout (`int`): Maximum wait time for all traffic threads to be restored to the reference rate, in second. Default: 60 tgn_delay (`int`): Wait time between each poll to verify if traffic is resumed, in second. Default: 10 timeout_recovery: Buffer recovery timeout make sure devices are recovered at the end of the trigger execution. Used when previous timeouts have been exhausted. max_time (`int`): Maximum wait time for the last step of the trigger, in second. Default: 180 interval (`int`): Wait time between iterations when looping is needed, in second. Default: 15 steps: 1. Learn Interface Ops object to select up interfaces. Learn LAG ops object to find port-channle interfaces which does not exists. 2. Save the current device configurations through "method" which user uses 3. Add the configuration of Etherchannel in PAGP mode with interface Conf object, Add ip address configuration to the learned port-channel interfaces 4. Verify the interfaces are in the por-channle interfaces from step 3 has configured 5. Remove the Etherchannel and port-channel configurations. 6. Recover the device configurations to the one in step 2 7. Learn LAG Ops again and verify it is the same as the Ops in step 1 """ counters_port = [] counters_keys = [['interface', '(?P<bundle_intf>.*)', 'out', 'ucast_pkts', '(.*)']] @aetest.processors(post=[partial(check_interface_counters, ports=counters_port, keys =counters_keys, threshold='islargerthan(100)')]) @aetest.test def verify_configuration(self, uut, abstract, steps): super().verify_configuration(uut, abstract, steps) mapping = Mapping(requirements={'ops.lag.lag.Lag':{ 'requirements':[\ ['info', 'interfaces', '(?P<bundle_intf>.*)', NotExists('members')], ['info', 'interfaces', '(?P<bundle_intf>.*)', 'bundle_id', '(?P<bundle_id>.*)']], 'all_keys': True, 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_enable', False], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up']], 'kwargs': {'attributes': ['info[(.*)][switchport_enable]', 'info[(.*)][operational_mode]', 'info[(.*)][oper_status]', 'info[(.*)][enabled]', 'info[(.*)][port_channel]']}, 'exclude': interface_exclude}}, config_info={'conf.interface.Interface':{ 'requirements':[['lag_bundle_id', '(?P<bundle_id>.*)'], ['lag_activity', 'desirable']], 'verify_conf':False, 'kwargs':{'mandatory':{'name': '(?P<intf>.*)', 'attach': False}}}}, verify_ops={'ops.lag.lag.Lag':{ 'requirements': [\ ['info', 'interfaces', '(?P<bundle_intf>.*)', 'bundle_id', '(?P<bundle_id>.*)'], ['info', 'interfaces', '(?P<bundle_intf>.*)', 'protocol', 'pagp'], ['info', 'interfaces', '(?P<bundle_intf>.*)', 'oper_status', 'up'], ['info', 'interfaces', '(?P<bundle_intf>.*)', 'name', '(?P<bundle_intf>.*)'], ['info', 'interfaces', '(?P<bundle_intf>.*)', 'members', '(?P<intf>.*)', 'bundled', True]], 'kwargs':{'attributes':['info[interfaces][(.*)]']}, 'exclude': lag_exclude + ['attribute']}, 'ops.interface.interface.Interface':{ 'requirements':[['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'switchport_enable', False], ['info', '(?P<intf>\w+Ethernet[\d\/]+$)', 'oper_status', 'up'], ['info', '(?P<bundle_intf>.*)', 'oper_status', 'up'], ['info', '(?P<bundle_intf>.*)', 'enabled', True], ['info', '(?P<bundle_intf>.*)', 'oper_status', 'up'], ['info', '(?P<bundle_intf>.*)', 'port_channel', 'port_channel_member', True], ['info', '(?P<bundle_intf>.*)', 'port_channel', 'port_channel_member_intfs', '(.*)']], 'kwargs': {'attributes': ['info[(.*)][switchport_enable]', 'info[(.*)][operational_mode]', 'info[(.*)][oper_status]', 'info[(.*)][enabled]', 'info[(.*)][port_channel]']}, 'exclude': interface_exclude}}, num_values={'intf':'all', 'bundle_id': 1})
66.428947
129
0.38894
1,860
25,243
5.13172
0.123656
0.042745
0.037716
0.016763
0.891671
0.87407
0.868308
0.864955
0.853222
0.845783
0
0.007429
0.509409
25,243
380
130
66.428947
0.763324
0.01644
0
0.85241
0
0
0.460629
0.052347
0
0
0
0
0
1
0.006024
false
0
0.018072
0
0.069277
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
486e6ba6c3b8d2c1ea34cda749f4b03c0199a42a
3,161
py
Python
common/constants/pieces.py
sk364/prosfair
bb16dd19aee9804b0a1b239b00ff99e285d7fd96
[ "MIT" ]
null
null
null
common/constants/pieces.py
sk364/prosfair
bb16dd19aee9804b0a1b239b00ff99e285d7fd96
[ "MIT" ]
null
null
null
common/constants/pieces.py
sk364/prosfair
bb16dd19aee9804b0a1b239b00ff99e285d7fd96
[ "MIT" ]
null
null
null
from common import rules PIECE_NAME_MAP = { "p": "Pawn", "r": "Rook", "n": "Knight", "b": "Bishop", "q": "Queen", "k": "King" } PIECE_PRIORITY_MAP = { "b": 3, "k": 0, "n": 3, "p": 1, "q": 9, "r": 5 } PIECE_SQUARE_MAP = { "p": [ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0], [1.0, 1.0, 2.0, 3.0, 3.0, 2.0, 1.0, 1.0], [0.5, 0.5, 1.0, 2.5, 2.5, 1.0, 0.5, 0.5], [0.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 0.0], [0.5, -0.5, -1.0, 0.0, 0.0, -1.0, -0.5, 0.5], [0.5, 1.0, 1.0, -2.0, -2.0, 1.0, 1.0, 0.5], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] ], "n": [ [-5.0, -4.0, -3.0, -3.0, -3.0, -3.0, -4.0, -5.0], [-4.0, -2.0, 0.0, 0.0, 0.0, 0.0, -2.0, -4.0], [-3.0, 0.0, 1.0, 1.5, 1.5, 1.0, 0.0, -3.0], [-3.0, 0.5, 1.5, 2.0, 2.0, 1.5, 0.5, -3.0], [-3.0, 0.0, 1.5, 2.0, 2.0, 1.5, 0.0, -3.0], [-3.0, 0.5, 1.0, 1.5, 1.5, 1.0, 0.5, -3.0], [-4.0, -2.0, 0.0, 0.5, 0.5, 0.0, -2.0, -4.0], [-5.0, -4.0, -3.0, -3.0, -3.0, -3.0, -4.0, -5.0] ], "b": [ [ -2.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -2.0], [ -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [ -1.0, 0.0, 0.5, 1.0, 1.0, 0.5, 0.0, -1.0], [ -1.0, 0.5, 0.5, 1.0, 1.0, 0.5, 0.5, -1.0], [ -1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 0.0, -1.0], [ -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, -1.0], [ -1.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, -1.0], [ -2.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -2.0] ], "r": [ [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [ 0.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5], [ -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5], [ -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5], [ -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5], [ -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5], [ -0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.5], [ 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0] ], "q": [ [ -2.0, -1.0, -1.0, -0.5, -0.5, -1.0, -1.0, -2.0], [ -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0], [ -1.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, -1.0], [ -0.5, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, -0.5], [ 0.0, 0.0, 0.5, 0.5, 0.5, 0.5, 0.0, -0.5], [ -1.0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.0, -1.0], [ -1.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, -1.0], [ -2.0, -1.0, -1.0, -0.5, -0.5, -1.0, -1.0, -2.0] ], "k": [ [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0], [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0], [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0], [ -3.0, -4.0, -4.0, -5.0, -5.0, -4.0, -4.0, -3.0], [ -2.0, -3.0, -3.0, -4.0, -4.0, -3.0, -3.0, -2.0], [ -1.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -1.0], [ 2.0, 2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 2.0 ], [ 2.0, 3.0, 1.0, 0.0, 0.0, 1.0, 3.0, 2.0 ] ] } PIECE_RULE_METHODS = { "p": rules.legal_pawn_moves, "r": rules.legal_rook_moves, "k": rules.legal_king_moves, "q": rules.legal_queen_moves, "b": rules.legal_bishop_moves, "n": rules.legal_knight_moves }
34.358696
55
0.330592
844
3,161
1.214455
0.037915
0.478049
0.559024
0.616585
0.745366
0.737561
0.725854
0.714146
0.687805
0.602927
0
0.353748
0.307814
3,161
91
56
34.736264
0.114717
0
0
0.206897
0
0
0.016767
0
0
0
0
0
0
1
0
false
0
0.011494
0
0.011494
0
0
0
1
null
1
1
1
0
1
1
1
0
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
6fdd78ed787c41f73f35046880e7d80f952e40c8
6,745
py
Python
odin/compute/numpy.py
Anderssorby/odin
844dd2ec32a7c3e15959c86ad93659e7de131064
[ "MIT" ]
null
null
null
odin/compute/numpy.py
Anderssorby/odin
844dd2ec32a7c3e15959c86ad93659e7de131064
[ "MIT" ]
null
null
null
odin/compute/numpy.py
Anderssorby/odin
844dd2ec32a7c3e15959c86ad93659e7de131064
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from progress.bar import ChargingBar from scipy import linalg as LA from .base import ComputationInterface # noinspection PyUnresolvedReferences class Numpy(ComputationInterface): def __init__(self): super(Numpy, self).__init__() self.cuda = None self.using_gpu = False def update_args(self, args): super(Numpy, self).update_args(args) if self.args.gpu >= 0: print("Getting GPU") from chainer import cuda self.cuda = cuda cuda.get_device(self.args.gpu).use() self.xp = cuda.cupy self.using_gpu = True else: import numpy as np self.xp = np def calc_block_inter_layer_covariance(self, model_wrapper, use_training_data=True, batch_size=100, **options): model = model_wrapper.model is_chainer = model_wrapper.model_type == "chainer" if self.using_gpu and is_chainer: model.to_gpu() xp = self.xp train, test = model_wrapper.dataset data_x = train if use_training_data else test if is_chainer: data_x = xp.moveaxis(data_x, -1, 0)[0] else: data_x = data_x[0] data_x = xp.stack(data_x, axis=0) data_size = len(data_x) if batch_size > 0: perm = xp.random.permutation(data_size) data_x = data_x[perm[0:batch_size]] data_size = batch_size compute_batch_size = 100 if is_chainer: model.train = False # perm = xp.random.permutation(data_size) full_mean = [] cov = [] test_num = 0 bar = ChargingBar("Calculating inter layer covariance", max=data_size) for batch in range(0, data_size, compute_batch_size): test_num += 1 # ind_tmp = perm[batch:batch + batch_size] xp.asarray(, dtype=xp.float32) x = data_x[batch:batch + compute_batch_size] layer_outputs = model_wrapper.get_layer_outputs(x) for i, layer_out in enumerate(layer_outputs): if is_chainer: layer_out = layer_out.data # tmp_mean = xp.mean(layer_out, axis=0) # tmp_cov = xp.einsum("a,b->ab", layer_out.ravel(), layer_out.ravel()) tmp_cov = None for fxi in layer_out: fxi = fxi.ravel() dot = xp.outer(fxi, fxi) if tmp_cov is None: tmp_cov = dot else: tmp_cov += dot bar.next() if batch == 0: full_mean.append(tmp_mean) cov.append(tmp_cov) else: # full_mean[i] += tmp_mean cov[i] += tmp_cov logging.debug("Computed covariance for batch %d of size %d" % (batch, compute_batch_size)) bar.finish() bar = ChargingBar("Calculating eigen values", max=len(cov)) eigen_values = [] for j in range(len(cov)): cov[j] = cov[j] / test_num if self.using_gpu: tmp_cov_ma = self.cuda.to_cpu(cov[j]) else: tmp_cov_ma = cov[j] eigs = LA.eigvals(tmp_cov_ma) eigen_values.append(eigs) bar.next() bar.finish() # Saving self.store_elements({ "cov": cov, "eigen_values": eigen_values, }, group_name="inter_layer_covariance", model_wrapper=model_wrapper) def calc_inter_layer_covariance(self, model_wrapper, use_training_data=True, batch_size=100, **options): model = model_wrapper.model is_chainer = model_wrapper.model_type == "chainer" if self.using_gpu and is_chainer: model.to_gpu() xp = self.xp train, test = model_wrapper.dataset data_x = train if use_training_data else test if is_chainer: data_x = xp.moveaxis(data_x, -1, 0)[0] else: data_x = data_x[0] data_x = xp.stack(data_x, axis=0) data_size = len(data_x) if batch_size and batch_size > 0: perm = xp.random.permutation(data_size) data_x = data_x[perm[0:batch_size]] data_size = batch_size compute_batch_size = 100 if is_chainer: model.train = False # perm = xp.random.permutation(data_size) # full_mean = [] cov = [] test_num = 0 bar = ChargingBar("Calculating inter layer covariance", max=data_size) for batch in range(0, data_size, compute_batch_size): test_num += 1 # ind_tmp = perm[batch:batch + batch_size] xp.asarray(, dtype=xp.float32) x = data_x[batch:batch + compute_batch_size] layer_outputs = model_wrapper.get_layer_outputs(x) for i, layer_out in enumerate(layer_outputs): if is_chainer: layer_out = layer_out.data # tmp_mean = xp.mean(layer_out, axis=0) # tmp_cov = xp.einsum("a,b->ab", layer_out.ravel(), layer_out.ravel()) tmp_cov = None for fxi in layer_out: fxi = fxi.ravel() dot = xp.outer(fxi, fxi) if tmp_cov is None: tmp_cov = dot else: tmp_cov += dot bar.next() if batch == 0: # full_mean.append(tmp_mean) cov.append(tmp_cov) else: # full_mean[i] += tmp_mean cov[i] += tmp_cov logging.debug("Computed covariance for batch %d of size %d" % (batch, compute_batch_size)) bar.finish() bar = ChargingBar("Calculating eigen values", max=len(cov)) eigen_values = [] for j in range(len(cov)): cov[j] = cov[j] / test_num if self.using_gpu: tmp_cov_ma = self.cuda.to_cpu(cov[j]) else: tmp_cov_ma = cov[j] eigs = LA.eigvals(tmp_cov_ma) eigen_values.append(eigs) bar.next() bar.finish() # Saving self.store_elements({ "cov": cov, "eigen_values": eigen_values, }, group_name="inter_layer_covariance", model_wrapper=model_wrapper)
30.246637
114
0.540252
827
6,745
4.133011
0.14994
0.032183
0.037449
0.016384
0.834114
0.834114
0.834114
0.834114
0.834114
0.834114
0
0.009871
0.369162
6,745
222
115
30.382883
0.79342
0.089103
0
0.801325
0
0
0.049127
0.007181
0
0
0
0
0
1
0.02649
false
0
0.066225
0
0.099338
0.013245
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
d201abaeab339b584fb28109bb5a33dedaf3e960
9,029
py
Python
tests/test_03_auth_handlers.py
zentarim/abfd
10e86f58f0f779a4d02e07afa5f527447dfa1cd1
[ "MIT" ]
null
null
null
tests/test_03_auth_handlers.py
zentarim/abfd
10e86f58f0f779a4d02e07afa5f527447dfa1cd1
[ "MIT" ]
null
null
null
tests/test_03_auth_handlers.py
zentarim/abfd
10e86f58f0f779a4d02e07afa5f527447dfa1cd1
[ "MIT" ]
null
null
null
from bfd.proto import * from bfd.bfd_session import BFDSession from bfd.misc import * from bfd.auth_handlers import * from bfd.auth_handlers import _chk_seq, _chk_mseq from bfd.exceptions import * from bfd.bfd import msg_factory from bfd.const import * from typing import Dict, Type, Optional import pytest import logging from contextlib import contextmanager from pytest import raises as _raises Exc = Optional[Type[Exception]] @contextmanager def raises(exception: Exc = None): if exception: with _raises(exception): yield else: yield @pytest.mark.parametrize("msg_seq, sess_seq, detect_mult, retval", [ (100, 100, 2, True), (101, 100, 2, True), (100+2*3, 100, 2, True), (100+2*3+1, 100, 2, False), (99, 100, 2, False), (MAX32, 1, 2, False), (2*3, MAX32, 2, True) ]) def test_chk_seq(msg_seq: int, sess_seq: int, detect_mult: int, retval: bool): # arrange # act res: bool = _chk_seq(msg_seq, sess_seq, detect_mult) logging.info("msg_seq: %s, sess_seq: %s, detect_mult: %s, retval: %s, res: %s" % (msg_seq, sess_seq, detect_mult, retval, res)) # assert assert res == retval @pytest.mark.parametrize("msg_seq, sess_seq, detect_mult, retval", [ (100, 100, 2, False), (101, 100, 2, True), (100+2*3, 100, 2, True), (100+2*3+1, 100, 2, False), (99, 100, 2, False), (MAX32, 1, 2, False), (2*3, MAX32, 2, True) ]) def test_chk_mseq(msg_seq: int, sess_seq: int, detect_mult: int, retval: bool): # arrange # act res: bool = _chk_mseq(msg_seq, sess_seq, detect_mult) logging.info("msg_seq: %s, sess_seq: %s, detect_mult: %s, retval: %s, res: %s" % (msg_seq, sess_seq, detect_mult, retval, res)) # assert assert res == retval @pytest.mark.parametrize("data, handler_cls", [ ({"auth_type": "simple", "key_id": 123, "passwd": "werty"}, SimpleAuthHandler), ({"auth_type": "key_md5", "key_id": 123, "passwd": "werty"}, KeyMD5AuthHandler), ({"auth_type": "mkey_md5", "key_id": 123, "passwd": "werty"}, MKeyMD5AuthHandler), ({"auth_type": "key_sha1", "key_id": 123, "passwd": "werty"}, KeySHA1AuthHandler), ({"auth_type": "mkey_sha1", "key_id": 123, "passwd": "werty"}, MKeySHA1AuthHandler) ]) def test_factory(data: Dict[str, str or int], handler_cls: AuthHandlerCls): # arrange # act obj: AuthHandlerObj = AuthHandlerFactory(**data) logging.info(obj) # assert assert type(obj) is handler_cls def test_simple_add(): # arrange passwd: bytes = b"123456" key_id: int = 1 msg_in: CtlPacket = CtlPacket() auth_in: SimpleAuth = SimpleAuth(key_id, passwd) auth_handler: SimpleAuthHandler = SimpleAuthHandler(key_id, passwd) # act data: bytearray = auth_handler.add_auth(msg_in) logging.info(hr_bytes(data)) msg_out, auth_out = msg_factory(data) # assert assert msg_in == msg_out assert auth_in == auth_out @pytest.mark.parametrize("hkey_id, hpasswd, mkey_id, mpasswd, exc", [ (100, b'password', 100, b'password', None), (100, b'password', 110, b'password', BadAuth), (100, b'password', 100, b'12121212', BadAuth), ]) def test_simple_check(hkey_id: int, hpasswd: bytes, mkey_id: int, mpasswd: bytes, exc: Exc): # arrange sess: BFDSession = BFDSession("127.0.0.1", 1) msg: CtlPacket = CtlPacket() mdata: memoryview = memoryview(bytearray(bytes(msg))) auth: SimpleAuth = SimpleAuth(mkey_id, mpasswd) auth_handler: SimpleAuthHandler = SimpleAuthHandler(hkey_id, hpasswd) # act with raises(exc): auth_handler.check_auth(auth, mdata, sess) # assert def test_simple_md5key_add(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("6f d7 e5 2e 65 2e 4d bb a4 a7 a9 fe 61 df af d2") key_id: int = 1 seq_num: int = 100 msg_in: CtlPacket = CtlPacket() auth_in: KeyMD5Auth = KeyMD5Auth(key_id, seq_num, _hash) auth_handler: KeyMD5AuthHandler = KeyMD5AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num # act data: bytearray = auth_handler.add_auth(msg_in) logging.info(hr_bytes(data)) msg_out, auth_out = msg_factory(data) logging.info(hr_bytes(auth_out.hash)) # assert assert msg_in == msg_out assert auth_in == auth_out def test_simple_md5key_check(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("6f d7 e5 2e 65 2e 4d bb a4 a7 a9 fe 61 df af d2") key_id: int = 1 seq_num: int = 100 sess: BFDSession = BFDSession("127.0.0.1", 1) msg_in: CtlPacket = CtlPacket() auth_in: KeyMD5Auth = KeyMD5Auth(key_id, seq_num, _hash) auth_handler: KeyMD5AuthHandler = KeyMD5AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num data: bytes = bytes(auth_handler.add_auth(msg_in)) mdata: memoryview = memoryview(bytearray(data)) # act auth_handler.check_auth(auth_in, mdata, sess) # assert assert auth_handler.seq_num == seq_num def test_md5mkey_add(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("78 12 8b fe 57 cc ca 68 ed d8 5d 35 66 1f 60 5a") key_id: int = 1 seq_num: int = 100 msg_in: CtlPacket = CtlPacket() auth_in: MKeyMD5Auth = MKeyMD5Auth(key_id, seq_num, _hash) auth_handler: MKeyMD5AuthHandler = MKeyMD5AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num # act data: bytearray = auth_handler.add_auth(msg_in) logging.info(hr_bytes(data)) msg_out, auth_out = msg_factory(data) logging.info(hr_bytes(auth_out.hash)) # assert assert msg_in == msg_out assert auth_in == auth_out def test_md5mkey_check(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("78 12 8b fe 57 cc ca 68 ed d8 5d 35 66 1f 60 5a") key_id: int = 1 seq_num: int = 100 sess: BFDSession = BFDSession("127.0.0.1", 1) msg_in: CtlPacket = CtlPacket() auth_in: MKeyMD5Auth = MKeyMD5Auth(key_id, seq_num, _hash) auth_handler: MKeyMD5AuthHandler = MKeyMD5AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num data: bytes = bytes(auth_handler.add_auth(msg_in)) mdata: memoryview = memoryview(bytearray(data)) # act auth_handler.check_auth(auth_in, mdata, sess) # assert assert auth_handler.seq_num == seq_num + 1 def test_sha1key_add(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("76 4c b8 e0 e3 5e b2 bb f2 46 13 b1 f2 12 1c 7c ed 70 ba 8b") key_id: int = 1 seq_num: int = 100 msg_in: CtlPacket = CtlPacket() auth_in: KeySHA1Auth = KeySHA1Auth(key_id, seq_num, _hash) auth_handler: KeySHA1AuthHandler = KeySHA1AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num # act data: bytearray = auth_handler.add_auth(msg_in) logging.info(hr_bytes(data)) msg_out, auth_out = msg_factory(data) logging.info(hr_bytes(auth_out.hash)) # assert assert msg_in == msg_out assert auth_in == auth_out def test_sha1key_check(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("76 4c b8 e0 e3 5e b2 bb f2 46 13 b1 f2 12 1c 7c ed 70 ba 8b") key_id: int = 1 seq_num: int = 100 sess: BFDSession = BFDSession("127.0.0.1", 1) msg_in: CtlPacket = CtlPacket() auth_in: KeySHA1Auth = KeySHA1Auth(key_id, seq_num, _hash) auth_handler: KeySHA1AuthHandler = KeySHA1AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num data: bytes = bytes(auth_handler.add_auth(msg_in)) mdata: memoryview = memoryview(bytearray(data)) # act auth_handler.check_auth(auth_in, mdata, sess) # assert assert auth_handler.seq_num == seq_num def test_sha1mkey_add(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("f3 dd a7 4d 1b 50 99 4f 18 2d 65 55 cc 2f 6c d6 7a 24 39 d0") key_id: int = 1 seq_num: int = 100 msg_in: CtlPacket = CtlPacket() auth_in: MKeySHA1Auth = MKeySHA1Auth(key_id, seq_num, _hash) auth_handler: MKeySHA1AuthHandler = MKeySHA1AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num # act data: bytearray = auth_handler.add_auth(msg_in) logging.info(hr_bytes(data)) msg_out, auth_out = msg_factory(data) logging.info(hr_bytes(auth_out.hash)) # assert assert msg_in == msg_out assert auth_in == auth_out def test_sha1mkey_check(): # arrange passwd: bytes = b"123456" _hash: bytes = tobytes("f3 dd a7 4d 1b 50 99 4f 18 2d 65 55 cc 2f 6c d6 7a 24 39 d0") key_id: int = 1 seq_num: int = 100 sess: BFDSession = BFDSession("127.0.0.1", 1) msg_in: CtlPacket = CtlPacket() auth_in: MKeySHA1Auth = MKeySHA1Auth(key_id, seq_num, _hash) auth_handler: MKeySHA1AuthHandler = MKeySHA1AuthHandler(key_id, passwd) auth_handler.seq_num = seq_num data: bytes = bytes(auth_handler.add_auth(msg_in)) mdata: memoryview = memoryview(bytearray(data)) # act auth_handler.check_auth(auth_in, mdata, sess) # assert assert auth_handler.seq_num == seq_num + 1
33.690299
92
0.672943
1,340
9,029
4.30597
0.130597
0.041594
0.029116
0.035355
0.784749
0.767938
0.737782
0.732582
0.732582
0.721144
0
0.065834
0.210987
9,029
268
93
33.690299
0.744104
0.027246
0
0.715
0
0.01
0.114021
0
0
0
0
0
0.085
1
0.07
false
0.155
0.065
0
0.135
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
7
d22312c6a61bbbf89e2efbe610c72d94f882bf30
75,296
py
Python
functions/effects_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
null
null
null
functions/effects_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
1
2021-02-24T21:50:18.000Z
2021-02-24T21:50:18.000Z
functions/effects_functions.py
mtasa-typescript/mtasa-wiki-dump
edea1746850fb6c99d6155d1d7891e2cceb33a5c
[ "MIT" ]
null
null
null
# Autogenerated file. ANY CHANGES WILL BE OVERWRITTEN from to_python.core.types import FunctionType, \ FunctionArgument, \ FunctionArgumentValues, \ FunctionReturnTypes, \ FunctionSignature, \ FunctionDoc, \ FunctionData, \ CompoundFunctionData DUMP_PARTIAL = [ CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='createEffect', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['effect'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='name', argument_type=FunctionType( names=['string'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='x', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='y', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='z', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='rX', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='rY', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='rZ', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value=None, ) ], [ FunctionArgument( name='drawDistance', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='soundEnable', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='false', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates an Element/Effect|effect on specified position.' , arguments={ "name": """A string contains Element/Effect#Effects_list|effect name. """, "x": """A floating point number representing the X coordinate on the map. """, "y": """A floating point number representing the Y coordinate on the map. """, "z": """A floating point number representing the Z coordinate on the map. """, "rX": """A floating point number representing the rotation about the X axis in degrees. """, "rY": """A floating point number representing the rotation about the Y axis in degrees. """, "rZ": """A floating point number representing the rotation about the Z axis in degrees. """, "drawDistance": """A floating point number between 1 and 8191 which represents the draw distance of the effect, or 0 to use the default draw distance. """, "soundEnable": """to enable the sound of the effect. """ }, result='returns the element/effect|effect element if creation was successful, false otherwise.' , ), url='createEffect', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddBlood', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='count', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ], [ FunctionArgument( name='brightness', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a blood splatter particle effect.' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a direction vector indicating where the blood flies to. """, "count": """the number of flying droplets to create. """, "brightness": """the brightness. Ranges from 0 (almost black) to 1 (normal color). """ }, result='' , ), url='fxAddBlood', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddBulletImpact', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='smokeSize', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ], [ FunctionArgument( name='sparkCount', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ], [ FunctionArgument( name='smokeIntensity', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a bullet impact particle effect, consisting of a small smoke cloud and a number of sparks.' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a vector indicating the direction of the effect. """, "smokeSize": """the size of the smoke cloud. """, "sparkCount": """the number of sparks to create. """, "smokeIntensity": """the amount/transparency of smoke, ranges from 0 to 1. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddBulletImpact', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddBulletSplash', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a bullet splash particle effect, normally created when shooting into water.' , arguments={ "posX": """A float representing the x position of the splash """, "posY": """A float representing the y position of the splash """, "posZ": """A float representing the z position of the splash """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddBulletSplash', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddDebris', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='colorR', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='255', ) ], [ FunctionArgument( name='colorG', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='colorB', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='colorA', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='255', ) ], [ FunctionArgument( name='scale', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='count', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a debris particle effect (e.g. bits that fly off a car when ramming a wall).' , arguments={ "posX, posY, posZ": """the world coordinates where the debris originates. """, "colorR, colorG, colorB, colorA": """the color and alpha (transparency) of the debris effect. """, "scale": """the size of the chunks. """, "count": """the number of chunks to create. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddDebris', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddFootSplash', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a foot splash particle effect, normally created when walking into water.' , arguments={ "posX": """A float representing the x position of the splash """, "posY": """A float representing the y position of the splash """, "posZ": """A float representing the z position of the splash """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddFootSplash', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddGlass', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='colorR', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='255', ) ], [ FunctionArgument( name='colorG', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='colorB', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='0', ) ], [ FunctionArgument( name='colorA', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='255', ) ], [ FunctionArgument( name='scale', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='count', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a glass particle effect.' , arguments={ "posX": """A float representing the x position of the glass """, "posY": """A float representing the y position of the glass """, "posZ": """A float representing the z position of the glass """, "colorR, colorG, colorB, colorA": """the color and alpha (transparency) of the glass effect. """, "scale": """A float representing the size of the particle effect, where 1 is the standard size. """, "count": """The density of the particle effect. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddGlass', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddGunshot', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='includeSparks', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='true', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a gunshot particle effect.' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a direction vector indicating where the bullet is fired. """, "includeSparks": """A bool representing whether the particle effect will generate sparks. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddGunshot', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddPunchImpact', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a punch impact particle effect (a small dust cloud).' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a vector indicating the movement direction of the effect. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddPunchImpact', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddSparks', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='force', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='count', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ], [ FunctionArgument( name='acrossLineX', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0.0', ) ], [ FunctionArgument( name='acrossLineY', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0.0', ) ], [ FunctionArgument( name='acrossLineZ', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='0.0', ) ], [ FunctionArgument( name='blur', argument_type=FunctionType( names=['bool'], is_optional=True, ), default_value='false', ) ], [ FunctionArgument( name='spread', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ], [ FunctionArgument( name='life', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a number of sparks originating from a point or along a line.' , arguments={ "posX, posY, posZ": """the world coordinates where the sparks originate. """, "dirX, dirY, dirZ": """a direction vector indicating where the sparks fly to. The longer this vector is, the faster the sparks fly. """, "force": """speed factor: the higher this value, the faster and further the sparks fly. """, "count": """the number of effects to create. """, "acrossLineX, acrossLineY, acrossLineZ": """a vector starting at the pos coordinates. If specified, the sparks will be created along a line going from pos to pos - acrossLine. If not specified, all sparks originate from the point at pos. """, "blur": """if false, creates standard bullet impact-like sparks. If true, adds motion blur to the sparks. """, "spread": """determines how strongly the particles deviate from each other. With low values the particles will stay quite close together, high values will make them fly in all directions. Also affects their speed. """, "life": """the higher this value, the longer the sparks survive before they disappear. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddSparks', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddTankFire', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a tank firing particle effect.' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a direction vector indicating where the tank fire is directed to. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddTankFire', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddTyreBurst', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a tyre burst particle effect (a small white smoke puff).' , arguments={ "posX, posY, posZ": """the world coordinates where the puff originates. """, "dirX, dirY, dirZ": """a vector indicating the movement direction of the effect. """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddTyreBurst', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddWaterHydrant', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a water hydrant particle effect.' , arguments={ "posX": """A float representing the x position of the hydrant """, "posY": """A float representing the y position of the hydrant """, "posZ": """A float representing the z position of the hydrant """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddWaterHydrant', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddWaterSplash', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function creates a water splash particle effect.' , arguments={ "posX": """A float representing the x position of the splash """, "posY": """A float representing the y position of the splash """, "posZ": """A float representing the z position of the splash """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddWaterSplash', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='fxAddWood', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='posX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='posZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirX', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirY', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='dirZ', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='count', argument_type=FunctionType( names=['int'], is_optional=True, ), default_value='1', ) ], [ FunctionArgument( name='brightness', argument_type=FunctionType( names=['float'], is_optional=True, ), default_value='1.0', ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='Creates a wood splinter particle effect.' , arguments={ "posX, posY, posZ": """the world coordinates where the effect originates. """, "dirX, dirY, dirZ": """a direction vector indicating where the wood splinters fly to. """, "count": """the number of splinters to create. """, "brightness": """the brightness. Ranges from 0 (black) to 1 (normal color). """ }, result='returns a true if the operation was successful, false otherwise.' , ), url='fxAddWood', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='getEffectDensity', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['float'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='theEffect', argument_type=FunctionType( names=['effect'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function gets the density of certain effect.' , arguments={ "theEffect": """The effect to get density of. """ }, result='' , ), url='getEffectDensity', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='getEffectSpeed', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['float'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='theEffect', argument_type=FunctionType( names=['effect'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function gets the speed of a specified effect.' , arguments={ "theEffect": """The effect to get the speed of. """ }, result='returns float containing the effects speed, false if invalid arguments were specified.' , ), url='getEffectSpeed', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='setEffectDensity', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='theEffect', argument_type=FunctionType( names=['effect'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='density', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function sets the density of a specified effect.\nThe limit is 1 for Low, 1.5 for Medium, and 2 for High/Very high.|true}}' , arguments={ "theEffect": """The effect to change the speed of. """, "density": """The level of density (from 0 to 2). """ }, result='returns true if the density was succesfully changed, false otherwise.' , ), url='setEffectDensity', ) ], ), CompoundFunctionData( server=[ ], client=[ FunctionData( signature=FunctionSignature( name='setEffectSpeed', return_types=FunctionReturnTypes( return_types=[ FunctionType( names=['bool'], is_optional=False, ) ], variable_length=False, ), arguments=FunctionArgumentValues( arguments=[ [ FunctionArgument( name='theEffect', argument_type=FunctionType( names=['effect'], is_optional=False, ), default_value=None, ) ], [ FunctionArgument( name='speed', argument_type=FunctionType( names=['float'], is_optional=False, ), default_value=None, ) ] ], variable_length=False, ), generic_types=[ ], ), docs=FunctionDoc( description='This function sets the speed of a specified effect.' , arguments={ "theEffect": """The effect to change the speed of. """, "speed": """The speed to set. """ }, result='returns true if the effect speed was succesfuly changed, false otherwise.' , ), url='setEffectSpeed', ) ], ) ]
40.612729
262
0.291782
3,415
75,296
6.303368
0.083748
0.101087
0.121527
0.146846
0.852272
0.844096
0.833271
0.763356
0.756155
0.727167
0
0.002422
0.643593
75,296
1,853
263
40.634647
0.799709
0.000677
0
0.758411
1
0.003861
0.115187
0.00101
0
0
0
0
0
1
0
false
0
0.000552
0
0.000552
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
73665ba43d79b27b2fd7c80f62835366b92d0582
63,467
py
Python
tests/v3_api/test_gpu.py
TangStone/validation
6542f8248f0245ec7382952d7803d5d70fcfed3a
[ "Apache-2.0" ]
null
null
null
tests/v3_api/test_gpu.py
TangStone/validation
6542f8248f0245ec7382952d7803d5d70fcfed3a
[ "Apache-2.0" ]
null
null
null
tests/v3_api/test_gpu.py
TangStone/validation
6542f8248f0245ec7382952d7803d5d70fcfed3a
[ "Apache-2.0" ]
null
null
null
import pytest from .entfunc import * k8s_version = os.environ.get('RANCHER_K8S_VERSION', "v1.15.5-rancher1-1") RANCHER_CLEANUP_CLUSTER = os.environ.get('RANCHER_CLEANUP_CLUSTER', "True") NETWORK_PLUGIN = os.environ.get('NETWORK_PLUGIN', "canal") GPU_IMAGE = os.environ.get('RANCHER_GPU_IMAGE',"jianghang8421/gpu-ml-example:tf") MONITORING_TEMPLATE_ID = "cattle-global-data:system-library-rancher-monitoring" CLUSTER_MONITORING_APP = "cluster-monitoring" MONITORING_OPERATOR_APP = "monitoring-operator" GPU_MONITORING_APP = "cluster-gpu-monitoring" DEFAULT_GPU_IMEOUT = 60 GPU_MEM_NODE = "gpu-mem" GPU_COUNT_NODE = "gpu-count" GPUSHARE_PLUGIN = os.environ.get('RANCHER_GPUSHARE_PLUGIN',"gpushare-device-plugin") NVIDIA_GPU_PLUGIN = os.environ.get('RANCHER_NVIDIA_GPU_PLUGIN',"nvidia-gpu-device-plugin") rke_config = { "addonJobTimeout": 30, "ignoreDockerVersion": True, "sshAgentAuth": False, "type": "rancherKubernetesEngineConfig", "authentication": { "strategy": "x509", "type": "authnConfig" }, "ingress": { "provider": "nginx", "type": "ingressConfig" }, "monitoring": { "provider": "metrics-server", "type": "monitoringConfig" }, "services": { "type": "rkeConfigServices", "kubeApi": { "alwaysPullImages": False, "podSecurityPolicy": False, "serviceNodePortRange": "30000-32767", "type": "kubeAPIService" }, "etcd": { "creation": "12h", "extraArgs": { "heartbeat-interval": 500, "election-timeout": 5000 }, "retention": "72h", "snapshot": False, "type": "etcdService", "backupConfig": { "enabled": True, "intervalHours": 12, "retention": 6, "type": "backupConfig" } }, "scheduler": { "extraArgs": { "policy-config-file": "/etc/gpushare/scheduler-policy-config.json" }, "extraBinds": [ "/etc/gpushare/scheduler-policy-config.json:/etc/gpushare/scheduler-policy-config.json" ] } } } docker_config = { "default-runtime": "nvidia", "runtimes": { "nvidia": { "path": "/usr/bin/nvidia-container-runtime", "runtimeArgs": [] } } } share_resource_quota = {"limit": {"requestsGpuMemory": "4"}} share_namespace_resource_quota = {"limit":{"requestsGpuMemory":"2"}} default_resource_quota = {"limit":{"requestsGpuCount":"4"}} default_namespace_resource_quota = {"limit":{"requestsGpuCount":"2"}} C_MONITORING_ANSWERS = { "operator-init.enabled": "true", "exporter-node.enabled": "true", "exporter-gpu-node.enabled": "true", "exporter-node.ports.metrics.port": "9796", "exporter-kubelets.https": "true", "exporter-node.resources.limits.cpu": "200m", "exporter-node.resources.limits.memory": "200Mi", "operator.resources.limits.memory": "500Mi", "prometheus.retention": "12h", "grafana.persistence.enabled": "false", "prometheus.persistence.enabled": "false", "prometheus.persistence.storageClass": "default", "grafana.persistence.storageClass": "default", "grafana.persistence.size": "10Gi", "prometheus.persistence.size": "50Gi", "prometheus.resources.core.requests.cpu": "750m", "prometheus.resources.core.limits.cpu": "1000m", "prometheus.resources.core.requests.memory": "750Mi", "prometheus.resources.core.limits.memory": "1000Mi", "prometheus.persistent.useReleaseName": "true" } @pytest.mark.skip def test_cluster_enable_gpu(): cluster = validate_gpu_cluster(k8s_version, plugin="canal", nodeport="32666", node_count=1, node_roles=[["etcd", "worker", "controlplane"]]) validate_cluster_support_gpu(cluster, ADMIN_TOKEN) def test_add_share_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type':'share'} result, node = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label, "gpu.cattle.io/type") assert result def test_delete_share_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} nodes = client.list_node(name=GPU_MEM_NODE).data assert len(nodes) > 0 node = nodes[0] node_labels = node.labels.__dict__ if "gpu.cattle.io/type" not in node_labels or node_labels['gpu.cattle.io/type'] != 'share': result, node = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label, "gpu.cattle.io/type") assert result check_delete_gpu_label(client, node, GPUSHARE_PLUGIN, "gpu.cattle.io/type") def test_modify_share_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} add_result, node = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert add_result modify_result = check_modify_gpu_label(client, node, GPUSHARE_PLUGIN, NVIDIA_GPU_PLUGIN, "gpu.cattle.io/type", "default") assert modify_result def test_add_default_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label, "gpu.cattle.io/type") assert result def test_delete_default_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} nodes = client.list_node(name=GPU_COUNT_NODE).data assert len(nodes) > 0 node = nodes[0] node_labels = node.labels.__dict__ if "gpu.cattle.io/type" not in node_labels or node_labels['gpu.cattle.io/type'] != 'default': result, node = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result check_delete_gpu_label(client, node, NVIDIA_GPU_PLUGIN, "gpu.cattle.io/type") def test_modify_default_gpu_label(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} add_result, node = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert add_result modify_result = check_modify_gpu_label(client, node, NVIDIA_GPU_PLUGIN, GPUSHARE_PLUGIN, "gpu.cattle.io/type", "share") assert modify_result def test_gpu_mem_unused(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "1"}, "limits": {"rancher.io/gpu-mem": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] def test_gpu_mem_used2(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "3"}, "limits": {"rancher.io/gpu-mem": "3"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] def test_gpu_mem_overrun(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "10"}, "limits": {"rancher.io/gpu-mem": "10"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] start = time.time() workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] while wl.state != "active": if time.time() - start > DEFAULT_GPU_IMEOUT: pods = p_client.list_pod(workloadId=workload.id).data assert len(pods) == 1 pod = pods[0] assert pod.transitioning == "error" assert "Insufficient rancher.io/gpu-mem" in pod.transitioningMessage break time.sleep(.5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] projects = client.list_project(clusterId=cluster.id).data assert len(projects) >= 1 for project in projects: if "p_gpu" in project.name: client.delete(project) def test_gpu_mem_count(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, node = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "1"}, "limits": {"nvidia.com/gpu": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] start = time.time() workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] while wl.state != "active": if time.time() - start > DEFAULT_GPU_IMEOUT: pods = p_client.list_pod(workloadId=workload.id).data assert len(pods) == 1 pod = pods[0] assert pod.transitioning == "error" assert "Insufficient nvidia.com/gpu" in pod.transitioningMessage break time.sleep(.5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) check_delete_gpu_label(client, node, GPUSHARE_PLUGIN, "gpu.cattle.io/type") def test_gpu_count_unused(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "2"}, "limits": {"nvidia.com/gpu": "2"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] def test_gpu_count_used2(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "1"}, "limits": {"nvidia.com/gpu": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] def test_gpu_count_overrun(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "6"}, "limits": {"nvidia.com/gpu": "6"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] start = time.time() workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] while wl.state != "active": if time.time() - start > DEFAULT_GPU_IMEOUT: pods = p_client.list_pod(workloadId=workload.id).data assert len(pods) == 1 pod = pods[0] assert pod.transitioning == "error" assert "Insufficient nvidia.com/gpu" in pod.transitioningMessage break time.sleep(.5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] projects = client.list_project(clusterId=cluster.id).data assert len(projects) >= 1 for project in projects: if "p_gpu" in project.name: client.delete(project) def test_gpu_count_mem(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, node = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result project, namespace = create_project_and_ns(ADMIN_TOKEN, cluster, random_test_name("p_gpu"), random_test_name("gpu")) p_client = get_project_client_for_token(project,ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "2"}, "limits": {"rancher.io/gpu-mem": "2"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=namespace.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] start = time.time() workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] while wl.state != "active": if time.time() - start > DEFAULT_GPU_IMEOUT: pods = p_client.list_pod(workloadId=workload.id).data assert len(pods) == 1 pod = pods[0] assert pod.transitioning == "error" assert "Insufficient rancher.io/gpu-mem" in pod.transitioningMessage break time.sleep(.5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) check_delete_gpu_label(client, node, NVIDIA_GPU_PLUGIN, "gpu.cattle.io/type") def test_add_gpu_mem_quota_default_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == share_namespace_resource_quota["limit"]["requestsGpuMemory"] client.delete(project) def test_add_gpu_mem_quota_spec_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] quota = {"limit":{"requestsGpuMemory":"1"}} ns = c_client.create_namespace(name=random_test_name('gpu-mem'), projectId=project.id, resourceQuota=quota) ns = c_client.wait_success(ns) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == quota["limit"]["requestsGpuMemory"] client.delete(project) def test_edit_gpu_mem_quota_spec_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] quota = {"limit": {"requestsGpuMemory": "1"}} ns = c_client.create_namespace(name=random_test_name('gpu-mem'), projectId=project.id, resourceQuota=quota) ns = c_client.wait_success(ns) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == quota["limit"]["requestsGpuMemory"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) ns1 = p_client.update(ns, resourceQuota={"limit": {"requestsGpuMemory": "2"}}) assert ns1.resourceQuota.limit.requestsGpuMemory == "2" client.delete(project) def test_gpu_mem_with_quota(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == share_namespace_resource_quota["limit"]["requestsGpuMemory"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "2"}, "limits": {"rancher.io/gpu-mem": "2"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) def test_gpu_mem_with_quota_overrun(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == share_namespace_resource_quota["limit"]["requestsGpuMemory"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "4"}, "limits": {"rancher.io/gpu-mem": "4"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] time.sleep(5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] assert wl.transitioning == "error" assert "exceeded quota" in wl.transitioningMessage p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) def test_add_gpu_count_quota_default_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == default_namespace_resource_quota["limit"]["requestsGpuCount"] client.delete(project) def test_add_gpu_count_quota_spec_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] quota = {"limit": {"requestsGpuCount": "1"}} ns = c_client.create_namespace(name=random_test_name('gpu-mem'), projectId=project.id, resourceQuota=quota) ns = c_client.wait_success(ns) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == quota["limit"]["requestsGpuCount"] client.delete(project) def test_edit_gpu_count_quota_spec_ns(): client, cluster = get_admin_client_and_cluster() c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] quota = {"limit": {"requestsGpuCount": "1"}} ns = c_client.create_namespace(name=random_test_name('gpu-mem'), projectId=project.id, resourceQuota=quota) ns = c_client.wait_success(ns) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == quota["limit"]["requestsGpuCount"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) ns1 = p_client.update(ns, resourceQuota={"limit": {"requestsGpuCount": "2"}}) assert ns1.resourceQuota.limit.requestsGpuCount == "2" client.delete(project) def test_gpu_count_with_quota(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == default_namespace_resource_quota["limit"]["requestsGpuCount"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "1"}, "limits": {"nvidia.com/gpu": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) def test_gpu_count_with_quota_overrun(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == default_namespace_resource_quota["limit"]["requestsGpuCount"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "3"}, "limits": {"nvidia.com/gpu": "3"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] time.sleep(5) workloads = p_client.list_workload(uuid=workload.uuid).data assert len(workloads) == 1 wl = workloads[0] assert wl.transitioning == "error" assert "exceeded quota" in wl.transitioningMessage p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) def test_enable_gpu_monitor(): client, cluster = get_admin_client_and_cluster() monitoring_template = client.list_template( id=MONITORING_TEMPLATE_ID).data[0] MONITORING_VERSION = monitoring_template.defaultVersion if cluster["enableClusterMonitoring"] is False: client.action(cluster, "enableMonitoring", answers=C_MONITORING_ANSWERS, version=MONITORING_VERSION) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) wait_for_monitor_app_to_active(p_client, CLUSTER_MONITORING_APP) wait_for_monitor_app_to_active(p_client, MONITORING_OPERATOR_APP) wait_for_app_to_active(p_client, GPU_MONITORING_APP) def test_add_gpu_monitor_label(): client, cluster = get_admin_client_and_cluster() label = {'gpumonitoring.cattle.io': 'true'} result, node = check_add_gpu_label(client, GPU_MEM_NODE, "gpu-dcgm-exporter", label, "gpumonitoring.cattle.io") assert result def test_delete_gpu_monitor_label(): client, cluster = get_admin_client_and_cluster() label = {'gpumonitoring.cattle.io': 'true'} nodes = client.list_node(name=GPU_MEM_NODE).data assert len(nodes) > 0 node = nodes[0] node_labels = node.labels.__dict__ if "gpumonitoring.cattle.io" not in node_labels or node_labels['gpumonitoring.cattle.io'] != True: result, node = check_add_gpu_label(client, GPU_MEM_NODE, "gpu-dcgm-exporter", label, "gpumonitoring.cattle.io") assert result check_delete_gpu_label(client, node, "gpu-dcgm-exporter", "gpumonitoring.cattle.io") def test_modify_gpu_monitor_label(): client, cluster = get_admin_client_and_cluster() label = {'gpumonitoring.cattle.io': 'true'} result, node = check_add_gpu_label(client, GPU_MEM_NODE, "gpu-dcgm-exporter", label, "gpumonitoring.cattle.io") assert result node, node_labels = get_node_label(client, node) node_labels['gpumonitoring.cattle.io'] = "false" client.update(node, labels=node_labels) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) workloads = p_client.list_workload(name="gpu-dcgm-exporter").data assert len(workloads) == 1 workload = workloads[0] pods = wait_for_pod_delete(p_client, workload) assert len(pods) == 0 result_node, result_labels = get_node_label(client, node) assert result_labels["gpumonitoring.cattle.io"] == node_labels['gpumonitoring.cattle.io'] del result_labels['gpumonitoring.cattle.io'] client.update(result_node, labels=result_labels) def test_disable_monitor(): client, cluster = get_admin_client_and_cluster() monitoring_template = client.list_template( id=MONITORING_TEMPLATE_ID).data[0] MONITORING_VERSION = monitoring_template.defaultVersion if cluster["enableClusterMonitoring"] is False: client.action(cluster, "enableMonitoring", answers=C_MONITORING_ANSWERS, version=MONITORING_VERSION) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) wait_for_monitor_app_to_active(p_client, CLUSTER_MONITORING_APP) wait_for_monitor_app_to_active(p_client, MONITORING_OPERATOR_APP) wait_for_app_to_active(p_client, GPU_MONITORING_APP) cluster = client.reload(cluster) client.action(cluster, "disableMonitoring") start = time.time() while True: if time.time() - start > 30: raise AssertionError( "Timed out waiting for disabling project monitoring") app1 = p_client.list_app(name=CLUSTER_MONITORING_APP) app2 = p_client.list_app(name=MONITORING_OPERATOR_APP) app3 = p_client.list_app(name=GPU_MONITORING_APP) if len(app1.data) == 0 and len(app2.data) == 0 and len(app3.data) == 0: break def test_disable_gpu_monitor(): client, cluster = get_admin_client_and_cluster() monitoring_template = client.list_template( id=MONITORING_TEMPLATE_ID).data[0] MONITORING_VERSION = monitoring_template.defaultVersion if cluster["enableClusterMonitoring"] is False: client.action(cluster, "enableMonitoring", answers=C_MONITORING_ANSWERS, version=MONITORING_VERSION) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) wait_for_monitor_app_to_active(p_client, CLUSTER_MONITORING_APP) wait_for_monitor_app_to_active(p_client, MONITORING_OPERATOR_APP) wait_for_app_to_active(p_client, GPU_MONITORING_APP) answers = C_MONITORING_ANSWERS answers['exporter-gpu-node.enabled'] = 'false' cluster = client.reload(cluster) client.action(cluster, "editMonitoring", answers=answers) start = time.time() while True: if time.time() - start > 30: raise AssertionError( "Timed out waiting for disabling project monitoring") app3 = p_client.list_app(name=GPU_MONITORING_APP) if len(app3.data) == 0: break @pytest.mark.skip def test_cluster_disable_gpu(): client, cluster = get_admin_client_and_cluster() client.update(cluster, enableGPUManagement=False) project = cluster.list_project(name="System") p_client = get_project_client_for_token(project, ADMIN_TOKEN) wait_for_wl_delete(p_client, GPUSHARE_PLUGIN) wait_for_wl_delete(p_client, NVIDIA_GPU_PLUGIN) wait_for_wl_delete(p_client, "gpushare-schd-extender") apps = client.list_app(name="cluster-gpu-management").data start = time.time() while len(apps) != 0: if time.time() - start > DEFAULT_TIMEOUT: raise AssertionError( "Timed out waiting for state to get to active") time.sleep(.5) apps = client.list_app(name="cluster-gpu-management").data def test_gpu_mem_with_quota_part(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == share_namespace_resource_quota["limit"]["requestsGpuMemory"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "1"}, "limits": {"rancher.io/gpu-mem": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] wait_for_wl_to_active(p_client, workload) p = client.reload(project) ns1= c_client.reload(ns) p_annotations = p.annotations assert json.loads(p_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuMemory"] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] ns_annotations = ns1.annotations assert json.loads(ns_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuMemory"] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) wait_for_project_delete(client, cluster, project) def test_gpu_mem_with_quota_all(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'share'} result, _ = check_add_gpu_label(client, GPU_MEM_NODE, GPUSHARE_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name=random_test_name('gpu_quota'), clusterId=cluster.id, resourceQuota=share_resource_quota, namespaceDefaultResourceQuota=share_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuMemory == share_resource_quota["limit"]["requestsGpuMemory"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuMemory == \ share_namespace_resource_quota["limit"]["requestsGpuMemory"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuMemory == share_namespace_resource_quota["limit"]["requestsGpuMemory"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"rancher.io/gpu-mem": "2"}, "limits": {"rancher.io/gpu-mem": "2"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) workload = wait_for_wl_to_active(p_client, workload) assert workload.state == "active" wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['rancher.io/gpu-mem'] == con[0]["resources"]["requests"]["rancher.io/gpu-mem"] assert wl_con.resources.limits['rancher.io/gpu-mem'] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] wait_for_wl_to_active(p_client, workload) p = client.reload(project) ns1= c_client.reload(ns) p_annotations = p.annotations assert json.loads(p_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuMemory"] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] ns_annotations = ns1.annotations assert json.loads(ns_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuMemory"] == con[0]["resources"]["limits"]["rancher.io/gpu-mem"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) wait_for_project_delete(client, cluster, project) def test_gpu_count_with_quota_part(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == default_namespace_resource_quota["limit"]["requestsGpuCount"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "1"}, "limits": {"nvidia.com/gpu": "1"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] wait_for_wl_to_active(p_client, workload) p = client.reload(project) ns1 = c_client.reload(ns) p_annotations = p.annotations assert json.loads(p_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuCount"] == \ con[0]["resources"]["limits"]["nvidia.com/gpu"] ns_annotations = ns1.annotations assert json.loads(ns_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuCount"] == \ con[0]["resources"]["limits"]["nvidia.com/gpu"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) wait_for_project_delete(client, cluster, project) def test_gpu_count_with_quota_all(): client, cluster = get_admin_client_and_cluster() label = {'gpu.cattle.io/type': 'default'} result, _ = check_add_gpu_label(client, GPU_COUNT_NODE, NVIDIA_GPU_PLUGIN, label) assert result c_client = get_cluster_client_for_token(cluster, ADMIN_TOKEN) project = client.create_project(name='test-' + random_str(), clusterId=cluster.id, resourceQuota=default_resource_quota, namespaceDefaultResourceQuota=default_namespace_resource_quota) project = client.wait_success(project) assert project.resourceQuota is not None assert project.resourceQuota.limit.requestsGpuCount == default_resource_quota["limit"]["requestsGpuCount"] assert project.namespaceDefaultResourceQuota is not None assert project.namespaceDefaultResourceQuota.limit.requestsGpuCount == \ default_namespace_resource_quota["limit"]["requestsGpuCount"] ns = create_ns(c_client, cluster, project) assert ns is not None assert ns.resourceQuota is not None assert ns.resourceQuota.limit.requestsGpuCount == default_namespace_resource_quota["limit"]["requestsGpuCount"] p_client = get_project_client_for_token(project, ADMIN_TOKEN) name = random_test_name("gpu") con = [{"name": "test1", "image": GPU_IMAGE, "resources": {"requests": {"nvidia.com/gpu": "2"}, "limits": {"nvidia.com/gpu": "2"}}}] workload = p_client.create_workload(name=name, containers=con, namespaceId=ns.id, deploymentConfig={}) wl_cons = workload.containers assert len(wl_cons) == 1 wl_con = wl_cons[0] assert wl_con.resources.requests['nvidia.com/gpu'] == con[0]["resources"]["requests"]["nvidia.com/gpu"] assert wl_con.resources.limits['nvidia.com/gpu'] == con[0]["resources"]["limits"]["nvidia.com/gpu"] wait_for_wl_to_active(p_client, workload) p = client.reload(project) ns1 = c_client.reload(ns) p_annotations = p.annotations assert json.loads(p_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuCount"] == \ con[0]["resources"]["limits"]["nvidia.com/gpu"] ns_annotations = ns1.annotations assert json.loads(ns_annotations["field.cattle.io/resourceQuotaUsage"])["requestsGpuCount"] == \ con[0]["resources"]["limits"]["nvidia.com/gpu"] p_client.delete(workload) wait_for_wl_delete(p_client, workload) client.delete(project) wait_for_project_delete(client, cluster, project) def validate_gpu_cluster(k8s_version, plugin="canal", nodeport="32666", node_count=1, node_roles=[["etcd", "worker", "controlplane"]]): rke_config["kubernetesVersion"] = k8s_version rke_config["network"] = {"type": "networkConfig", "plugin": plugin} aws_nodes = \ AmazonWebServices().create_multiple_nodes( node_count, random_test_name("testcustom")) client = get_admin_client() cluster = client.create_cluster(name=random_name(), driver="rancherKubernetesEngine", enableGPUManagement=True, gpuSchedulerNodePort=nodeport, rancherKubernetesEngineConfig=rke_config) assert cluster.state == "active" i = 0 urlPrefix = "http://127.0.0.1:" + nodeport + "/gpushare-scheduler" gpushare_config = { "kind": "Policy", "apiVersion": "v1", "extenders": [ { "urlPrefix": urlPrefix, "filterVerb": "filter", "bindVerb": "bind", "enableHttps": False, "nodeCacheCapable": True, "managedResources": [ { "name": "rancher.io/gpu-mem", "ignoredByScheduler": False } ], "ignorable": False } ] } for aws_node in aws_nodes: docker_run_cmd = get_custom_host_registration_cmd(client, cluster, node_roles[i], aws_node) dir_gpu_cmd = "sudo mkdir -p /etc/gpushare/" gpudir_run_cmd = "ssh -o StrictHostKeyChecking=no -i /src/rancher-validation/.ssh/jenkins.pem -l ubuntu " \ + aws_node.public_ip_address + " \' " + dir_gpu_cmd + " \'" aws_node.execute_command(gpudir_run_cmd) config_gpu_cmd = "sudo echo " + gpushare_config + " > /etc/gpushare/scheduler-policy-config.json" gpuconfig_run_cmd = "ssh -o StrictHostKeyChecking=no -i /src/rancher-validation/.ssh/jenkins.pem -l ubuntu " \ + aws_node.public_ip_address + " \' " + config_gpu_cmd + " \'" aws_node.execute_command(gpuconfig_run_cmd) config_docker_cmd = "sudo echo " + docker_config + " > /etc/docker/daemon.json" dockerconfig_run_cmd = "ssh -o StrictHostKeyChecking=no -i /src/rancher-validation/.ssh/jenkins.pem -l ubuntu " \ + aws_node.public_ip_address + " \' " + config_docker_cmd + " \'" aws_node.execute_command(dockerconfig_run_cmd) restart_docker_cmd = "ssh -o StrictHostKeyChecking=no -i /src/rancher-validation/.ssh/jenkins.pem -l ubuntu " \ + aws_node.public_ip_address + " \' sudo service docker restart \'" aws_node.execute_command(restart_docker_cmd) cluster_run_cmd = "ssh -o StrictHostKeyChecking=no -i /src/rancher-validation/.ssh/jenkins.pem -l ubuntu " \ + aws_node.public_ip_address + " \' " + docker_run_cmd + " \'" aws_node.execute_command(cluster_run_cmd) i += 1 cluster = validate_cluster(client, cluster) return cluster def validate_cluster_support_gpu(cluster,token): project = cluster.list_project(name="System") p_client = get_project_client_for_token(project, token) validate_wl_byName(p_client, GPUSHARE_PLUGIN,"cattle-gpumanagement","DaemonSet") validate_wl_byName(p_client, NVIDIA_GPU_PLUGIN,"cattle-gpumanagement","DaemonSet") validate_wl_byName(p_client,"gpushare-schd-extender","cattle-gpumanagement","Deployment") #execute_kubectl_cmd() apps = p_client.list_app(name="cluster-gpu-management") assert len(apps) == 1 app = wait_for_app_to_active(p_client, apps[0]) assert app.state == "active" def wait_for_app_to_active(client, app, timeout=DEFAULT_TIMEOUT): apps = client.list_app(name=app).data assert len(apps) >= 1 application = apps[0] start = time.time() apps = client.list_app(uuid=application.uuid).data assert len(apps) == 1 app1 = apps[0] while app1.state != "active": if time.time() - start > timeout: raise AssertionError( "Timed out waiting for state to get to active") time.sleep(.5) apps = client.list_app(uuid=application.uuid).data assert len(apps) == 1 app1 = apps[0] return app1 def check_add_gpu_label(client, node_name, wl, label, key="gpu.cattle.io/type", deleteFlag=False): ''' :param client: :param cluster: :param wl: gpushare-device-plugin / nvidia-gpu-device-plugin :param label :return: ''' nodes = client.list_node(name=node_name).data assert len(nodes) > 0 node = nodes[0] node_labels = node.labels.__dict__ labels = dict(node_labels, **label) client.update(node,labels = labels) projects = client.list_project(name="System").data assert len(projects) == 1 project=projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) workloads = p_client.list_workload(name=wl).data assert len(workloads) == 1 workload = workloads[0] pods = p_client.list_pod(workloadId=workload.id).data assert len(pods) == 1 pod = pods[0] pod = wait_for_pod_to_running(p_client,pod) assert pod.state == "running" result = False if pod.nodeId == node.id: result = True node, node_labels = get_node_label(client, node) assert node_labels[key] == label[key] if deleteFlag: del node_labels[key] client.update(node, labels=node_labels) return result, node def check_delete_gpu_label(client, node, wl, key): node, node_labels = get_node_label(client, node) del node_labels[key] client.update(node,labels=node_labels) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) workloads = p_client.list_workload(name=wl).data assert len(workloads) == 1 workload = workloads[0] pods = wait_for_pod_delete(p_client,workload) assert len(pods) == 0 _, node_labels = get_node_label(client, node) assert key not in node_labels.keys() def check_modify_gpu_label(client, node, old_wl, new_wl, key, value): node, node_labels = get_node_label(client, node) node_labels[key] = value client.update(node, labels = node_labels) projects = client.list_project(name="System").data assert len(projects) == 1 project = projects[0] p_client = get_project_client_for_token(project, ADMIN_TOKEN) old_workloads = p_client.list_workload(name=old_wl).data assert len(old_workloads) == 1 old_workload = old_workloads[0] old_pods = wait_for_pod_delete(p_client, old_workload) assert len(old_pods) == 0 new_workloads = p_client.list_workload(name=new_wl).data assert len(new_workloads) == 1 new_workload = new_workloads[0] new_pods = p_client.list_pod(workloadId=new_workload.id).data assert len(new_pods) == 1 new_pod = new_pods[0] wait_for_pod_to_running(p_client,new_pod) result = False if new_pod.nodeId == node.id: result = True node, node_labels = get_node_label(client, node) assert node_labels['gpu.cattle.io/type'] == value check_delete_gpu_label(client, node, new_wl, key) return result def get_node_label(client, node): nodes = client.list_node(id=node.id).data assert len(nodes) == 1 node = nodes[0] labels = node.labels.__dict__ return node, labels def validate_gpu_resoucequota_kubectl(namespace, quota_type): ''' :param namespace: :param quota_type: requestsGpuMemory / requestsGpuCount :return: ''' command = "get quota --namespace " + namespace['id'] result = execute_kubectl_cmd(command, json_out=True) testdict = namespace['resourceQuota'] response = result["items"] assert "spec" in response[0] quotadict = (response[0]["spec"]) assert quotadict['hard'][quota_type] == testdict['limit'][quota_type] def wait_for_monitor_app_to_active(client, app, timeout=DEFAULT_MULTI_CLUSTER_APP_TIMEOUT): """ First wait for app to come in deployment state, then wait for it get in active state. This is to avoid wrongly conclude that app is active as app goes to state installing > active > deploying > active @param client: Project client @param app_id: App id of deployed app. @param timeout: Max time allowed to wait for app to become active. @return: app object """ apps = client.list_app(name=app).data assert len(apps) >= 1 application = apps[0] app_id = application.id start = time.time() app_data = client.list_app(id=app_id).data while len(app_data) == 0: if time.time() - start > timeout / 10: raise AssertionError( "Timed out waiting for listing the app from API") time.sleep(.2) app_data = client.list_app(id=app_id).data application = app_data[0] while application.state != "deploying": if time.time() - start > timeout / 3: break time.sleep(.2) app_data = client.list_app(id=app_id).data application = app_data[0] while application.state != "active": if time.time() - start > timeout: raise AssertionError( "Timed out waiting for state to get to active") time.sleep(.5) app = client.list_app(id=app_id).data assert len(app) >= 1 application = app[0] return application
41.699737
151
0.660327
7,446
63,467
5.365565
0.049423
0.022252
0.012615
0.021025
0.878279
0.851597
0.832724
0.818908
0.813376
0.804916
0
0.007592
0.223801
63,467
1,521
152
41.727153
0.803402
0.00906
0
0.747107
0
0.004959
0.154607
0.034778
0
0
0
0
0.215702
1
0.03719
false
0
0.001653
0
0.043802
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
739bf94233d860a17772c67610776f864d2ad92e
34,443
py
Python
code/python/IRNCustomSymbols/v1/fds/sdk/IRNCustomSymbols/api/hybrid_symbols_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
6
2022-02-07T16:34:18.000Z
2022-03-30T08:04:57.000Z
code/python/IRNCustomSymbols/v1/fds/sdk/IRNCustomSymbols/api/hybrid_symbols_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
2
2022-02-07T05:25:57.000Z
2022-03-07T14:18:04.000Z
code/python/IRNCustomSymbols/v1/fds/sdk/IRNCustomSymbols/api/hybrid_symbols_api.py
factset/enterprise-sdk
3fd4d1360756c515c9737a0c9a992c7451d7de7e
[ "Apache-2.0" ]
null
null
null
""" IRN API v1 Allows users to extract, create, update and configure IRN data. # noqa: E501 The version of the OpenAPI document: 1 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from multiprocessing.pool import ApplyResult import typing from fds.sdk.IRNCustomSymbols.api_client import ApiClient, Endpoint as _Endpoint from fds.sdk.IRNCustomSymbols.model_utils import ( # noqa: F401 check_allowed_values, check_validations, date, datetime, file_type, none_type, validate_and_convert_types ) from fds.sdk.IRNCustomSymbols.exceptions import ApiException from fds.sdk.IRNCustomSymbols.model.create_standard_symbol_metadata_dto import CreateStandardSymbolMetadataDto from fds.sdk.IRNCustomSymbols.model.new_item_dto import NewItemDto from fds.sdk.IRNCustomSymbols.model.operation import Operation from fds.sdk.IRNCustomSymbols.model.problem_details import ProblemDetails class HybridSymbolsApi(object): """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client self.create_standard_symbol_metadata_endpoint = _Endpoint( settings={ 'response_type': ( { 201: (NewItemDto,), 400: (ProblemDetails,), 0: (ProblemDetails,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/v1/custom-symbols/standard-symbol-metadata', 'operation_id': 'create_standard_symbol_metadata', 'http_method': 'POST', 'servers': None, }, params_map={ 'all': [ 'create_standard_symbol_metadata_dto', ], 'required': [], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'create_standard_symbol_metadata_dto': (CreateStandardSymbolMetadataDto,), }, 'attribute_map': { }, 'location_map': { 'create_standard_symbol_metadata_dto': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json-patch+json', 'application/json', 'text/json', 'application/*+json' ] }, api_client=api_client ) self.get_standard_symbol_metadata_guid_endpoint = _Endpoint( settings={ 'response_type': ( { 200: (str,), 404: (str,), 0: (ProblemDetails,), }, None ), 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/v1/custom-symbols/standard-symbol-metadata/{standardSymbol}', 'operation_id': 'get_standard_symbol_metadata_guid', 'http_method': 'GET', 'servers': None, }, params_map={ 'all': [ 'standard_symbol', ], 'required': [ 'standard_symbol', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'standard_symbol': (str,), }, 'attribute_map': { 'standard_symbol': 'standardSymbol', }, 'location_map': { 'standard_symbol': 'path', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client ) self.patch_standard_symbol_endpoint = _Endpoint( settings={ 'response_type': None, 'auth': [ 'FactSetApiKey', 'FactSetOAuth2' ], 'endpoint_path': '/v1/custom-symbols/standard-symbol-metadata/{standardSymbolId}', 'operation_id': 'patch_standard_symbol', 'http_method': 'PATCH', 'servers': None, }, params_map={ 'all': [ 'standard_symbol_id', 'operation', ], 'required': [ 'standard_symbol_id', ], 'nullable': [ ], 'enum': [ ], 'validation': [ ] }, root_map={ 'validations': { }, 'allowed_values': { }, 'openapi_types': { 'standard_symbol_id': (str,), 'operation': ([Operation],), }, 'attribute_map': { 'standard_symbol_id': 'standardSymbolId', }, 'location_map': { 'standard_symbol_id': 'path', 'operation': 'body', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [ 'application/json-patch+json', 'application/json', 'text/json', 'application/*+json' ] }, api_client=api_client ) @staticmethod def apply_kwargs_defaults(kwargs, return_http_data_only, async_req): kwargs["async_req"] = async_req kwargs["_return_http_data_only"] = return_http_data_only kwargs["_preload_content"] = kwargs.get("_preload_content", True) kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) kwargs["_content_type"] = kwargs.get("_content_type") kwargs["_host_index"] = kwargs.get("_host_index") def create_standard_symbol_metadata( self, **kwargs ) -> NewItemDto: """Create standard symbol metadata # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Keyword Args: create_standard_symbol_metadata_dto (CreateStandardSymbolMetadataDto): createStandardSymbolMetadataDto object to save. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: NewItemDto Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) return self.create_standard_symbol_metadata_endpoint.call_with_http_info(**kwargs) def create_standard_symbol_metadata_with_http_info( self, **kwargs ) -> typing.Tuple[NewItemDto, int, typing.MutableMapping]: """Create standard symbol metadata # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Keyword Args: create_standard_symbol_metadata_dto (CreateStandardSymbolMetadataDto): createStandardSymbolMetadataDto object to save. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: NewItemDto Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) return self.create_standard_symbol_metadata_endpoint.call_with_http_info(**kwargs) def create_standard_symbol_metadata_async( self, **kwargs ) -> "ApplyResult[NewItemDto]": """Create standard symbol metadata # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Keyword Args: create_standard_symbol_metadata_dto (CreateStandardSymbolMetadataDto): createStandardSymbolMetadataDto object to save. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[NewItemDto] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) return self.create_standard_symbol_metadata_endpoint.call_with_http_info(**kwargs) def create_standard_symbol_metadata_with_http_info_async( self, **kwargs ) -> "ApplyResult[typing.Tuple[NewItemDto, int, typing.MutableMapping]]": """Create standard symbol metadata # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Keyword Args: create_standard_symbol_metadata_dto (CreateStandardSymbolMetadataDto): createStandardSymbolMetadataDto object to save. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(NewItemDto, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) return self.create_standard_symbol_metadata_endpoint.call_with_http_info(**kwargs) def get_standard_symbol_metadata_guid( self, standard_symbol, **kwargs ) -> str: """Get all custom field and standard field details on a specific standard symbol # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: standard_symbol (str): Standard symbol to get associated customSymbolId Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: str Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['standard_symbol'] = \ standard_symbol return self.get_standard_symbol_metadata_guid_endpoint.call_with_http_info(**kwargs) def get_standard_symbol_metadata_guid_with_http_info( self, standard_symbol, **kwargs ) -> typing.Tuple[str, int, typing.MutableMapping]: """Get all custom field and standard field details on a specific standard symbol # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: standard_symbol (str): Standard symbol to get associated customSymbolId Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: str Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['standard_symbol'] = \ standard_symbol return self.get_standard_symbol_metadata_guid_endpoint.call_with_http_info(**kwargs) def get_standard_symbol_metadata_guid_async( self, standard_symbol, **kwargs ) -> "ApplyResult[str]": """Get all custom field and standard field details on a specific standard symbol # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: standard_symbol (str): Standard symbol to get associated customSymbolId Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[str] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['standard_symbol'] = \ standard_symbol return self.get_standard_symbol_metadata_guid_endpoint.call_with_http_info(**kwargs) def get_standard_symbol_metadata_guid_with_http_info_async( self, standard_symbol, **kwargs ) -> "ApplyResult[typing.Tuple[str, int, typing.MutableMapping]]": """Get all custom field and standard field details on a specific standard symbol # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: standard_symbol (str): Standard symbol to get associated customSymbolId Keyword Args: _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(str, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['standard_symbol'] = \ standard_symbol return self.get_standard_symbol_metadata_guid_endpoint.call_with_http_info(**kwargs) def patch_standard_symbol( self, standard_symbol_id, **kwargs ) -> None: """Edit a standard symbol’s standard field and custom field data # noqa: E501 This method makes a synchronous HTTP request. Returns the http data only Args: standard_symbol_id (str): standardSymbolId to update associated standard symbol Keyword Args: operation ([Operation]): updateCustomSymbolDto object to update. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: None Response Object """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False) kwargs['standard_symbol_id'] = \ standard_symbol_id return self.patch_standard_symbol_endpoint.call_with_http_info(**kwargs) def patch_standard_symbol_with_http_info( self, standard_symbol_id, **kwargs ) -> typing.Tuple[None, int, typing.MutableMapping]: """Edit a standard symbol’s standard field and custom field data # noqa: E501 This method makes a synchronous HTTP request. Returns http data, http status and headers Args: standard_symbol_id (str): standardSymbolId to update associated standard symbol Keyword Args: operation ([Operation]): updateCustomSymbolDto object to update. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: None Response Object int Http Status Code dict Dictionary of the response headers """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False) kwargs['standard_symbol_id'] = \ standard_symbol_id return self.patch_standard_symbol_endpoint.call_with_http_info(**kwargs) def patch_standard_symbol_async( self, standard_symbol_id, **kwargs ) -> "ApplyResult[None]": """Edit a standard symbol’s standard field and custom field data # noqa: E501 This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult Args: standard_symbol_id (str): standardSymbolId to update associated standard symbol Keyword Args: operation ([Operation]): updateCustomSymbolDto object to update. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[None] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True) kwargs['standard_symbol_id'] = \ standard_symbol_id return self.patch_standard_symbol_endpoint.call_with_http_info(**kwargs) def patch_standard_symbol_with_http_info_async( self, standard_symbol_id, **kwargs ) -> "ApplyResult[typing.Tuple[None, int, typing.MutableMapping]]": """Edit a standard symbol’s standard field and custom field data # noqa: E501 This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult Args: standard_symbol_id (str): standardSymbolId to update associated standard symbol Keyword Args: operation ([Operation]): updateCustomSymbolDto object to update. [optional] _preload_content (bool): if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. _request_timeout (int/float/tuple): timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. Default is None. _check_input_type (bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _spec_property_naming (bool): True if the variable names in the input data are serialized names, as specified in the OpenAPI document. False if the variable names in the input data are pythonic names, e.g. snake case (default) _content_type (str/None): force body content-type. Default is None and content-type will be predicted by allowed content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. Returns: ApplyResult[(None, int, typing.Dict)] """ self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True) kwargs['standard_symbol_id'] = \ standard_symbol_id return self.patch_standard_symbol_endpoint.call_with_http_info(**kwargs)
44.906128
141
0.58938
3,786
34,443
5.187797
0.058901
0.073418
0.023828
0.023217
0.91309
0.883916
0.873988
0.862685
0.862685
0.862685
0
0.003659
0.349302
34,443
766
142
44.964752
0.872702
0.568388
0
0.578947
1
0
0.177484
0.061663
0
0
0
0
0
1
0.046053
false
0
0.036184
0
0.125
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
fb4cc7a30f29c44bf0346c9816c056749f3622bd
18,620
py
Python
experiments.py
Diallo/Thesis-Generator
81a76b90ed1600579f0d7585c4df8e0d77aeed07
[ "MIT" ]
null
null
null
experiments.py
Diallo/Thesis-Generator
81a76b90ed1600579f0d7585c4df8e0d77aeed07
[ "MIT" ]
1
2021-03-21T03:35:40.000Z
2021-03-21T03:35:40.000Z
experiments.py
Diallo/Thesis-Generator
81a76b90ed1600579f0d7585c4df8e0d77aeed07
[ "MIT" ]
null
null
null
import modifications import generator import conversion import stateyasper import subprocess import time import random from subprocess import STDOUT, check_output from collections import defaultdict from jinja2 import Environment, FileSystemLoader LOCATION_COMMA = "/home/scripts/comma-cmd.jar" LOCATION_FIONA = "" # Can leave this blank just add to path def create_ar_file(): # For the generated modifications create the AR FILE # Globals set in modifications ar_file_input = modifications.ar_file_input ar_file_output = modifications.ar_file_output env = Environment(loader=FileSystemLoader('templates')) file_ar = env.get_template('ar.jinja').render(**locals()) # Above code (Creates an AR File in directory /test hardcoded) with open('test/{}.ar'.format("ZARFILE"), 'w') as f: print(file_ar, file=f) # Now should be 2 directories with V1 and V2 subprocess.call(['java', '-jar', LOCATION_COMMA,"-l","test/v1/V1.prj"]) subprocess.call(['java', '-jar', LOCATION_COMMA,"-l","test/v2/V2.prj"]) def experiment_1(prevalence=0.2): """This runs experiment set 1 and writes it to the file "experiments1.csv" formatted as "Operation, Inputs, Outputs, Prevalence, Time in seconds" """ INPUT_RANGE = [10,30,50] # INPUT_RANGE = [50,80] DATAPOINT_SAMPLES = 5 AMOUNT_MODIFICATIONS = 1 TIMEOUT = 350 filename = "experiments1.csv" # possible_modifications = [modifications.delete,modifications.create,modifications.merge,modifications.split] possible_modifications = [modifications.merge] performed_modifications = [x.__name__ for x in possible_modifications] for modification in possible_modifications: for inout in INPUT_RANGE: x = 0 while x < DATAPOINT_SAMPLES: modifications.ar_file_input = defaultdict(list) modifications.ar_file_output = defaultdict(list) modifications.already_modified = [] try: # Generate a ruleset # Parameters (Inputs, OUtputs and prevalence) rules = generator.random_generator(inout,inout,prevalence) statemachine = generator.generate(rules) # Pass-through modifications.populate_ar_file(statemachine) # Attempt to perform modifications statemachine_modified = False while not statemachine_modified: # Performed modifications will be a list of operations [Delete,Create] statemachine_modified, performed_modifications = modifications.perform_modifications(statemachine,possible_modifications=[modification],amount=AMOUNT_MODIFICATIONS) # Genereates the COMMA files hardcoded directory # From here have a modified statemachine conversion.generate_conversion(statemachine,"V1","test/v1/") conversion.generate_conversion(statemachine_modified,"V2","test/v2/") # Create AR file and run CMD Comma and get .ownf files create_ar_file() # Should now have directories containing files # fiona -t adapter SERVER.owfn CLIENT.owfn -a ARFILE.ar with open(filename, 'a+') as f: time_start = time.time() outpu = subprocess.check_output(['fiona', "-p", "no-dot","-p" ,"no-png",'-t',"smalladapter", "test/v1/src-gen/DYNAMICS/openNetTask/V1__1_0__Server.owfn","test/v2/src-gen/DYNAMICS/openNetTask/V2__1_0__Client.owfn","-a","test/ZARFILE.ar"],timeout=TIMEOUT) elapsed_time = time.time() - time_start # CHeck if an adapter was created even outpu = outpu.decode("utf-8") print(outpu) if "Cannot synthesize a partner for a net" in outpu or "memory exhausted" in outpu: elapsed_time = -1 x -= 1 print("{},{},{},{},{},(good)".format(".".join(performed_modifications),inout,inout,prevalence,elapsed_time),file=f) # USED TO INDICATE A GOOD RESULT x += 1 except Exception as e: # How to end up here: # -- If it was timed out after subprocess call # -- Non zero exit status that is memory exhaustion if "timed out after" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(timed_out)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) elif "non-zero exit status 5" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(exhausted)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) # This was a memory exhaustion else: with open(filename, 'a+') as f: print("{},{},{},{},-1,(COULD NOT SYNTHESIZE)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) # This was a memory exhaustion def experiment_2(prevalence=0.2): """This runs experiment set 2 and writes it to the file "experiments2.csv" formatted as "Operation, Inputs, Outputs, Prevalence, Time in seconds" """ # INPUT_RANGE = [(10,30),(30,10),(10,50),(50,10),(30,50),(50,30)] INPUT_RANGE = [(30,50),(50,30)] DATAPOINT_SAMPLES = 7 AMOUNT_MODIFICATIONS = 1 TIMEOUT = 350 filename = "experiments2.csv" # possible_modifications = [modifications.delete,modifications.create,modifications.merge,modifications.split] possible_modifications = [modifications.merge] for modification in possible_modifications: for inout in INPUT_RANGE: inputs = inout[0] output = inout[1] x = 0 while x < DATAPOINT_SAMPLES: modifications.ar_file_input = defaultdict(list) modifications.ar_file_output = defaultdict(list) modifications.already_modified = [] try: rules = generator.random_generator(inputs,output,prevalence) statemachine = generator.generate(rules) modifications.populate_ar_file(statemachine) # Attempt to perform modifications statemachine_modified = False while not statemachine_modified: statemachine_modified, performed_modifications = modifications.perform_modifications(statemachine,possible_modifications=[modification],amount=AMOUNT_MODIFICATIONS) # Genereates the COMMA files hardcoded directory conversion.generate_conversion(statemachine,"V1","test/v1/") conversion.generate_conversion(statemachine_modified,"V2","test/v2/") # Create AR file and run CMD Comma create_ar_file() # Should now have directories containing files # TODO: Run FIONA here with TIME # fiona -t adapter SERVER.owfn CLIENT.owfn -a ARFILE.ar with open(filename, 'a+') as f: time_start = time.time() outpu = subprocess.check_output(['fiona', "-p", "no-dot","-p" ,"no-png",'-t',"smalladapter", "test/v1/src-gen/DYNAMICS/openNetTask/V1__1_0__Server.owfn","test/v2/src-gen/DYNAMICS/openNetTask/V2__1_0__Client.owfn","-a","test/ZARFILE.ar"],timeout=TIMEOUT) elapsed_time = time.time() - time_start # CHeck if an adapter was created even outpu = outpu.decode("utf-8") print(outpu) if "Cannot synthesize a partner for a net" in outpu or "memory exhausted" in outpu: elapsed_time = -1 print("{},{},{},{},{},(good)".format(".".join(performed_modifications),inputs,output,prevalence,elapsed_time),file=f) x += 1 except Exception as e: # How to end up here: # -- If it was timed out after subprocess call # -- Non zero exit status that is memory exhaustion if "timed out after" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(timed_out)".format(".".join(performed_modifications),inputs,output,prevalence),file=f) elif "non-zero exit status 5" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(exhausted)".format(".".join(performed_modifications),inputs,output,prevalence),file=f) # This was a memory exhaustion def experiment_3(prevalence=0.2): """This runs experiment set 1 and writes it to the file "experiments3.csv" formatted as "Operation, Inputs, Outputs, Prevalence, Time in seconds" """ INPUT_RANGE = [10,30,50,80] DATAPOINT_SAMPLES = 7 AMOUNT_MODIFICATIONS = 3 TIMEOUT = 350 filename = "experiments3.csv" TRIES = 10 # possible_modifications = [modifications.delete,modifications.create,modifications.merge,modifications.split] possible_modifications = [modifications.create,modifications.merge,modifications.split] for modification in possible_modifications: for inout in INPUT_RANGE: x = 0 n_try = TRIES while x < DATAPOINT_SAMPLES: x += 1 modifications.ar_file_input = defaultdict(list) modifications.ar_file_output = defaultdict(list) modifications.already_modified = [] elapsed_time = None try: rules = generator.random_generator(inout,inout,prevalence) statemachine = generator.generate(rules) modifications.populate_ar_file(statemachine) # Attempt to perform modifications statemachine_modified = False while not statemachine_modified: statemachine_modified, performed_modifications = modifications.perform_modifications(statemachine,possible_modifications=[modification],amount=AMOUNT_MODIFICATIONS) # Genereates the COMMA files hardcoded directory conversion.generate_conversion(statemachine,"V1","test/v1/") conversion.generate_conversion(statemachine_modified,"V2","test/v2/") # Create AR file and run CMD Comma create_ar_file() # Should now have directories containing files # TODO: Run FIONA here with TIME # fiona -t adapter SERVER.owfn CLIENT.owfn -a ARFILE.ar with open(filename, 'a+') as f: time_start = time.time() outpu = subprocess.check_output(['fiona', "-p", "no-dot","-p" ,"no-png",'-t',"smalladapter", "test/v1/src-gen/DYNAMICS/openNetTask/V1__1_0__Server.owfn","test/v2/src-gen/DYNAMICS/openNetTask/V2__1_0__Client.owfn","-a","test/ZARFILE.ar"],timeout=TIMEOUT) elapsed_time = time.time() - time_start # CHeck if an adapter was created even outpu = outpu.decode("utf-8") print(outpu) if "Cannot synthesize a partner for a net" in outpu or "memory exhausted" in outpu: elapsed_time = -1 if n_try > 0: x -= 1 n_try -= 1 print("{},{},{},{},{},(good)".format(".".join(performed_modifications),inout,inout,prevalence,elapsed_time),file=f) except Exception as e: # How to end up here: # -- If it was timed out after subprocess call # -- Non zero exit status that is memory exhaustion if "timed out after" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(timed_out)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) elif "non-zero exit status 5" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(exhausted)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) # This was a memory exhaustion elif n_try > 0: x -= 1 n_try -= 1 if elapsed_time != None: n_try = TRIES def experiment_4(prevalence=0.2): """This runs experiment set 1 and writes it to the file "experiments4.csv" formatted as "Operation, Inputs, Outputs, Prevalence, Time in seconds" """ INPUT_RANGE = [30,50,80] DATAPOINT_SAMPLES = 7 # TODO AMOUNT_MODIFICATIONS = 3 TIMEOUT = 350 filename = "experiments3.csv" TRIES = 10 possible_modifications = [modifications.delete,modifications.create,modifications.merge,modifications.split] possible_modifications = [modifications.merge,modifications.split] for modification in possible_modifications: for inout in INPUT_RANGE: x = 0 n_try = TRIES while x < DATAPOINT_SAMPLES: x += 1 modifications.ar_file_input = defaultdict(list) modifications.ar_file_output = defaultdict(list) modifications.already_modified = [] elapsed_time = None try: rules = generator.random_generator(inout,inout,prevalence) statemachine = generator.generate(rules) modifications.populate_ar_file(statemachine) # Attempt to perform modifications statemachine_modified = False while not statemachine_modified: statemachine_modified, performed_modifications = modifications.perform_modifications(statemachine,possible_modifications=[modification],amount=AMOUNT_MODIFICATIONS) # Genereates the COMMA files hardcoded directory conversion.generate_conversion(statemachine,"V1","test/v1/") conversion.generate_conversion(statemachine_modified,"V2","test/v2/") # Create AR file and run CMD Comma create_ar_file() # Should now have directories containing files # TODO: Run FIONA here with TIME # fiona -t adapter SERVER.owfn CLIENT.owfn -a ARFILE.ar with open(filename, 'a+') as f: time_start = time.time() outpu = subprocess.check_output(['fiona', "-p", "no-dot","-p" ,"no-png",'-t',"smalladapter", "test/v1/src-gen/DYNAMICS/openNetTask/V1__1_0__Server.owfn","test/v2/src-gen/DYNAMICS/openNetTask/V2__1_0__Client.owfn","-a","test/ZARFILE.ar"],timeout=TIMEOUT) elapsed_time = time.time() - time_start # CHeck if an adapter was created even outpu = outpu.decode("utf-8") print(outpu) if "Cannot synthesize a partner for a net" in outpu or "memory exhausted" in outpu: elapsed_time = -1 if n_try > 0: x -= 1 n_try -= 1 print("{},{},{},{},{},(good)".format(".".join(performed_modifications),inout,inout,prevalence,elapsed_time),file=f) except Exception as e: # How to end up here: # -- If it was timed out after subprocess call # -- Non zero exit status that is memory exhaustion if "timed out after" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(timed_out)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) elif "non-zero exit status 5" in str(e): with open(filename, 'a+') as f: print("{},{},{},{},-1,(exhausted)".format(".".join(performed_modifications),inout,inout,prevalence),file=f) # This was a memory exhaustion else: x -= 1 if elapsed_time != None: n_try = TRIES if __name__ == "__main__": # experiment_1() print("done1") # experiment_2() print("done2") # experiment_3() # modifications amount is 3 print("done3") # experiment_4() print("Done4")
47.139241
278
0.52594
1,812
18,620
5.267108
0.11755
0.017603
0.027242
0.023156
0.866303
0.859807
0.844719
0.834661
0.816953
0.809095
0
0.018284
0.380236
18,620
395
279
47.139241
0.808752
0.173899
0
0.776256
0
0
0.111118
0.052214
0
0
0
0.007595
0
1
0.022831
false
0
0.045662
0
0.068493
0.100457
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
fb82d20eeee00cc729dfb02603364e8993dc4701
297
py
Python
solmate/programs/system_program/__init__.py
nimily/solmate
acd12d6e79598ca53fcb94b0fc3c524cb6c50b7c
[ "MIT" ]
3
2022-03-11T19:06:15.000Z
2022-03-22T02:40:53.000Z
solmate/programs/system_program/__init__.py
nimily/solmate
acd12d6e79598ca53fcb94b0fc3c524cb6c50b7c
[ "MIT" ]
null
null
null
solmate/programs/system_program/__init__.py
nimily/solmate
acd12d6e79598ca53fcb94b0fc3c524cb6c50b7c
[ "MIT" ]
null
null
null
# LOCK-BEGIN[imports]: DON'T MODIFY import solmate.programs.system_program.constants as constants import solmate.programs.system_program.instructions as instructions from solmate.programs.system_program.addrs import PROGRAM_ID from solmate.programs.system_program.errors import Error # LOCK-END
33
67
0.851852
41
297
6.04878
0.487805
0.241935
0.33871
0.451613
0.532258
0
0
0
0
0
0
0
0.080808
297
8
68
37.125
0.908425
0.141414
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
fba601687eb0524b9417c671357049a17555e8ba
9,285
py
Python
Tools/pybench/Dict.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
1
2018-06-21T18:21:24.000Z
2018-06-21T18:21:24.000Z
Tools/pybench/Dict.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
Tools/pybench/Dict.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
z pybench zaimportuj Test klasa DictCreation(Test): version = 2.0 operations = 5*(5 + 5) rounds = 80000 def test(self): dla i w range(self.rounds): d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} d2 = {2:3,4:5,6:7} d3 = {3:4,5:6,7:8} d4 = {4:5,6:7,8:9} d5 = {6:7,8:9,10:11} d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} d2 = {2:3,4:5,6:7} d3 = {3:4,5:6,7:8} d4 = {4:5,6:7,8:9} d5 = {6:7,8:9,10:11} d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} d2 = {2:3,4:5,6:7} d3 = {3:4,5:6,7:8} d4 = {4:5,6:7,8:9} d5 = {6:7,8:9,10:11} d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} d2 = {2:3,4:5,6:7} d3 = {3:4,5:6,7:8} d4 = {4:5,6:7,8:9} d5 = {6:7,8:9,10:11} d1 = {} d2 = {} d3 = {} d4 = {} d5 = {} d1 = {1:2,3:4,5:6} d2 = {2:3,4:5,6:7} d3 = {3:4,5:6,7:8} d4 = {4:5,6:7,8:9} d5 = {6:7,8:9,10:11} def calibrate(self): dla i w range(self.rounds): dalej klasa DictWithStringKeys(Test): version = 2.0 operations = 5*(6 + 6) rounds = 200000 def test(self): d = {} dla i w range(self.rounds): d['abc'] = 1 d['def'] = 2 d['ghi'] = 3 d['jkl'] = 4 d['mno'] = 5 d['pqr'] = 6 d['abc'] d['def'] d['ghi'] d['jkl'] d['mno'] d['pqr'] d['abc'] = 1 d['def'] = 2 d['ghi'] = 3 d['jkl'] = 4 d['mno'] = 5 d['pqr'] = 6 d['abc'] d['def'] d['ghi'] d['jkl'] d['mno'] d['pqr'] d['abc'] = 1 d['def'] = 2 d['ghi'] = 3 d['jkl'] = 4 d['mno'] = 5 d['pqr'] = 6 d['abc'] d['def'] d['ghi'] d['jkl'] d['mno'] d['pqr'] d['abc'] = 1 d['def'] = 2 d['ghi'] = 3 d['jkl'] = 4 d['mno'] = 5 d['pqr'] = 6 d['abc'] d['def'] d['ghi'] d['jkl'] d['mno'] d['pqr'] d['abc'] = 1 d['def'] = 2 d['ghi'] = 3 d['jkl'] = 4 d['mno'] = 5 d['pqr'] = 6 d['abc'] d['def'] d['ghi'] d['jkl'] d['mno'] d['pqr'] def calibrate(self): d = {} dla i w range(self.rounds): dalej klasa DictWithFloatKeys(Test): version = 2.0 operations = 5*(6 + 6) rounds = 150000 def test(self): d = {} dla i w range(self.rounds): d[1.234] = 1 d[2.345] = 2 d[3.456] = 3 d[4.567] = 4 d[5.678] = 5 d[6.789] = 6 d[1.234] d[2.345] d[3.456] d[4.567] d[5.678] d[6.789] d[1.234] = 1 d[2.345] = 2 d[3.456] = 3 d[4.567] = 4 d[5.678] = 5 d[6.789] = 6 d[1.234] d[2.345] d[3.456] d[4.567] d[5.678] d[6.789] d[1.234] = 1 d[2.345] = 2 d[3.456] = 3 d[4.567] = 4 d[5.678] = 5 d[6.789] = 6 d[1.234] d[2.345] d[3.456] d[4.567] d[5.678] d[6.789] d[1.234] = 1 d[2.345] = 2 d[3.456] = 3 d[4.567] = 4 d[5.678] = 5 d[6.789] = 6 d[1.234] d[2.345] d[3.456] d[4.567] d[5.678] d[6.789] d[1.234] = 1 d[2.345] = 2 d[3.456] = 3 d[4.567] = 4 d[5.678] = 5 d[6.789] = 6 d[1.234] d[2.345] d[3.456] d[4.567] d[5.678] d[6.789] def calibrate(self): d = {} dla i w range(self.rounds): dalej klasa DictWithIntegerKeys(Test): version = 2.0 operations = 5*(6 + 6) rounds = 200000 def test(self): d = {} dla i w range(self.rounds): d[1] = 1 d[2] = 2 d[3] = 3 d[4] = 4 d[5] = 5 d[6] = 6 d[1] d[2] d[3] d[4] d[5] d[6] d[1] = 1 d[2] = 2 d[3] = 3 d[4] = 4 d[5] = 5 d[6] = 6 d[1] d[2] d[3] d[4] d[5] d[6] d[1] = 1 d[2] = 2 d[3] = 3 d[4] = 4 d[5] = 5 d[6] = 6 d[1] d[2] d[3] d[4] d[5] d[6] d[1] = 1 d[2] = 2 d[3] = 3 d[4] = 4 d[5] = 5 d[6] = 6 d[1] d[2] d[3] d[4] d[5] d[6] d[1] = 1 d[2] = 2 d[3] = 3 d[4] = 4 d[5] = 5 d[6] = 6 d[1] d[2] d[3] d[4] d[5] d[6] def calibrate(self): d = {} dla i w range(self.rounds): dalej klasa SimpleDictManipulation(Test): version = 2.0 operations = 5*(6 + 6 + 6 + 6) rounds = 100000 def test(self): d = {} has_key = lambda key: key w d dla i w range(self.rounds): d[0] = 3 d[1] = 4 d[2] = 5 d[3] = 3 d[4] = 4 d[5] = 5 x = d[0] x = d[1] x = d[2] x = d[3] x = d[4] x = d[5] has_key(0) has_key(2) has_key(4) has_key(6) has_key(8) has_key(10) usuń d[0] usuń d[1] usuń d[2] usuń d[3] usuń d[4] usuń d[5] d[0] = 3 d[1] = 4 d[2] = 5 d[3] = 3 d[4] = 4 d[5] = 5 x = d[0] x = d[1] x = d[2] x = d[3] x = d[4] x = d[5] has_key(0) has_key(2) has_key(4) has_key(6) has_key(8) has_key(10) usuń d[0] usuń d[1] usuń d[2] usuń d[3] usuń d[4] usuń d[5] d[0] = 3 d[1] = 4 d[2] = 5 d[3] = 3 d[4] = 4 d[5] = 5 x = d[0] x = d[1] x = d[2] x = d[3] x = d[4] x = d[5] has_key(0) has_key(2) has_key(4) has_key(6) has_key(8) has_key(10) usuń d[0] usuń d[1] usuń d[2] usuń d[3] usuń d[4] usuń d[5] d[0] = 3 d[1] = 4 d[2] = 5 d[3] = 3 d[4] = 4 d[5] = 5 x = d[0] x = d[1] x = d[2] x = d[3] x = d[4] x = d[5] has_key(0) has_key(2) has_key(4) has_key(6) has_key(8) has_key(10) usuń d[0] usuń d[1] usuń d[2] usuń d[3] usuń d[4] usuń d[5] d[0] = 3 d[1] = 4 d[2] = 5 d[3] = 3 d[4] = 4 d[5] = 5 x = d[0] x = d[1] x = d[2] x = d[3] x = d[4] x = d[5] has_key(0) has_key(2) has_key(4) has_key(6) has_key(8) has_key(10) usuń d[0] usuń d[1] usuń d[2] usuń d[3] usuń d[4] usuń d[5] def calibrate(self): d = {} has_key = lambda key: key w d dla i w range(self.rounds): dalej
18.386139
37
0.253204
1,253
9,285
1.850758
0.047087
0.030185
0.025873
0.025873
0.919793
0.919793
0.909444
0.89737
0.871065
0.857266
0
0.218539
0.600323
9,285
504
38
18.422619
0.406359
0
0
0.972906
0
0
0.019386
0
0
0
0
0
0
0
null
null
0
0.002463
null
null
0
0
0
1
null
0
0
0
1
1
1
1
1
1
0
1
1
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
12
fbca836e260eeadf3d545dc67d79b509b2e03be6
3,175
py
Python
prepare_data.py
helloeboy/CNN_Sentence_Classification
dff78427f43d549b6aef5e7e3105a2dc3697c306
[ "MIT" ]
null
null
null
prepare_data.py
helloeboy/CNN_Sentence_Classification
dff78427f43d549b6aef5e7e3105a2dc3697c306
[ "MIT" ]
null
null
null
prepare_data.py
helloeboy/CNN_Sentence_Classification
dff78427f43d549b6aef5e7e3105a2dc3697c306
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from torchtext import data, datasets import torchtext import torch def prepare_sst1(BATCH_SIZE, DEVICE, VECTORS): PAD_TOKEN='<pad>' TEXT = data.Field(batch_first=True, lower=True, pad_token=PAD_TOKEN) LABEL = data.Field(sequential=False, batch_first=True, unk_token=None) train_data = data.TabularDataset(path='./data/sst1/sst1_train.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) dev_data = data.TabularDataset(path='./data/sst1/sst1_dev.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) test_data = data.TabularDataset(path='./data/sst1/sst1_test.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) TEXT.build_vocab(train_data, vectors=VECTORS, unk_init= lambda x:torch.nn.init.uniform_(x, a=-0.25, b=0.25)) LABEL.build_vocab(train_data) train_iterator = data.BucketIterator(train_data, batch_size=BATCH_SIZE, train=True, shuffle=True,device=DEVICE) dev_iterator = data.Iterator(dev_data, batch_size=len(dev_data), train=False, sort=False, device=DEVICE) test_iterator = data.Iterator(test_data, batch_size=len(test_data), train=False, sort=False, device=DEVICE) PAD_INDEX = TEXT.vocab.stoi[PAD_TOKEN] TEXT.vocab.vectors[PAD_INDEX] = 0.0 pretrained_embeddings = TEXT.vocab.vectors return train_iterator, dev_iterator, test_iterator, pretrained_embeddings, len(TEXT.vocab), len(LABEL.vocab), PAD_INDEX def prepare_sst2(BATCH_SIZE, DEVICE, VECTORS): PAD_TOKEN='<pad>' TEXT = data.Field(batch_first=True, lower=True, pad_token=PAD_TOKEN) LABEL = data.Field(sequential=False, batch_first=True, unk_token=None) train_data = data.TabularDataset(path='./data/sst2/sst2_train.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) dev_data = data.TabularDataset(path='./data/sst2/sst2_dev.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) test_data = data.TabularDataset(path='./data/sst2/sst2_test.tsv', format='tsv', fields=[('text', TEXT), ('labels', LABEL)]) TEXT.build_vocab(train_data, vectors=VECTORS, unk_init= lambda x:torch.nn.init.uniform_(x, a=-0.25, b=0.25)) LABEL.build_vocab(train_data) train_iterator = data.BucketIterator(train_data, batch_size=BATCH_SIZE, train=True, shuffle=True,device=DEVICE) dev_iterator = data.Iterator(dev_data, batch_size=len(dev_data), train=False, sort=False, device=DEVICE) test_iterator = data.Iterator(test_data, batch_size=len(test_data), train=False, sort=False, device=DEVICE) PAD_INDEX = TEXT.vocab.stoi[PAD_TOKEN] TEXT.vocab.vectors[PAD_INDEX] = 0.0 pretrained_embeddings = TEXT.vocab.vectors return train_iterator, dev_iterator, test_iterator, pretrained_embeddings, len(TEXT.vocab), len(LABEL.vocab), PAD_INDEX
44.71831
123
0.641575
406
3,175
4.815271
0.14532
0.046036
0.067519
0.079795
0.951407
0.951407
0.951407
0.926854
0.926854
0.926854
0
0.012566
0.222992
3,175
70
124
45.357143
0.779895
0.006614
0
0.765957
0
0
0.075508
0.047589
0
0
0
0
0
1
0.042553
false
0
0.06383
0
0.148936
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
8395c88cdd82470a10473b2d3c083f2c20adbd7f
54,865
py
Python
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py
fhoering/autorest
b36c77ebb6a5c92aca72eea0894a683506af5817
[ "MIT" ]
null
null
null
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py
fhoering/autorest
b36c77ebb6a5c92aca72eea0894a683506af5817
[ "MIT" ]
null
null
null
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Header/autorestswaggerbatheaderservice/operations/header_operations.py
fhoering/autorest
b36c77ebb6a5c92aca72eea0894a683506af5817
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.pipeline import ClientRawResponse from .. import models class HeaderOperations(object): """HeaderOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self.config = config def param_existing_key( self, user_agent, custom_headers=None, raw=False, **operation_config): """Send a post request with header value "User-Agent": "overwrite". :param user_agent: Send a post request with header value "User-Agent": "overwrite" :type user_agent: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/existingkey' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['User-Agent'] = self._serialize.header("user_agent", user_agent, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_existing_key( self, custom_headers=None, raw=False, **operation_config): """Get a response with header value "User-Agent": "overwrite". :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/existingkey' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'User-Agent': 'str', }) return client_raw_response def param_protected_key( self, content_type, custom_headers=None, raw=False, **operation_config): """Send a post request with header value "Content-Type": "text/html". :param content_type: Send a post request with header value "Content-Type": "text/html" :type content_type: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/protectedkey' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_protected_key( self, custom_headers=None, raw=False, **operation_config): """Get a response with header value "Content-Type": "text/html". :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/protectedkey' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'Content-Type': 'str', }) return client_raw_response def param_integer( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2 . :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param value: Send a post request with header values 1 or -2 :type value: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/integer' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'int') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_integer( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header value "value": 1 or -2. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/integer' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'int', }) return client_raw_response def param_long( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2 . :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param value: Send a post request with header values 105 or -2 :type value: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/long' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'long') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_long( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header value "value": 105 or -2. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/long' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'long', }) return client_raw_response def param_float( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param value: Send a post request with header values 0.07 or -3.0 :type value: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/float' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'float') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_float( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header value "value": 0.07 or -3.0. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/float' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'float', }) return client_raw_response def param_double( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param value: Send a post request with header values 7e120 or -3.0 :type value: float :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/double' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'float') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_double( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header value "value": 7e120 or -3.0. :param scenario: Send a post request with header values "scenario": "positive" or "negative" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/double' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'float', }) return client_raw_response def param_bool( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. :param scenario: Send a post request with header values "scenario": "true" or "false" :type scenario: str :param value: Send a post request with header values true or false :type value: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/bool' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'bool') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_bool( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header value "value": true or false. :param scenario: Send a post request with header values "scenario": "true" or "false" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/bool' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'bool', }) return client_raw_response def param_string( self, scenario, value=None, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". :param scenario: Send a post request with header values "scenario": "valid" or "null" or "empty" :type scenario: str :param value: Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" :type value: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/string' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') if value is not None: header_parameters['value'] = self._serialize.header("value", value, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_string( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". :param scenario: Send a post request with header values "scenario": "valid" or "null" or "empty" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/string' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'str', }) return client_raw_response def param_date( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param value: Send a post request with header values "2010-01-01" or "0001-01-01" :type value: date :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/date' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'date') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_date( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "2010-01-01" or "0001-01-01". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/date' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'date', }) return client_raw_response def param_datetime( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param value: Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" :type value: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/datetime' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'iso-8601') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_datetime( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/datetime' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'iso-8601', }) return client_raw_response def param_datetime_rfc1123( self, scenario, value=None, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param value: Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" :type value: datetime :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/datetimerfc1123' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') if value is not None: header_parameters['value'] = self._serialize.header("value", value, 'rfc-1123') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_datetime_rfc1123( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". :param scenario: Send a post request with header values "scenario": "valid" or "min" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/datetimerfc1123' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'rfc-1123', }) return client_raw_response def param_duration( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". :param scenario: Send a post request with header values "scenario": "valid" :type scenario: str :param value: Send a post request with header values "P123DT22H14M12.011S" :type value: timedelta :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/duration' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'duration') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_duration( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "P123DT22H14M12.011S". :param scenario: Send a post request with header values "scenario": "valid" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/duration' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'duration', }) return client_raw_response def param_byte( self, scenario, value, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". :param scenario: Send a post request with header values "scenario": "valid" :type scenario: str :param value: Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" :type value: bytearray :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/byte' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') header_parameters['value'] = self._serialize.header("value", value, 'bytearray') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_byte( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". :param scenario: Send a post request with header values "scenario": "valid" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/byte' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': 'bytearray', }) return client_raw_response def param_enum( self, scenario, value=None, custom_headers=None, raw=False, **operation_config): """Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. :param scenario: Send a post request with header values "scenario": "valid" or "null" or "empty" :type scenario: str :param value: Send a post request with header values 'GREY' . Possible values include: 'White', 'black', 'GREY' :type value: str or :class:`GreyscaleColors <Fixtures.AcceptanceTestsHeader.models.GreyscaleColors>` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/param/prim/enum' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') if value is not None: header_parameters['value'] = self._serialize.header("value", value, 'GreyscaleColors') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def response_enum( self, scenario, custom_headers=None, raw=False, **operation_config): """Get a response with header values "GREY" or null. :param scenario: Send a post request with header values "scenario": "valid" or "null" or "empty" :type scenario: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/response/prim/enum' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) header_parameters['scenario'] = self._serialize.header("scenario", scenario, 'str') # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) client_raw_response.add_headers({ 'value': models.GreyscaleColors, }) return client_raw_response def custom_request_id( self, custom_headers=None, raw=False, **operation_config): """Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides<msrest:optionsforoperations>`. :rtype: None :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if raw=true :raises: :class:`ErrorException<Fixtures.AcceptanceTestsHeader.models.ErrorException>` """ # Construct URL url = '/header/custom/x-ms-client-request-id/9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' # Construct parameters query_parameters = {} # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response
40.761516
103
0.647225
5,701
54,865
6.091914
0.035257
0.070947
0.055629
0.045926
0.956003
0.953412
0.946732
0.940887
0.938814
0.938036
0
0.011858
0.259163
54,865
1,345
104
40.791822
0.842592
0.4076
0
0.825095
0
0.001901
0.102168
0.028811
0
0
0
0
0
1
0.057034
false
0
0.003802
0
0.117871
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
83d2a38e32ce9589eac60d53ccbd33dee2763d36
1,505
py
Python
src/_3_long_rep_wo_rep/longest_substring_without_repeating_characters_test.py
sguzman/LeetCodePython
94fbf5669e1e27b69c061ce89c55c01bf61adf63
[ "Unlicense" ]
1
2020-06-20T03:48:18.000Z
2020-06-20T03:48:18.000Z
src/_3_long_rep_wo_rep/longest_substring_without_repeating_characters_test.py
sguzman/LeetCodePython
94fbf5669e1e27b69c061ce89c55c01bf61adf63
[ "Unlicense" ]
null
null
null
src/_3_long_rep_wo_rep/longest_substring_without_repeating_characters_test.py
sguzman/LeetCodePython
94fbf5669e1e27b69c061ce89c55c01bf61adf63
[ "Unlicense" ]
null
null
null
import unittest from _3_long_rep_wo_rep import longest_substring_without_repeating_characters class MyTestCase(unittest.TestCase): def test_1(self): solution = longest_substring_without_repeating_characters.Solution() input_1: str = "abcabcbb" output: int = 3 actual: int = solution.lengthOfLongestSubstring(input_1) self.assertEqual(output, actual) def test_2(self): solution = longest_substring_without_repeating_characters.Solution() input_1: str = "bbbbb" output: int = 1 actual: int = solution.lengthOfLongestSubstring(input_1) self.assertEqual(output, actual) def test_3(self): solution = longest_substring_without_repeating_characters.Solution() input_1: str = "pwwkew" output: int = 3 actual: int = solution.lengthOfLongestSubstring(input_1) self.assertEqual(output, actual) def test_4(self): solution = longest_substring_without_repeating_characters.Solution() input_1: str = "tmmzuxt" output: int = 5 actual: int = solution.lengthOfLongestSubstring(input_1) self.assertEqual(output, actual) def test_5(self): solution = longest_substring_without_repeating_characters.Solution() input_1: str = "bbtablud" output: int = 6 actual: int = solution.lengthOfLongestSubstring(input_1) self.assertEqual(output, actual) if __name__ == '__main__': unittest.main()
27.87037
77
0.686379
163
1,505
6.018405
0.239264
0.061162
0.140673
0.195719
0.830785
0.787971
0.787971
0.787971
0.787971
0.787971
0
0.018182
0.232558
1,505
53
78
28.396226
0.831169
0
0
0.485714
0
0
0.027907
0
0
0
0
0
0.142857
1
0.142857
false
0
0.057143
0
0.228571
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
83f413924287f2690692292fe2c23cd49a82cba4
8,778
py
Python
code/rpy2-demo.py
tychen742/course_datascience_r
30d5fb4123b1ef6c0f9acc5739258713acd22ee1
[ "CC-BY-4.0" ]
null
null
null
code/rpy2-demo.py
tychen742/course_datascience_r
30d5fb4123b1ef6c0f9acc5739258713acd22ee1
[ "CC-BY-4.0" ]
1
2020-01-30T21:31:04.000Z
2020-01-30T21:31:04.000Z
code/rpy2-demo.py
tychen742/course_datascience_r
30d5fb4123b1ef6c0f9acc5739258713acd22ee1
[ "CC-BY-4.0" ]
null
null
null
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Rpy2 demonstration # <headingcell level=2> # by Dan McGlinn (danmcglinn@gmail.com), 11-07-12 # <headingcell level=3> # Part 1: Import necessary modules # <codecell> import rpy2.robjects as robj import rpy2.rinterface as ri import rpy2.robjects.vectors as rv from rpy2.robjects.packages import importr import numpy as np # <headingcell level=3> # Part 2: Interact with the R interpreter by creating and calling R objects # <codecell> # Interact with R using strings print robj.r('3 + 4') robj.r('x = 3') print robj.r('x') # <codecell> # Interact with R using attributes print robj.r.x print "why are the two subsequent calls to ls producing different results?" print robj.r.ls print robj.r.ls() # <codecell> # create a python vector and compute R stats on it x = rv.IntVector(range(0,11)) print "why are the two subsequent calls to mean producing different results?" print robj.r('mean(x)') print robj.r.mean(x) print "Here are some other stats" print "Sum" print robj.r.sum(x) print "Variance" print robj.r.var(x) # <headingcell level=3> # Part 3: Create and interact with multi-dimensional R objects # <codecell> # create R matrices v = robj.FloatVector(robj.r.rnorm(20)) m = robj.r.matrix(v, ncol = 2) print(m) print "According to R the column sums are" print robj.r.apply(m, 2, 'sum') # convert matrix into a numpy array m_np = np.array(m) print(m_np) # <codecell> # read in data as an R data.frame faithful = robj.DataFrame.from_csvfile('/media/sf_Dropbox/teaching/rpy/faithful.dat', sep=' ') print type(faithful) print faithful.names # <codecell> # subset columns # extract as a DataFrame col_one = faithful.rx(1) print robj.r.head(col_one) col_one = faithful.rx('eruptions') print robj.r.head(col_one) # <codecell> # extract as a Vector print faithful.rx2(1)[0:11] print faithful.rx2('eruptions')[0:11] # <codecell> # subset rows print faithful.rx(robj.IntVector(range(1,6)), True) # <headingcell level=3> # Part 4: Work with R and python functions # <codecell> # create an R function and call it in the Python interpreter robj.r(''' calc_area_r = function(radius, verbose=FALSE) { if (verbose) { cat("I am calling calc_area_r().\n") } return( 2 * pi * radius ) } calc_area_r(3) ''') print robj.r.calc_area_r(5, verbose='TRUE') # Make the calc_area_r a callable python function calc_area_py = robj.r.calc_area_r print "Here is the result of calc_area_py()" print calc_area_py(5) print type(calc_area_py) # <codecell> # Rpy supports keyword arguments if there is no pythonic conflict robj.r.rnorm(10, mean=2, sd=3) # <codecell> # this will draw an error robj.r.rpois(10, lambda=3) # <codecell> # creating a keyword argument dictionary solves the problem robj.r.rpois(10, **{'lambda' : 3}) # <codecell> # Make a python function and call it within R ri.initr() stats = importr('stats') def quad_f(x): x = x[0] return x ** -2 + 0.5 * x # wrap the function f so it can be exposed to R quad_fr = ri.rternalize(quad_f) # define the interval to find the minimum over interval = rv.IntVector((0, 10)) # call R's optimize() res = stats.optimize(quad_fr, interval) print res # <headingcell level=3> # Part 5: Creating and exporting R graphics # <codecell> # plotting x = robj.r.runif(10) y = robj.r.rnorm(10) robj.r.plot(x, y, xlab="runif rv", ylab="rnorm rv", col="red") # <codecell> # close that graphic robj.r('dev.off()') # <codecell> # export the graphic as a pdf robj.r.pdf('/media/sf_Dropbox/teaching/rpy/example_r_plot.pdf') robj.r.plot(x, y, xlab="runif rv", ylab="rnorm rv", col="red") robj.r('dev.off()') # <headingcell level=3> # Part 6: Importing R librairies and pythonizing R # <codecell> # import R libraries vegan = importr('vegan') comm_mat = robj.r.matrix(robj.r.rpois(100, 1), 10, 10) ca = vegan.cca(comm_mat) print ca robj.r.plot(ca) # <codecell> # close the graphical device robj.r('dev.off()') # <codecell> # make R pythonic by making it clear which functions are attributed to which packages base = importr('base') stats = importr('stats') graphics = importr('graphics') m = base.matrix(stats.rnorm(100), ncol = 5) pca = stats.princomp(m) graphics.plot(pca, main = "Eigen values") stats.biplot(pca, main = "biplot") ======= # -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Rpy2 demonstration # <headingcell level=2> # by Dan McGlinn (danmcglinn@gmail.com), 11-07-12 # <headingcell level=3> # Part 1: Import necessary modules # <codecell> import rpy2.robjects as robj import rpy2.rinterface as ri import rpy2.robjects.vectors as rv from rpy2.robjects.packages import importr import numpy as np # <headingcell level=3> # Part 2: Interact with the R interpreter by creating and calling R objects # <codecell> # Interact with R using strings print robj.r('3 + 4') robj.r('x = 3') print robj.r('x') # <codecell> # Interact with R using attributes print robj.r.x print "why are the two subsequent calls to ls producing different results?" print robj.r.ls print robj.r.ls() # <codecell> # create a python vector and compute R stats on it x = rv.IntVector(range(0,11)) print "why are the two subsequent calls to mean producing different results?" print robj.r('mean(x)') print robj.r.mean(x) print "Here are some other stats" print "Sum" print robj.r.sum(x) print "Variance" print robj.r.var(x) # <headingcell level=3> # Part 3: Create and interact with multi-dimensional R objects # <codecell> # create R matrices v = robj.FloatVector(robj.r.rnorm(20)) m = robj.r.matrix(v, ncol = 2) print(m) print "According to R the column sums are" print robj.r.apply(m, 2, 'sum') # convert matrix into a numpy array m_np = np.array(m) print(m_np) # <codecell> # read in data as an R data.frame faithful = robj.DataFrame.from_csvfile('/media/sf_Dropbox/teaching/rpy/faithful.dat', sep=' ') print type(faithful) print faithful.names # <codecell> # subset columns # extract as a DataFrame col_one = faithful.rx(1) print robj.r.head(col_one) col_one = faithful.rx('eruptions') print robj.r.head(col_one) # <codecell> # extract as a Vector print faithful.rx2(1)[0:11] print faithful.rx2('eruptions')[0:11] # <codecell> # subset rows print faithful.rx(robj.IntVector(range(1,6)), True) # <headingcell level=3> # Part 4: Work with R and python functions # <codecell> # create an R function and call it in the Python interpreter robj.r(''' calc_area_r = function(radius, verbose=FALSE) { if (verbose) { cat("I am calling calc_area_r().\n") } return( 2 * pi * radius ) } calc_area_r(3) ''') print robj.r.calc_area_r(5, verbose='TRUE') # Make the calc_area_r a callable python function calc_area_py = robj.r.calc_area_r print "Here is the result of calc_area_py()" print calc_area_py(5) print type(calc_area_py) # <codecell> # Rpy supports keyword arguments if there is no pythonic conflict robj.r.rnorm(10, mean=2, sd=3) # <codecell> # this will draw an error robj.r.rpois(10, lambda=3) # <codecell> # creating a keyword argument dictionary solves the problem robj.r.rpois(10, **{'lambda' : 3}) # <codecell> # Make a python function and call it within R ri.initr() stats = importr('stats') def quad_f(x): x = x[0] return x ** -2 + 0.5 * x # wrap the function f so it can be exposed to R quad_fr = ri.rternalize(quad_f) # define the interval to find the minimum over interval = rv.IntVector((0, 10)) # call R's optimize() res = stats.optimize(quad_fr, interval) print res # <headingcell level=3> # Part 5: Creating and exporting R graphics # <codecell> # plotting x = robj.r.runif(10) y = robj.r.rnorm(10) robj.r.plot(x, y, xlab="runif rv", ylab="rnorm rv", col="red") # <codecell> # close that graphic robj.r('dev.off()') # <codecell> # export the graphic as a pdf robj.r.pdf('/media/sf_Dropbox/teaching/rpy/example_r_plot.pdf') robj.r.plot(x, y, xlab="runif rv", ylab="rnorm rv", col="red") robj.r('dev.off()') # <headingcell level=3> # Part 6: Importing R librairies and pythonizing R # <codecell> # import R libraries vegan = importr('vegan') comm_mat = robj.r.matrix(robj.r.rpois(100, 1), 10, 10) ca = vegan.cca(comm_mat) print ca robj.r.plot(ca) # <codecell> # close the graphical device robj.r('dev.off()') # <codecell> # make R pythonic by making it clear which functions are attributed to which packages base = importr('base') stats = importr('stats') graphics = importr('graphics') m = base.matrix(stats.rnorm(100), ncol = 5) pca = stats.princomp(m) graphics.plot(pca, main = "Eigen values") stats.biplot(pca, main = "biplot")
19.77027
94
0.691957
1,436
8,778
4.178273
0.158774
0.053333
0.043333
0.042
1
1
1
1
1
1
0
0.023997
0.173958
8,778
443
95
19.814898
0.803475
0.380383
0
0.959064
0
0
0.272265
0.034645
0
0
0
0
0
0
null
null
0
0.116959
null
null
0.362573
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
f7dd093c7bf0522a73e02781164ef2fa255ad2cd
122
py
Python
flaskproject/modules/__init__.py
austinhrin/flask_cms
70996ab5d0775322654d0036c6db85f52118db6d
[ "Apache-2.0" ]
null
null
null
flaskproject/modules/__init__.py
austinhrin/flask_cms
70996ab5d0775322654d0036c6db85f52118db6d
[ "Apache-2.0" ]
null
null
null
flaskproject/modules/__init__.py
austinhrin/flask_cms
70996ab5d0775322654d0036c6db85f52118db6d
[ "Apache-2.0" ]
null
null
null
from flaskproject.modules.google import * from flaskproject.modules.password_hashing import hash_password, check_password
40.666667
79
0.877049
15
122
6.933333
0.6
0.307692
0.442308
0
0
0
0
0
0
0
0
0
0.07377
122
2
80
61
0.920354
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
7
f7dd18ead5fe27ff1319a7ee16f200657f1541b4
743,211
py
Python
tests/acceleration.py
izgzhen/cozy
fc57fdccdd52c5ecf4c4ae4e8b80af97e8119b77
[ "Apache-2.0" ]
null
null
null
tests/acceleration.py
izgzhen/cozy
fc57fdccdd52c5ecf4c4ae4e8b80af97e8119b77
[ "Apache-2.0" ]
null
null
null
tests/acceleration.py
izgzhen/cozy
fc57fdccdd52c5ecf4c4ae4e8b80af97e8119b77
[ "Apache-2.0" ]
null
null
null
from collections import OrderedDict import unittest import sys from cozy.common import OrderedSet, unique from cozy.target_syntax import * from cozy.syntax_tools import pprint, pprint_unpacked from cozy.contexts import RootCtx from cozy.pools import Pool, RUNTIME_POOL from cozy.synthesis.acceleration import try_optimize, optimized_the from cozy.synthesis.core import possibly_useful from cozy.solver import ModelCachingSolver from cozy.evaluation import eval from cozy.cost_model import CostModel, Order, debug_comparison from cozy.wf import exp_wf def can_improve(e, context, assumptions : Exp = ETRUE, pool : Pool = RUNTIME_POOL, ops : [Op] = ()): print("Optimizing:") pprint_unpacked(e, out=sys.stdout) cm = CostModel(assumptions=assumptions, funcs=context.funcs()) found_improvement = False options = list(try_optimize(e, context, pool)) print("options: {}".format(len(options))) options = list(unique(options)) print("unique: {}".format(len(options))) for i, ee in enumerate(options): print(" --> trying {}/{}...".format(i, len(options))) pprint_unpacked(ee, out=sys.stdout) wf = exp_wf(ee, context=context, pool=pool, assumptions=assumptions) if not wf: print(" NOT WELL-FORMED: {}".format(wf)) continue solver = ModelCachingSolver( vars=[v for v, p in context.vars()], funcs=context.funcs(), assumptions=assumptions) gi = possibly_useful(solver, ee, context, pool, ops=ops) if not gi: print(" NOT A GOOD IDEA: {}".format(gi)) continue if ee.type != e.type: print(" DIFFERENT TYPE: is {}, should be {}".format(pprint(ee.type), pprint(e.type))) continue model = solver.satisfy(ENot(EImplies(assumptions, EEq(e, ee)))) if model is not None: print(" INVALID") print(" model = {!r}".format(model)) print(" expected = {!r}".format(eval(e, model))) print(" actual = {!r}".format(eval(ee, model))) continue else: print(" VALID") order = cm.compare(ee, e, context, pool) if order == Order.LT: print(" IMPROVED") found_improvement = True else: print(" NOT IMPROVED: order is {}".format(order)) debug_comparison(cm, ee, e, context) return found_improvement class TestAccelerationRules(unittest.TestCase): def test_argmin(self): xs = EVar("xs").with_type(INT_BAG) ys = EVar("ys").with_type(INT_BAG) x = EVar("x").with_type(INT) ctx = RootCtx(state_vars=[xs], args=[ys]) e = EArgMin(EBinOp(ys, "+", EStateVar(xs).with_type(xs.type)).with_type(INT_BAG), ELambda(x, x)).with_type(INT) assert can_improve(e, ctx) def test_constant(self): t = TEnum(["A", "B"]) e = EEq(EEnumEntry("A").with_type(t), EEnumEntry("B").with_type(t)) assert can_improve(e, context=RootCtx(state_vars=(), args=())) def test_the_infinite_loop(self): e = EBinOp(EFilter(EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('index').with_type(TInt())).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat())), '+', EFilter(EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), EBinOp(EVar('index').with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()), EStateVar(EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat())) args = [EVar('index').with_type(TInt())] for res in optimized_the(e, args): print(pprint(res)) def test_regression01(self): e = EUnaryOp('exists', EBinOp(EFilter(EStateVar(EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('EVERYBODY').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 'in', EStateVar(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), '+', EFilter(EMapGet(EStateVar(EMakeMap2(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_key85182').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('_key85182').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TMap(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TMap(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 'in', EStateVar(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool()) ctx = RootCtx(state_vars=OrderedSet([EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))]), args=OrderedSet([EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('all', EMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), EBinOp(EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool()), 'and', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EBinOp(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool()), 'and', EBinOp(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), '!=', EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('all', EMap(EBinOp(EBinOp(EBinOp(EFlatMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), ESingleton(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EUnaryOp('all', EMap(EBinOp(EBinOp(EBinOp(EFlatMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), ESingleton(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), '==', EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'val').with_type(TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), '==', EGetField(EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'val').with_type(TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), ESingleton(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), ESingleton(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), '==', EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), '==', EGetField(EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, ctx, assumptions=assumptions) def test_regression02(self): e = EFilter(EMapGet(EStateVar(EMakeMap2(EMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var1003173').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ETupleGet(EVar('_var1003173').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_key1003168').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EFilter(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('_key1003168').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 'in', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TMap(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TMap(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))), EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EBinOp(EGetField(EGetField(EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), 'rosterMode').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))), '==', EEnumEntry('EVERYBODY').with_type(TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))).with_type(TBool()), 'or', EHasKey(EStateVar(EMakeMap2(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var3121796').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), EBool(True).with_type(TBool()))).with_type(TMap(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), TBool()))).with_type(TMap(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), TBool())), ETuple((EVar('g').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))) ctx = RootCtx(state_vars=OrderedSet([EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))]), args=OrderedSet([EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('all', EMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), EBinOp(EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'in', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool()), 'and', EBinOp(ETupleGet(EVar('e').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EBinOp(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool()), 'and', EBinOp(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'in', EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), '!=', EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('all', EMap(EBinOp(EBinOp(EBinOp(EFlatMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), ESingleton(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EUnaryOp('all', EMap(EBinOp(EBinOp(EBinOp(EFlatMap(EVar('users').with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), ESingleton(EVar('_var19').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 1).with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u1').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), '+', ESingleton(EVar('u2').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))).with_type(TBag(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))), ELambda(EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), '==', EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var22').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'val').with_type(TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))), '==', EGetField(EVar('_var23').with_type(THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))), 'val').with_type(TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), ESingleton(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('groups').with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), ESingleton(EVar('_var20').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), '+', EFlatMap(EVar('groupMembers').with_type(TBag(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/'))))))))), ELambda(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), ESingleton(ETupleGet(EVar('_var21').with_type(TTuple((THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), THandle('User', TRecord((('username', TNative('String /*Username*/')), ('salt', TNative('String /*Salt*/')), ('storedKey', TNative('String /*StoredKey*/')), ('serverKey', TNative('String /*ServerKey*/')), ('iterations', TNative('int /*Iterations*/')), ('name', TNative('String /*Name*/')), ('email', TNative('String /*Email*/')), ('creationDate', TNative('java.util.Date /*CreationDate*/')), ('modificationDate', TNative('java.util.Date /*ModificationDate*/')))))))), 0).with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))))).with_type(TBag(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))), ELambda(EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), EBinOp(EUnaryOp('not', EBinOp(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), '==', EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))))).with_type(TBool())).with_type(TBool()), 'or', EBinOp(EGetField(EVar('_var24').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY')))))), '==', EGetField(EVar('_var25').with_type(THandle('Group', TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))), 'val').with_type(TRecord((('name', TNative('String /*GroupName*/')), ('description', TNative('String /*GroupDesc*/')), ('rosterMode', TEnum(('NOBODY', 'ONLY_GROUP', 'EVERYBODY'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, ctx, assumptions=assumptions) def test_regression03(self): e = EArgMin(EBinOp(EStateVar(EMap(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 1).with_type(TFloat()))).with_type(TBag(TFloat()))).with_type(TBag(TFloat())), '+', ESingleton(EVar('f').with_type(TFloat())).with_type(TBag(TFloat()))).with_type(TBag(TFloat())), ELambda(EVar('_var4388').with_type(TFloat()), EVar('_var4388').with_type(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))]), args=OrderedSet([EVar('index').with_type(TInt()), EVar('f').with_type(TFloat())]), funcs=OrderedDict()) assumptions = EBinOp(EUnaryOp('unique', EMap(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression04(self): e = EArgMin(EMap(EFilter(EStateVar(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), EBinOp(ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()), '!=', EVar('index').with_type(TInt())).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('_var12220').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('_var12220').with_type(TTuple((TInt(), TFloat()))), 1).with_type(TFloat()))).with_type(TBag(TFloat())), ELambda(EVar('_var4776').with_type(TFloat()), EVar('_var4776').with_type(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))]), args=OrderedSet([EVar('index').with_type(TInt())]), funcs=OrderedDict()) assumptions = EBinOp(EUnaryOp('unique', EMap(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), EBinOp(ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()), '==', EVar('index').with_type(TInt())).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression05(self): e = EArgMin(EFilter(EStateVar(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), EBinOp(ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()), '!=', EVar('index').with_type(TInt())).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('_var2116').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('_var2116').with_type(TTuple((TInt(), TFloat()))), 1).with_type(TFloat()))).with_type(TTuple((TInt(), TFloat()))) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))]), args=OrderedSet([EVar('index').with_type(TInt())]), funcs=OrderedDict()) assumptions = EBinOp(EUnaryOp('unique', EMap(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()))).with_type(TBag(TInt()))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('xs').with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBool()), 'and', EUnaryOp('exists', EFilter(EVar('xs').with_type(TBag(TTuple((TInt(), TFloat())))), ELambda(EVar('p').with_type(TTuple((TInt(), TFloat()))), EBinOp(ETupleGet(EVar('p').with_type(TTuple((TInt(), TFloat()))), 0).with_type(TInt()), '==', EVar('index').with_type(TInt())).with_type(TBool()))).with_type(TBag(TTuple((TInt(), TFloat()))))).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression06(self): e = EUnaryOp('sum', EBinOp(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression07(self): e = EMap(EBinOp(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), '+', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(EStateVar(ECond(EVar('isDropped').with_type(TBool()), ENum(1.0).with_type(TFloat()), ENum(1.0).with_type(TFloat())).with_type(TFloat())).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) @unittest.skip("not supported yet") def test_regression08(self): """ Actually, Cozy's IR does not have a good solution for this one. The problem is that arg{min,max} MUST return the FIRST element that minimizes the key function. In many cases it is easy to compute SOME element that minimizes the key function, but it is very hard to find the FIRST such element. We won't have a good solution here until Cozy supports partial functions. """ e = EArgMin(EStateVar(EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int'))))).with_type(TBag(THandle('ETRUE', TNative('int')))), ELambda(EVar('_var2531').with_type(THandle('ETRUE', TNative('int'))), ECond(EBinOp(EVar('_var2531').with_type(THandle('ETRUE', TNative('int'))), '==', EVar('x').with_type(THandle('ETRUE', TNative('int')))).with_type(TBool()), EVar('nv').with_type(TNative('int')), EGetField(EVar('_var2531').with_type(THandle('ETRUE', TNative('int'))), 'val').with_type(TNative('int'))).with_type(TNative('int')))).with_type(THandle('ETRUE', TNative('int'))) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int'))))]), args=OrderedSet([EVar('x').with_type(THandle('ETRUE', TNative('int'))), EVar('nv').with_type(TNative('int'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EUnaryOp('unique', EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int'))))).with_type(TBool()), 'and', EBinOp(EVar('x').with_type(THandle('ETRUE', TNative('int'))), 'in', EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int'))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EVar('x').with_type(THandle('ETRUE', TNative('int'))), 'val').with_type(TNative('int')), '!=', EVar('nv').with_type(TNative('int'))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int')))), ELambda(EVar('_var12').with_type(THandle('ETRUE', TNative('int'))), ESingleton(EVar('_var12').with_type(THandle('ETRUE', TNative('int')))).with_type(TBag(THandle('ETRUE', TNative('int')))))).with_type(TBag(THandle('ETRUE', TNative('int')))), '+', ESingleton(EVar('x').with_type(THandle('ETRUE', TNative('int')))).with_type(TBag(THandle('ETRUE', TNative('int'))))).with_type(TBag(THandle('ETRUE', TNative('int')))), ELambda(EVar('_var13').with_type(THandle('ETRUE', TNative('int'))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('xs').with_type(TBag(THandle('ETRUE', TNative('int')))), ELambda(EVar('_var12').with_type(THandle('ETRUE', TNative('int'))), ESingleton(EVar('_var12').with_type(THandle('ETRUE', TNative('int')))).with_type(TBag(THandle('ETRUE', TNative('int')))))).with_type(TBag(THandle('ETRUE', TNative('int')))), '+', ESingleton(EVar('x').with_type(THandle('ETRUE', TNative('int')))).with_type(TBag(THandle('ETRUE', TNative('int'))))).with_type(TBag(THandle('ETRUE', TNative('int')))), ELambda(EVar('_var14').with_type(THandle('ETRUE', TNative('int'))), EBinOp(EBinOp(EVar('_var13').with_type(THandle('ETRUE', TNative('int'))), '==', EVar('_var14').with_type(THandle('ETRUE', TNative('int')))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var13').with_type(THandle('ETRUE', TNative('int'))), 'val').with_type(TNative('int')), '==', EGetField(EVar('_var14').with_type(THandle('ETRUE', TNative('int'))), 'val').with_type(TNative('int'))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression09(self): e = EUnaryOp('the', ECond(EStateVar(EVar('isDropped').with_type(TBool())).with_type(TBool()), EBinOp(EStateVar(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), EStateVar(EFilter(EVar('xs').with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression10(self): e = EUnaryOp('the', EMap(EBinOp(EStateVar(ECond(EVar('isDropped').with_type(TBool()), EVar('xs').with_type(TList(TFloat())), EEmptyList().with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '-', ESingleton(EStateVar(EListGet(EVar('xs').with_type(TList(TFloat())), EVar('dropped').with_type(TInt())).with_type(TFloat())).with_type(TFloat())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression11(self): e = EUnaryOp('the', EBinOp(EMap(EListSlice(EStateVar(EListSlice(EVar('xs').with_type(TList(TFloat())), ENum(0).with_type(TInt()), ENum(1).with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('index').with_type(TInt())).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), '+', EStateVar(EListSlice(EMap(EListSlice(EVar('xs').with_type(TList(TFloat())), ENum(1).with_type(TInt()), EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '+', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), ENum(1).with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet([EVar('index').with_type(TInt())]), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('index').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('index').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression12(self): e = EFilter(EBinOp(EStateVar(EListSlice(EVar('xs').with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('dropped').with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat())), '+', EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), EBinOp(EStateVar(EVar('dropped').with_type(TInt())).with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()), EStateVar(EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat())) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression13(self): e = EFilter(EBinOp(EStateVar(EFilter(EListSlice(EVar('xs').with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('dropped').with_type(TInt())).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat()))).with_type(TList(TFloat())), '+', EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), EBinOp(EStateVar(EVar('dropped').with_type(TInt())).with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()), EStateVar(EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat())), ELambda(EVar('x').with_type(TFloat()), EBinOp(ECall('log', (EBinOp(ENum(1.0).with_type(TFloat()), '+', EVar('x').with_type(TFloat())).with_type(TFloat()),)).with_type(TFloat()), '<', ECall('log', (ENum(1.5).with_type(TFloat()),)).with_type(TFloat())).with_type(TBool()))).with_type(TList(TFloat())) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('log', TFunc((TFloat(),), TFloat()))])) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EUnaryOp('exists', EVar('xs').with_type(TList(TFloat()))).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) @unittest.skip("broken") def test_regression14(self): e = EArgMin(EBinOp(EMap(EFilter(EStateVar(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('_var3364692').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EUnaryOp('not', EBinOp(EGetField(EVar('_var3364692').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_id').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var8419122').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var8419122').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_key8419117').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_key8419117').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_timeout').with_type(TNative('mongo::Date_t')))).with_type(TBag(TNative('mongo::Date_t'))), '+', ESingleton(ECall('after', (EVar('now').with_type(TNative('mongo::Date_t')), EStateVar(EVar('hostTimeout').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))).with_type(TBag(TNative('mongo::Date_t')))).with_type(TBag(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict([('eternity', TFunc((), TNative('mongo::Date_t'))), ('after', TFunc((TNative('mongo::Date_t'), TNative('mongo::Milliseconds')), TNative('mongo::Date_t'))), ('nullConn', TFunc((), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('nullReq', TFunc((), TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))])) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TBag(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TBag(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TBag(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression15(self): e = EUnaryOp('the', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var1003').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var1003').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_key1002').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_key1002').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('now').with_type(TNative('mongo::Date_t')), EVar('lastUsed').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict([('eternity', TFunc((), TNative('mongo::Date_t'))), ('after', TFunc((TNative('mongo::Date_t'), TNative('mongo::Milliseconds')), TNative('mongo::Date_t'))), ('nullConn', TFunc((), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('nullReq', TFunc((), TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))])) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TBag(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TBag(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TBag(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression16(self): e = EUnaryOp('sum', EBinOp(EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), EBinOp(EVar('index').with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()), EStateVar(EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TInt())).with_type(TList(TFloat())), '+', EListSlice(EStateVar(EVar('xs').with_type(TList(TFloat()))).with_type(TList(TFloat())), ENum(0).with_type(TInt()), EVar('index').with_type(TInt())).with_type(TList(TFloat()))).with_type(TList(TFloat()))).with_type(TFloat()) context = RootCtx(state_vars=OrderedSet([EVar('xs').with_type(TList(TFloat())), EVar('isDropped').with_type(TBool()), EVar('dropped').with_type(TInt())]), args=OrderedSet([EVar('index').with_type(TInt())]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EVar('isDropped').with_type(TBool()), '=>', EBinOp(EBinOp(EVar('dropped').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('dropped').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('index').with_type(TInt()), '>=', ENum(0).with_type(TInt())).with_type(TBool()), 'and', EBinOp(EVar('index').with_type(TInt()), '<', EUnaryOp('len', EVar('xs').with_type(TList(TFloat()))).with_type(TInt())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(e, context=context, assumptions=assumptions) def test_regression17(self): e = EUnaryOp('exists', EMapGet(EStateVar(EMakeMap2(EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')))).with_type(TBag(TNative('mongo::HostAndPort'))), ELambda(EVar('_var716').with_type(TNative('mongo::HostAndPort')), EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('_var716').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))))).with_type(TMap(TNative('mongo::HostAndPort'), TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))))).with_type(TMap(TNative('mongo::HostAndPort'), TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))), EGetField(EUnaryOp('the', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var379').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var379').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assert can_improve(e, context=context) def test_regression18(self): new_e = EFilter(EBinOp(EBinOp(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var12666').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var12666').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var15881').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var15881').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EStateVar(EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EStateVar(EVar('retId').with_type(TInt())).with_type(TInt())), ('conn_dropped', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var19819').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var19819').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool())), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var25108').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var25108').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(new_e, context=context, assumptions=assumptions) def test_regression19(self): new_e = EFilter(EBinOp(EBinOp(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var47676').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var47676').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var50891').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var50891').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EStateVar(EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EStateVar(EVar('retId').with_type(TInt())).with_type(TInt())), ('conn_dropped', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var54829').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var54829').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool())), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var60118').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var60118').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(new_e, context=context, assumptions=assumptions) def test_regression20(self): new_e = EArgMin(EMap(EBinOp(EFilter(EStateVar(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('_var38893').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EUnaryOp('not', EBinOp(EVar('_var38893').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'in', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var34899').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EMap(EFilter(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EBinOp(EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_id').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var34899').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '+', ESingleton(EMakeRecord((('host_id', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var40511').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var40511').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EBinOp(EBinOp(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '-', ESingleton(EUnaryOp('the', EMap(EFilter(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var47676').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var47676').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var50891').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var50891').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EStateVar(EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EStateVar(EVar('retId').with_type(TInt())).with_type(TInt())), ('conn_dropped', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var54829').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var54829').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool())), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var60118').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var60118').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EStateVar(EVar('hostTimeout').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_timeout').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(new_e, context=context, assumptions=assumptions) def test_regression21(self): new_e = EArgMin(EMap(EBinOp(EFilter(EStateVar(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('_var38877').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EUnaryOp('not', EBinOp(EVar('_var38877').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'in', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var34899').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EMap(EFilter(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EBinOp(EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_id').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var34899').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '+', ESingleton(EMakeRecord((('host_id', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var40491').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var40491').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EBinOp(EFilter(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var45783').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EUnaryOp('not', EBinOp(EVar('_var45783').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'in', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var43698').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var43698').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var47640').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var47640').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var50847').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var50847').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EStateVar(EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EStateVar(EVar('retId').with_type(TInt())).with_type(TInt())), ('conn_dropped', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var54777').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var54777').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool())), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var60034').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var60034').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EStateVar(EVar('hostTimeout').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_timeout').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(new_e, context=context, assumptions=assumptions) @unittest.skip("broken") def test_regression22(self): new_e = EUnaryOp('exists', EMap(EFilter(EBinOp(EFilter(EStateVar(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var3924').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EUnaryOp('not', EBinOp(EVar('_var3924').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'in', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var3159').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ESingleton(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var3159').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), '+', ESingleton(EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var3989').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var3989').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var4380').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var4380').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EStateVar(EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds'))).with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EStateVar(EVar('retId').with_type(TInt())).with_type(TInt())), ('conn_dropped', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var4771').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var4771').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool()))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TBool())), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EMapGet(EStateVar(EMakeMap2(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBag(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ELambda(EVar('_var5726').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('_var5726').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort')))).with_type(TMap(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'), TNative('mongo::HostAndPort'))), EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6547').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var6547').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet([EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('now').with_type(TNative('mongo::Date_t'))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) assert can_improve(new_e, context=context, assumptions=assumptions) def test_regression23(self): e = EArgMin(EBinOp(EBinOp(EStateVar(EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_expiration').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EStateVar(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_next_refresh').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), '+', EStateVar(EMap(EFilter(EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')) context = RootCtx(state_vars=OrderedSet([EVar('minConnections').with_type(TInt()), EVar('maxConnections').with_type(TInt()), EVar('maxConnecting').with_type(TInt()), EVar('refreshTimeout').with_type(TNative('mongo::Milliseconds')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')), EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), EVar('retId').with_type(TInt())]), args=OrderedSet(), funcs=OrderedDict([('eternity', TFunc((), TNative('mongo::Date_t'))), ('after', TFunc((TNative('mongo::Date_t'), TNative('mongo::Milliseconds')), TNative('mongo::Date_t'))), ('nullConn', TFunc((), TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('nullReq', TFunc((), TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))])) assumptions = EBinOp(EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_last_used').with_type(TInt()), '<', EVar('retId').with_type(TInt())).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EMap(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_callback').with_type(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TList(TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')))).with_type(TBool()), 'and', EBinOp(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), '==', EMap(EMap(EFilter(EUnaryOp('distinct', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EVar('p').with_type(TNative('mongo::HostAndPort')))).with_type(TList(TNative('mongo::HostAndPort'))), ELambda(EVar('p').with_type(TNative('mongo::HostAndPort')), EMakeRecord((('host_id', EVar('p').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EVar('p').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EUnaryOp('unique', EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TBool()), 'and', EBinOp(EUnaryOp('exists', EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool())).with_type(TBool()) ops = [Op('markReady', [('i', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('now', TNative('mongo::Date_t')), ('lastUsed', TNative('mongo::Date_t'))], [EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool()), EBinOp(EGetField(EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool()), EUnaryOp('all', EMap(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EVar('now').with_type(TNative('mongo::Date_t')), '>=', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool())], SSeq(SDecl(EVar('c'), EUnaryOp('the', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), '==', EVar('i').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), SSeq(SCall(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), 'remove_all', (EMap(EFilter(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EBinOp(EGetField(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), 'host_id').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), ELambda(EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))), EVar('h').with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))))).with_type(TList(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))),)), SSeq(SCall(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'remove', (EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))),)), SSeq(SCall(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), 'add', (EMakeRecord((('conn_state', EEnumEntry('READY').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))), ('conn_host', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('conn_iface', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_iface').with_type(TNative('mongo::executor::ConnectionPool::ConnectionInterface*'))), ('conn_next_refresh', ECall('after', (EVar('lastUsed').with_type(TNative('mongo::Date_t')), EVar('refreshRequirement').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))), ('conn_returned', EVar('now').with_type(TNative('mongo::Date_t'))), ('conn_last_used', EVar('retId').with_type(TInt())), ('conn_dropped', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_dropped').with_type(TBool())))).with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))),)), SSeq(SIf(EUnaryOp('not', EBinOp(EUnaryOp('exists', EMap(EFilter(EVar('reqs').with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EBinOp(EGetField(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), 'rq_host').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()))).with_type(TBag(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort')))))), ELambda(EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))), EVar('r').with_type(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TList(TRecord((('rq_callback', TNative('mongo::executor::ConnectionPool::GetConnectionCallback*')), ('rq_expiration', TNative('mongo::Date_t')), ('rq_host', TNative('mongo::HostAndPort'))))))).with_type(TBool()), 'or', EUnaryOp('exists', EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6546').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '==', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6547').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var6547').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TBool())).with_type(TBool())).with_type(TBool()), SCall(EVar('_idleHosts').with_type(TBag(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t')))))), 'add', (EMakeRecord((('host_id', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))), ('host_timeout', ECall('after', (EArgMax(EMap(EMap(EFilter(EVar('conns').with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EBinOp(EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort')), '==', EGetField(EVar('c').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_host').with_type(TNative('mongo::HostAndPort'))).with_type(TBool()), 'and', EBinOp(EGetField(EVar('_var6549').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_state').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), '!=', EEnumEntry('CHECKED_OUT').with_type(TEnum(('READY', 'PROCESSING', 'CHECKED_OUT')))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EVar('_var6550').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))))).with_type(TList(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool()))))), ELambda(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), EGetField(EVar('_var6548').with_type(TRecord((('conn_state', TEnum(('READY', 'PROCESSING', 'CHECKED_OUT'))), ('conn_host', TNative('mongo::HostAndPort')), ('conn_iface', TNative('mongo::executor::ConnectionPool::ConnectionInterface*')), ('conn_next_refresh', TNative('mongo::Date_t')), ('conn_returned', TNative('mongo::Date_t')), ('conn_last_used', TInt()), ('conn_dropped', TBool())))), 'conn_returned').with_type(TNative('mongo::Date_t')))).with_type(TList(TNative('mongo::Date_t'))), ELambda(EVar('x').with_type(TNative('mongo::Date_t')), EVar('x').with_type(TNative('mongo::Date_t')))).with_type(TNative('mongo::Date_t')), EVar('hostTimeout').with_type(TNative('mongo::Milliseconds')))).with_type(TNative('mongo::Date_t'))))).with_type(TRecord((('host_id', TNative('mongo::HostAndPort')), ('host_timeout', TNative('mongo::Date_t'))))),)), SNoOp()), SAssign(EVar('retId').with_type(TInt()), EBinOp(EVar('retId').with_type(TInt()), '+', ENum(1).with_type(TInt())).with_type(TInt()))))))), '')] assert can_improve(e, context=context, assumptions=assumptions, ops=ops) def test_regression24(self): e = EFilter(EStateVar(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'inUse').with_type(TBool()), '==', EVar('inUse').with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('DiskAndMemory').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()), 'or', EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('MemoryOnly').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool())).with_type(TBool())).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))) context = RootCtx(state_vars=OrderedSet([EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))]), args=OrderedSet([EVar('inUse').with_type(TBool())]), funcs=OrderedDict()) assumptions = EBinOp(EUnaryOp('unique', EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')))).with_type(TList(TNative('uint64_t')))).with_type(TBool()), 'and', EBinOp(EUnaryOp('unique', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var36').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var36').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var37').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var36').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var36').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var38').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var37').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var38').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var37').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var38').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()) ops = [Op('add', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))], [EUnaryOp('all', EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('x').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('x').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')), '!=', EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TList(TBool()))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SCall(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), 'add', (EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))),)), ''), Op('rm', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SCall(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), 'remove', (EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))),)), ''), Op('updateState', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '!=', EVar('st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SAssign(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), EVar('st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))), ''), Op('updateInUse', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ('inUse', TBool())], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'inUse').with_type(TBool()), '!=', EVar('inUse').with_type(TBool())).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SAssign(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'inUse').with_type(TBool()), EVar('inUse').with_type(TBool())), '')] assert can_improve(e, context=context, assumptions=assumptions, ops=ops) def test_regression25(self): e = EMapGet(EStateVar(EMakeMap2(EFilter(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var54686').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('_var54686').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '==', EEnumEntry('Disk').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var132170').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('_var132170').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'diskSize').with_type(TInt()))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TInt()))).with_type(TMap(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), TInt())), EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TInt()) context = RootCtx(state_vars=OrderedSet([EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))]), args=OrderedSet([EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))]), funcs=OrderedDict()) assumptions = EBinOp(EBinOp(EUnaryOp('unique', EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')))).with_type(TBag(TNative('uint64_t')))).with_type(TBool()), 'and', EUnaryOp('unique', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool())).with_type(TBool()), 'and', EBinOp(EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), 'and', EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())).with_type(TBool())).with_type(TBool()) ops = [Op('add', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))], [EUnaryOp('all', EMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('x').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EGetField(EGetField(EVar('x').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t')), '!=', EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'key').with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var12').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var13').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var14').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SCall(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), 'add', (EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))),)), ''), Op('rm', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var15').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var16').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var17').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SCall(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), 'remove', (EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))),)), ''), Op('updateState', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), '!=', EVar('st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var18').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var19').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var20').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SAssign(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), EVar('st').with_type(TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid')))), ''), Op('updateInUse', [('e', THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ('inUse', TBool())], [EBinOp(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'in', EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBool()), EBinOp(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'inUse').with_type(TBool()), '!=', EVar('inUse').with_type(TBool())).with_type(TBool()), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EUnaryOp('all', EMap(EBinOp(EFlatMap(EVar('entries').with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), ESingleton(EVar('_var21').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), '+', ESingleton(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))))).with_type(TBag(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))), ELambda(EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), EBinOp(EBinOp(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), '==', EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))))).with_type(TBool()), '=>', EBinOp(EGetField(EVar('_var22').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), '==', EGetField(EVar('_var23').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))).with_type(TBool())).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool()))).with_type(TBag(TBool()))).with_type(TBool())], SAssign(EGetField(EGetField(EVar('e').with_type(THandle('Entry', TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool()))))), 'val').with_type(TRecord((('key', TNative('uint64_t')), ('pixmap', TNative('QPixmap *')), ('indexData', TNative('QByteArray')), ('memSize', TInt()), ('diskSize', TInt()), ('st', TEnum(('Disk', 'Loading', 'DiskAndMemory', 'MemoryOnly', 'Saving', 'NetworkPending', 'IndexPending', 'Invalid'))), ('inUse', TBool())))), 'inUse').with_type(TBool()), EVar('inUse').with_type(TBool())), '')] assert can_improve(e, context=context, assumptions=assumptions, ops=ops) def test_regression26(self): e = EUnaryOp('distinct', EBinOp(EStateVar(EMap(EFilter(EVar('lineitem').with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), EBinOp(EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'shipdate').with_type(TNative('uint64_t')), '<=', ECall('exampleDate1', ()).with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), ETuple((EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'returnflag').with_type(TNative('char')), EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'linestatus').with_type(TNative('char')))).with_type(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char'))))), '+', EMap(EFilter(ESingleton(EMakeRecord((('orderkey', EVar('orderkey').with_type(TInt())), ('partkey', EVar('partkey').with_type(TInt())), ('suppkey', EVar('suppkey').with_type(TInt())), ('linenumber', EVar('linenumber').with_type(TInt())), ('quantity', EVar('quantity').with_type(TFloat())), ('extendedprice', EVar('extendedprice').with_type(TFloat())), ('discount', EVar('discount').with_type(TFloat())), ('tax', EVar('tax').with_type(TFloat())), ('returnflag', EVar('returnflag').with_type(TNative('char'))), ('linestatus', EVar('linestatus').with_type(TNative('char'))), ('shipdate', EVar('shipdate').with_type(TNative('uint64_t'))), ('commitdate', EVar('commitdate').with_type(TNative('uint64_t'))), ('receiptdate', EVar('receiptdate').with_type(TNative('uint64_t'))), ('shipinstruct', EVar('shipinstruct').with_type(TString())), ('shipmode', EVar('shipmode').with_type(TString())), ('comment', EVar('comment').with_type(TString())))).with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), EBinOp(EVar('shipdate').with_type(TNative('uint64_t')), '<=', ECall('exampleDate1', ()).with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), ETuple((EVar('returnflag').with_type(TNative('char')), EVar('linestatus').with_type(TNative('char')))).with_type(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char'))))) context = RootCtx(state_vars=OrderedSet([EVar('lineitem').with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), EVar('orders').with_type(TBag(TRecord((('orderkey', TInt()), ('custkey', TInt()), ('orderstatus', TNative('char')), ('totalprice', TFloat()), ('orderdate', TNative('uint64_t')), ('orderpriority', TString()), ('clerk', TString()), ('shippriority', TInt()), ('comment', TString()))))), EVar('part').with_type(TBag(TRecord((('partkey', TInt()), ('name', TString()), ('mfgr', TString()), ('brand', TString()), ('part_type', TString()), ('size', TInt()), ('container', TString()), ('retailprice', TFloat()), ('comment', TString()))))), EVar('customer').with_type(TBag(TRecord((('custkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('mktsegment', TString()), ('comment', TString()))))), EVar('supplier').with_type(TBag(TRecord((('suppkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('comment', TString()))))), EVar('partsupp').with_type(TBag(TRecord((('partkey', TInt()), ('suppkey', TInt()), ('availqty', TInt()), ('supplycost', TFloat()), ('comment', TString()))))), EVar('nation').with_type(TBag(TRecord((('nationkey', TInt()), ('name', TString()), ('regionkey', TInt()), ('comment', TString()))))), EVar('region').with_type(TBag(TRecord((('regionkey', TInt()), ('name', TString()), ('comment', TString())))))]), args=OrderedSet([EVar('orderkey').with_type(TInt()), EVar('partkey').with_type(TInt()), EVar('suppkey').with_type(TInt()), EVar('linenumber').with_type(TInt()), EVar('quantity').with_type(TFloat()), EVar('extendedprice').with_type(TFloat()), EVar('discount').with_type(TFloat()), EVar('tax').with_type(TFloat()), EVar('returnflag').with_type(TNative('char')), EVar('linestatus').with_type(TNative('char')), EVar('shipdate').with_type(TNative('uint64_t')), EVar('commitdate').with_type(TNative('uint64_t')), EVar('receiptdate').with_type(TNative('uint64_t')), EVar('shipinstruct').with_type(TString()), EVar('shipmode').with_type(TString()), EVar('comment').with_type(TString())]), funcs=OrderedDict([('div', TFunc((TFloat(), TFloat()), TFloat())), ('fmul', TFunc((TFloat(), TFloat()), TFloat())), ('int2float', TFunc((TInt(),), TFloat())), ('endswith', TFunc((TString(), TString()), TBool())), ('brand23', TFunc((), TString())), ('medbox', TFunc((), TString())), ('brass', TFunc((), TString())), ('europe', TFunc((), TString())), ('building', TFunc((), TString())), ('exampleDate1', TFunc((), TNative('uint64_t'))), ('exampleDate2', TFunc((), TNative('uint64_t'))), ('exampleDate3', TFunc((), TNative('uint64_t'))), ('exampleDate4', TFunc((), TNative('uint64_t')))])) assert can_improve(e, context=context) def test_regression27(self): e = EFilter(ESingleton(EMakeRecord((('orderkey', EVar('orderkey').with_type(TInt())), ('partkey', EVar('partkey').with_type(TInt())), ('suppkey', EVar('suppkey').with_type(TInt())), ('linenumber', EVar('linenumber').with_type(TInt())), ('quantity', EVar('quantity').with_type(TFloat())), ('extendedprice', EVar('extendedprice').with_type(TFloat())), ('discount', EVar('discount').with_type(TFloat())), ('tax', EVar('tax').with_type(TFloat())), ('returnflag', EVar('returnflag').with_type(TNative('char'))), ('linestatus', EVar('linestatus').with_type(TNative('char'))), ('shipdate', EVar('shipdate').with_type(TNative('uint64_t'))), ('commitdate', EVar('commitdate').with_type(TNative('uint64_t'))), ('receiptdate', EVar('receiptdate').with_type(TNative('uint64_t'))), ('shipinstruct', EVar('shipinstruct').with_type(TString())), ('shipmode', EVar('shipmode').with_type(TString())), ('comment', EVar('comment').with_type(TString())))).with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), EBinOp(EVar('shipdate').with_type(TNative('uint64_t')), '<=', ECall('exampleDate1', ()).with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))) context = RootCtx(state_vars=OrderedSet([EVar('lineitem').with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), EVar('orders').with_type(TBag(TRecord((('orderkey', TInt()), ('custkey', TInt()), ('orderstatus', TNative('char')), ('totalprice', TFloat()), ('orderdate', TNative('uint64_t')), ('orderpriority', TString()), ('clerk', TString()), ('shippriority', TInt()), ('comment', TString()))))), EVar('part').with_type(TBag(TRecord((('partkey', TInt()), ('name', TString()), ('mfgr', TString()), ('brand', TString()), ('part_type', TString()), ('size', TInt()), ('container', TString()), ('retailprice', TFloat()), ('comment', TString()))))), EVar('customer').with_type(TBag(TRecord((('custkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('mktsegment', TString()), ('comment', TString()))))), EVar('supplier').with_type(TBag(TRecord((('suppkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('comment', TString()))))), EVar('partsupp').with_type(TBag(TRecord((('partkey', TInt()), ('suppkey', TInt()), ('availqty', TInt()), ('supplycost', TFloat()), ('comment', TString()))))), EVar('nation').with_type(TBag(TRecord((('nationkey', TInt()), ('name', TString()), ('regionkey', TInt()), ('comment', TString()))))), EVar('region').with_type(TBag(TRecord((('regionkey', TInt()), ('name', TString()), ('comment', TString())))))]), args=OrderedSet([EVar('orderkey').with_type(TInt()), EVar('partkey').with_type(TInt()), EVar('suppkey').with_type(TInt()), EVar('linenumber').with_type(TInt()), EVar('quantity').with_type(TFloat()), EVar('extendedprice').with_type(TFloat()), EVar('discount').with_type(TFloat()), EVar('tax').with_type(TFloat()), EVar('returnflag').with_type(TNative('char')), EVar('linestatus').with_type(TNative('char')), EVar('shipdate').with_type(TNative('uint64_t')), EVar('commitdate').with_type(TNative('uint64_t')), EVar('receiptdate').with_type(TNative('uint64_t')), EVar('shipinstruct').with_type(TString()), EVar('shipmode').with_type(TString()), EVar('comment').with_type(TString())]), funcs=OrderedDict([('div', TFunc((TFloat(), TFloat()), TFloat())), ('fmul', TFunc((TFloat(), TFloat()), TFloat())), ('int2float', TFunc((TInt(),), TFloat())), ('endswith', TFunc((TString(), TString()), TBool())), ('brand23', TFunc((), TString())), ('medbox', TFunc((), TString())), ('brass', TFunc((), TString())), ('europe', TFunc((), TString())), ('building', TFunc((), TString())), ('exampleDate1', TFunc((), TNative('uint64_t'))), ('exampleDate2', TFunc((), TNative('uint64_t'))), ('exampleDate3', TFunc((), TNative('uint64_t'))), ('exampleDate4', TFunc((), TNative('uint64_t')))])) assert can_improve(e, context=context) def test_regression28(self): e = EUnaryOp('distinct', EBinOp(EStateVar(EMap(EFilter(EVar('lineitem').with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), EBinOp(EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'shipdate').with_type(TNative('uint64_t')), '<=', ECall('exampleDate1', ()).with_type(TNative('uint64_t'))).with_type(TBool()))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), ETuple((EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'returnflag').with_type(TNative('char')), EGetField(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), 'linestatus').with_type(TNative('char')))).with_type(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char'))))), '+', EMap(ECond(EBinOp(EVar('shipdate').with_type(TNative('uint64_t')), '<=', ECall('exampleDate1', ()).with_type(TNative('uint64_t'))).with_type(TBool()), ESingleton(EMakeRecord((('orderkey', EVar('orderkey').with_type(TInt())), ('partkey', EVar('partkey').with_type(TInt())), ('suppkey', EVar('suppkey').with_type(TInt())), ('linenumber', EVar('linenumber').with_type(TInt())), ('quantity', EVar('quantity').with_type(TFloat())), ('extendedprice', EVar('extendedprice').with_type(TFloat())), ('discount', EVar('discount').with_type(TFloat())), ('tax', EVar('tax').with_type(TFloat())), ('returnflag', EVar('returnflag').with_type(TNative('char'))), ('linestatus', EVar('linestatus').with_type(TNative('char'))), ('shipdate', EVar('shipdate').with_type(TNative('uint64_t'))), ('commitdate', EVar('commitdate').with_type(TNative('uint64_t'))), ('receiptdate', EVar('receiptdate').with_type(TNative('uint64_t'))), ('shipinstruct', EVar('shipinstruct').with_type(TString())), ('shipmode', EVar('shipmode').with_type(TString())), ('comment', EVar('comment').with_type(TString())))).with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), EEmptyList().with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))))).with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), ELambda(EVar('l').with_type(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString())))), ETuple((EVar('returnflag').with_type(TNative('char')), EVar('linestatus').with_type(TNative('char')))).with_type(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char')))))).with_type(TBag(TTuple((TNative('char'), TNative('char'))))) context = RootCtx(state_vars=OrderedSet([EVar('lineitem').with_type(TBag(TRecord((('orderkey', TInt()), ('partkey', TInt()), ('suppkey', TInt()), ('linenumber', TInt()), ('quantity', TFloat()), ('extendedprice', TFloat()), ('discount', TFloat()), ('tax', TFloat()), ('returnflag', TNative('char')), ('linestatus', TNative('char')), ('shipdate', TNative('uint64_t')), ('commitdate', TNative('uint64_t')), ('receiptdate', TNative('uint64_t')), ('shipinstruct', TString()), ('shipmode', TString()), ('comment', TString()))))), EVar('orders').with_type(TBag(TRecord((('orderkey', TInt()), ('custkey', TInt()), ('orderstatus', TNative('char')), ('totalprice', TFloat()), ('orderdate', TNative('uint64_t')), ('orderpriority', TString()), ('clerk', TString()), ('shippriority', TInt()), ('comment', TString()))))), EVar('part').with_type(TBag(TRecord((('partkey', TInt()), ('name', TString()), ('mfgr', TString()), ('brand', TString()), ('part_type', TString()), ('size', TInt()), ('container', TString()), ('retailprice', TFloat()), ('comment', TString()))))), EVar('customer').with_type(TBag(TRecord((('custkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('mktsegment', TString()), ('comment', TString()))))), EVar('supplier').with_type(TBag(TRecord((('suppkey', TInt()), ('name', TString()), ('address', TString()), ('nationkey', TInt()), ('phone', TString()), ('acctbal', TFloat()), ('comment', TString()))))), EVar('partsupp').with_type(TBag(TRecord((('partkey', TInt()), ('suppkey', TInt()), ('availqty', TInt()), ('supplycost', TFloat()), ('comment', TString()))))), EVar('nation').with_type(TBag(TRecord((('nationkey', TInt()), ('name', TString()), ('regionkey', TInt()), ('comment', TString()))))), EVar('region').with_type(TBag(TRecord((('regionkey', TInt()), ('name', TString()), ('comment', TString())))))]), args=OrderedSet([EVar('orderkey').with_type(TInt()), EVar('partkey').with_type(TInt()), EVar('suppkey').with_type(TInt()), EVar('linenumber').with_type(TInt()), EVar('quantity').with_type(TFloat()), EVar('extendedprice').with_type(TFloat()), EVar('discount').with_type(TFloat()), EVar('tax').with_type(TFloat()), EVar('returnflag').with_type(TNative('char')), EVar('linestatus').with_type(TNative('char')), EVar('shipdate').with_type(TNative('uint64_t')), EVar('commitdate').with_type(TNative('uint64_t')), EVar('receiptdate').with_type(TNative('uint64_t')), EVar('shipinstruct').with_type(TString()), EVar('shipmode').with_type(TString()), EVar('comment').with_type(TString())]), funcs=OrderedDict([('div', TFunc((TFloat(), TFloat()), TFloat())), ('fmul', TFunc((TFloat(), TFloat()), TFloat())), ('int2float', TFunc((TInt(),), TFloat())), ('endswith', TFunc((TString(), TString()), TBool())), ('brand23', TFunc((), TString())), ('medbox', TFunc((), TString())), ('brass', TFunc((), TString())), ('europe', TFunc((), TString())), ('building', TFunc((), TString())), ('exampleDate1', TFunc((), TNative('uint64_t'))), ('exampleDate2', TFunc((), TNative('uint64_t'))), ('exampleDate3', TFunc((), TNative('uint64_t'))), ('exampleDate4', TFunc((), TNative('uint64_t')))])) assert can_improve(e, context=context)
2,858.503846
47,908
0.681292
82,740
743,211
5.915639
0.005717
0.119054
0.069955
0.074327
0.993405
0.992447
0.991856
0.991278
0.989981
0.989211
0
0.003001
0.046827
743,211
259
47,909
2,869.540541
0.687927
0.000496
0
0.327189
0
0
0.485123
0.096073
0.073733
0
0
0
0.138249
1
0.147465
false
0
0.064516
0
0.221198
0.082949
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
79214374e88987a960407f6c5154659aaaeb674a
7,459
py
Python
niapy/tests/test_hde.py
chinmay3/NiaPy
b4e5c0f98063e2a9eebd8d750f0922cfca88bc55
[ "MIT" ]
null
null
null
niapy/tests/test_hde.py
chinmay3/NiaPy
b4e5c0f98063e2a9eebd8d750f0922cfca88bc55
[ "MIT" ]
1
2021-08-13T07:52:40.000Z
2021-08-16T08:52:20.000Z
niapy/tests/test_hde.py
chinmay3/NiaPy
b4e5c0f98063e2a9eebd8d750f0922cfca88bc55
[ "MIT" ]
2
2021-08-08T08:29:53.000Z
2021-08-12T15:31:55.000Z
# encoding=utf8 from niapy.algorithms.modified import DifferentialEvolutionMTS, DifferentialEvolutionMTSv1, \ MultiStrategyDifferentialEvolutionMTS, MultiStrategyDifferentialEvolutionMTSv1, \ DynNpMultiStrategyDifferentialEvolutionMTS, DynNpMultiStrategyDifferentialEvolutionMTSv1, \ DynNpDifferentialEvolutionMTS, DynNpDifferentialEvolutionMTSv1 from niapy.tests.test_algorithm import AlgorithmTestCase, MyProblem class DEMTSTestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DifferentialEvolutionMTS def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class DEMTSv1TestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DifferentialEvolutionMTSv1 def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class DynNpDEMTSTestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DynNpDifferentialEvolutionMTS def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem()) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class DynNpDEMTSv1TestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DynNpDifferentialEvolutionMTSv1 def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, p_max=10, rp=3, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class MSDEMTSTestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = MultiStrategyDifferentialEvolutionMTS def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem()) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class MSDEMTSv1STestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = MultiStrategyDifferentialEvolutionMTSv1 def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class DynNpMSDEMTSTestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DynNpMultiStrategyDifferentialEvolutionMTS def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) class DynNpMSDEMTSv1TestCase(AlgorithmTestCase): def setUp(self): AlgorithmTestCase.setUp(self) self.algo = DynNpMultiStrategyDifferentialEvolutionMTSv1 def test_custom(self): ca_custom = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_customc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_custom, ca_customc, MyProblem(), max_iters=100) def test_griewank(self): ca_griewank = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) ca_griewankc = self.algo(population_size=10, num_tests=1, num_searches=2, num_enabled=2, seed=self.seed) AlgorithmTestCase.test_algorithm_run(self, ca_griewank, ca_griewankc, max_iters=100) # vim: tabstop=3 noexpandtab shiftwidth=3 softtabstop=3
54.445255
128
0.751173
1,033
7,459
5.169409
0.057115
0.059925
0.107865
0.131835
0.842884
0.842884
0.842884
0.842884
0.842884
0.748502
0
0.037973
0.145596
7,459
136
129
54.845588
0.799937
0.008982
0
0.792079
0
0
0
0
0
0
0
0
0
1
0.237624
false
0
0.019802
0
0.336634
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
8
f74160a2765945cf319970ed73c6e94e1bffa696
15,596
py
Python
src/outpost/django/typo3/migrations/0004_content.py
medunigraz/outpost.django.typo3
d3ba82189d78ecae73342707940c91ebe958a29e
[ "BSD-2-Clause" ]
null
null
null
src/outpost/django/typo3/migrations/0004_content.py
medunigraz/outpost.django.typo3
d3ba82189d78ecae73342707940c91ebe958a29e
[ "BSD-2-Clause" ]
null
null
null
src/outpost/django/typo3/migrations/0004_content.py
medunigraz/outpost.django.typo3
d3ba82189d78ecae73342707940c91ebe958a29e
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-04-22 12:52 from __future__ import unicode_literals from django.db import migrations from django.conf import settings class Migration(migrations.Migration): ops = [ ( """ CREATE FOREIGN TABLE "typo3"."content" ( uid int, pid int, tstamp bigint, crdate bigint, cruser_id int, sorting int, deleted smallint, hidden smallint, CType varchar, header varchar, bodytext text, header_link varchar, list_type varchar, tx_news_related_news int ) SERVER sqlalchemy OPTIONS ( tablename 'tt_content', db_url '{typo3}' ); """.format( typo3=settings.MULTICORN.get("typo3") ), """ DROP FOREIGN TABLE IF EXISTS "typo3"."content"; """, ), ( """ DROP MATERIALIZED VIEW IF EXISTS "public"."typo3_newsmedia"; """, """ CREATE MATERIALIZED VIEW "public"."typo3_newsmedia" AS SELECT r.uid AS id, r.uid_local AS media_id, r.uid_foreign AS news_id, CASE btrim(r.title, ' ') WHEN '' THEN NULL ELSE btrim(r.title, ' ') END AS title, CASE btrim(r.description, ' ') WHEN '' THEN NULL ELSE btrim(r.description, ' ') END AS description, CASE btrim(r.alternative, ' ') WHEN '' THEN NULL ELSE btrim(r.alternative, ' ') END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL::integer ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::int::boolean AS preview FROM typo3.news n, typo3.file_reference r WHERE r.tablenames = 'tx_news_domain_model_news' AND r.table_local = 'sys_file' AND ( r.fieldname = ANY (ARRAY['fal_media', 'fal_related_files']) ) AND r.uid_foreign = n.uid AND r.deleted = 0 AND r.hidden = 0 AND ( n.starttime = 0 OR to_timestamp(n.starttime) < now() ) AND ( n.endtime = 0 OR to_timestamp(n.endtime) > now() ) AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 0 WITH DATA; """, ), ( """ CREATE MATERIALIZED VIEW "public"."typo3_newsmedia" AS SELECT r.uid AS id, r.uid_local AS media_id, n.uid AS news_id, CASE btrim(r.title::text, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.title::text, ' '::text) END AS title, CASE btrim(r.description, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.description, ' '::text) END AS description, CASE btrim(r.alternative, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.alternative, ' '::text) END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL::integer ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::integer::boolean AS preview FROM typo3.news n, typo3.file_reference r, typo3."content" c WHERE c.tx_news_related_news = n.uid AND c.uid = r.uid_foreign AND r.tablenames = 'tt_content' AND (r.fieldname = ANY (ARRAY['assets', 'image'])) AND r.table_local = 'sys_file' AND r.deleted = 0 AND r.hidden = 0 AND (n.starttime = 0 OR to_timestamp(n.starttime::double precision) < now()) AND (n.endtime = 0 OR to_timestamp(n.endtime::double precision) > now()) AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 0 UNION ALL SELECT r.uid AS id, r.uid_local AS media_id, n.uid AS news_id, CASE btrim(r.title::text, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.title::text, ' '::text) END AS title, CASE btrim(r.description, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.description, ' '::text) END AS description, CASE btrim(r.alternative, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.alternative, ' '::text) END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL::integer ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::integer::boolean AS preview FROM typo3.news n, typo3.file_reference r WHERE r.tablenames = 'tx_news_domain_model_news' AND (r.fieldname = ANY (ARRAY['fal_media', 'fal_related_files'])) AND r.uid_foreign = n.uid AND r.table_local = 'sys_file' AND r.deleted = 0 AND r.hidden = 0 AND (n.starttime = 0 OR to_timestamp(n.starttime::double precision) < now()) AND (n.endtime = 0 OR to_timestamp(n.endtime::double precision) > now()) AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 0; """, """ DROP MATERIALIZED VIEW IF EXISTS "public"."typo3_newsmedia"; """, ), ( """ DROP MATERIALIZED VIEW IF EXISTS "public"."typo3_eventmedia"; """, """ CREATE MATERIALIZED VIEW "public"."typo3_eventmedia" AS SELECT r.uid AS id, r.uid_local AS media_id, n.uid AS event_id, CASE btrim(r.title, ' ') WHEN '' THEN NULL ELSE btrim(r.title, ' ') END AS title, CASE btrim(r.description, ' ') WHEN '' THEN NULL ELSE btrim(r.description, ' ') END AS description, CASE btrim(r.alternative, ' ') WHEN '' THEN NULL ELSE btrim(r.alternative, ' ') END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::int::boolean AS preview FROM typo3.news n, typo3.file_reference r WHERE r.tablenames = 'tx_news_domain_model_news' AND r.table_local = 'sys_file' AND ( r.fieldname = ANY (ARRAY['fal_media', 'fal_related_files']) ) AND r.uid_foreign = n.uid AND r.deleted = 0 AND r.hidden = 0 AND n.datetime <> 0 AND n.event_end <> 0 AND ( n.starttime = 0 OR to_timestamp(n.starttime) > now() ) AND ( CASE n.full_day WHEN 1 THEN to_timestamp(n.event_end) + '24:00:00'::INTERVAL ELSE to_timestamp(n.event_end) END ) > now() AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 1 WITH DATA; """, ), ( """ CREATE MATERIALIZED VIEW "public"."typo3_eventmedia" AS SELECT r.uid AS id, r.uid_local AS media_id, n.uid AS event_id, CASE btrim(r.title::text, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.title::text, ' '::text) END AS title, CASE btrim(r.description, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.description, ' '::text) END AS description, CASE btrim(r.alternative, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.alternative, ' '::text) END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL::integer ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::integer::boolean AS preview FROM typo3.news n, typo3.file_reference r, typo3.content c WHERE c.tx_news_related_news = n.uid AND c.uid = r.uid_foreign AND r.tablenames = 'tt_content' AND ( r.fieldname::text = ANY (ARRAY['assets'::text, 'image'::text]) ) AND r.table_local = 'sys_file' AND r.deleted = 0 AND r.hidden = 0 AND n.datetime <> 0 AND n.event_end <> 0 AND ( n.starttime = 0 OR to_timestamp(n.starttime::double precision) > now() ) AND CASE n.full_day WHEN 1 THEN to_timestamp(n.event_end::double precision) + '24:00:00'::interval ELSE to_timestamp(n.event_end::double precision) END > now() AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 1 UNION ALL SELECT r.uid AS id, r.uid_local AS media_id, n.uid AS event_id, CASE btrim(r.title::text, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.title::text, ' '::text) END AS title, CASE btrim(r.description, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.description, ' '::text) END AS description, CASE btrim(r.alternative, ' '::text) WHEN ''::text THEN NULL::text ELSE btrim(r.alternative, ' '::text) END AS alternative, CASE WHEN r.sys_language_uid <= 0 THEN NULL::integer ELSE r.sys_language_uid END AS language_id, r.sorting AS "order", r.showinpreview::integer::boolean AS preview FROM typo3.news n, typo3.file_reference r WHERE r.tablenames::text = 'tx_news_domain_model_news'::text AND r.table_local::text = 'sys_file'::text AND ( r.fieldname::text = ANY (ARRAY['fal_media'::text, 'fal_related_files'::text]) ) AND r.uid_foreign = n.uid AND r.deleted = 0 AND r.hidden = 0 AND n.datetime <> 0 AND n.event_end <> 0 AND ( n.starttime = 0 OR to_timestamp(n.starttime::double precision) > now()) AND CASE n.full_day WHEN 1 THEN to_timestamp(n.event_end::double precision) + '24:00:00'::interval ELSE to_timestamp(n.event_end::double precision) END > now() AND n.deleted = 0 AND n.hidden = 0 AND n.is_event = 1 WITH DATA; """, """ DROP MATERIALIZED VIEW IF EXISTS "public"."typo3_eventmedia"; """, ), ] dependencies = [("typo3", "0003_views")] operations = [ migrations.RunSQL( [forward for forward, reverse in ops], [reverse for forward, reverse in reversed(ops)], ) ]
32.559499
97
0.368684
1,350
15,596
4.137778
0.104444
0.038668
0.021482
0.032223
0.874329
0.865199
0.858575
0.856069
0.821339
0.821339
0
0.017615
0.555912
15,596
478
98
32.627615
0.788911
0.004424
0
0.171429
1
0
0.028129
0
0
0
0
0
0
1
0
false
0
0.085714
0
0.2
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
f77334d9b47a87b397c972649041bdcae204d23e
26,952
py
Python
ultracart/api/chargeback_api.py
UltraCart/rest_api_v2_sdk_python
d734ea13fabc7a57872ff68bac06861edb8fd882
[ "Apache-2.0" ]
1
2018-03-15T16:56:23.000Z
2018-03-15T16:56:23.000Z
ultracart/api/chargeback_api.py
UltraCart/rest_api_v2_sdk_python
d734ea13fabc7a57872ff68bac06861edb8fd882
[ "Apache-2.0" ]
null
null
null
ultracart/api/chargeback_api.py
UltraCart/rest_api_v2_sdk_python
d734ea13fabc7a57872ff68bac06861edb8fd882
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ UltraCart Rest API V2 UltraCart REST API Version 2 # noqa: E501 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from ultracart.api_client import ApiClient from ultracart.configuration import Configuration class ChargebackApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen """ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client @classmethod def fromApiKey(cls, apiKey, verify_ssl = True, debug = False): config = Configuration() config.api_key['x-ultracart-simple-key'] = apiKey config.debug = debug config.verify_ssl = verify_ssl api_client = ApiClient(configuration=config, header_name='X-UltraCart-Api-Version', header_value='2017-03-01') return ChargebackApi(api_client) def delete_chargeback(self, chargeback_dispute_oid, **kwargs): # noqa: E501 """Delete a chargeback # noqa: E501 Delete a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_chargeback(chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param int chargeback_dispute_oid: The chargeback_dispute_oid to delete. (required) :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_chargeback_with_http_info(chargeback_dispute_oid, **kwargs) # noqa: E501 else: (data) = self.delete_chargeback_with_http_info(chargeback_dispute_oid, **kwargs) # noqa: E501 return data def delete_chargeback_with_http_info(self, chargeback_dispute_oid, **kwargs): # noqa: E501 """Delete a chargeback # noqa: E501 Delete a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.delete_chargeback_with_http_info(chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param int chargeback_dispute_oid: The chargeback_dispute_oid to delete. (required) :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ all_params = ['chargeback_dispute_oid'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method delete_chargeback" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'chargeback_dispute_oid' is set if ('chargeback_dispute_oid' not in params or params['chargeback_dispute_oid'] is None): raise ValueError("Missing the required parameter `chargeback_dispute_oid` when calling `delete_chargeback`") # noqa: E501 collection_formats = {} path_params = {} if 'chargeback_dispute_oid' in params: path_params['chargeback_dispute_oid'] = params['chargeback_dispute_oid'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json; charset=UTF-8']) # noqa: E501 # Authentication setting auth_settings = ['ultraCartOauth', 'ultraCartSimpleApiKey'] # noqa: E501 return self.api_client.call_api( '/chargeback/chargebacks/{chargeback_dispute_oid}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ChargebackDisputeResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_chargeback_dispute(self, chargeback_dispute_oid, **kwargs): # noqa: E501 """Retrieve a chargeback # noqa: E501 Retrieves a single chargeback using the specified chargeback dispute oid. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_chargeback_dispute(chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param int chargeback_dispute_oid: The chargeback dispute oid to retrieve. (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_chargeback_dispute_with_http_info(chargeback_dispute_oid, **kwargs) # noqa: E501 else: (data) = self.get_chargeback_dispute_with_http_info(chargeback_dispute_oid, **kwargs) # noqa: E501 return data def get_chargeback_dispute_with_http_info(self, chargeback_dispute_oid, **kwargs): # noqa: E501 """Retrieve a chargeback # noqa: E501 Retrieves a single chargeback using the specified chargeback dispute oid. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_chargeback_dispute_with_http_info(chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param int chargeback_dispute_oid: The chargeback dispute oid to retrieve. (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ all_params = ['chargeback_dispute_oid', 'expand'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_chargeback_dispute" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'chargeback_dispute_oid' is set if ('chargeback_dispute_oid' not in params or params['chargeback_dispute_oid'] is None): raise ValueError("Missing the required parameter `chargeback_dispute_oid` when calling `get_chargeback_dispute`") # noqa: E501 collection_formats = {} path_params = {} if 'chargeback_dispute_oid' in params: path_params['chargeback_dispute_oid'] = params['chargeback_dispute_oid'] # noqa: E501 query_params = [] if 'expand' in params: query_params.append(('_expand', params['expand'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ultraCartOauth', 'ultraCartSimpleApiKey'] # noqa: E501 return self.api_client.call_api( '/chargeback/chargebacks/{chargeback_dispute_oid}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ChargebackDisputeResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def get_chargeback_disputes(self, **kwargs): # noqa: E501 """Retrieve chargebacks # noqa: E501 Retrieves chargebacks from the account. If no parameters are specified, all chargebacks will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_chargeback_disputes(async_req=True) >>> result = thread.get() :param async_req bool :param str order_id: Order Id :param str case_number: Case number :param str status: Status :param str expiration_dts_start: Expiration dts start :param str expiration_dts_end: Expiration dts end :param str chargeback_dts_start: Chargeback dts start :param str chargeback_dts_end: Chargeback dts end :param int limit: The maximum number of records to return on this one API call. (Max 200) :param int offset: Pagination of the record set. Offset is a zero based index. :param str since: Fetch chargebacks that have been created/modified since this date/time. :param str sort: The sort order of the chargebacks. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputesResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.get_chargeback_disputes_with_http_info(**kwargs) # noqa: E501 else: (data) = self.get_chargeback_disputes_with_http_info(**kwargs) # noqa: E501 return data def get_chargeback_disputes_with_http_info(self, **kwargs): # noqa: E501 """Retrieve chargebacks # noqa: E501 Retrieves chargebacks from the account. If no parameters are specified, all chargebacks will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_chargeback_disputes_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool :param str order_id: Order Id :param str case_number: Case number :param str status: Status :param str expiration_dts_start: Expiration dts start :param str expiration_dts_end: Expiration dts end :param str chargeback_dts_start: Chargeback dts start :param str chargeback_dts_end: Chargeback dts end :param int limit: The maximum number of records to return on this one API call. (Max 200) :param int offset: Pagination of the record set. Offset is a zero based index. :param str since: Fetch chargebacks that have been created/modified since this date/time. :param str sort: The sort order of the chargebacks. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputesResponse If the method is called asynchronously, returns the request thread. """ all_params = ['order_id', 'case_number', 'status', 'expiration_dts_start', 'expiration_dts_end', 'chargeback_dts_start', 'chargeback_dts_end', 'limit', 'offset', 'since', 'sort', 'expand'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method get_chargeback_disputes" % key ) params[key] = val del params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'order_id' in params: query_params.append(('order_id', params['order_id'])) # noqa: E501 if 'case_number' in params: query_params.append(('case_number', params['case_number'])) # noqa: E501 if 'status' in params: query_params.append(('status', params['status'])) # noqa: E501 if 'expiration_dts_start' in params: query_params.append(('expiration_dts_start', params['expiration_dts_start'])) # noqa: E501 if 'expiration_dts_end' in params: query_params.append(('expiration_dts_end', params['expiration_dts_end'])) # noqa: E501 if 'chargeback_dts_start' in params: query_params.append(('chargeback_dts_start', params['chargeback_dts_start'])) # noqa: E501 if 'chargeback_dts_end' in params: query_params.append(('chargeback_dts_end', params['chargeback_dts_end'])) # noqa: E501 if 'limit' in params: query_params.append(('_limit', params['limit'])) # noqa: E501 if 'offset' in params: query_params.append(('_offset', params['offset'])) # noqa: E501 if 'since' in params: query_params.append(('_since', params['since'])) # noqa: E501 if 'sort' in params: query_params.append(('_sort', params['sort'])) # noqa: E501 if 'expand' in params: query_params.append(('_expand', params['expand'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ultraCartOauth', 'ultraCartSimpleApiKey'] # noqa: E501 return self.api_client.call_api( '/chargeback/chargebacks', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ChargebackDisputesResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def insert_chargeback(self, chargeback, **kwargs): # noqa: E501 """Insert a chargeback # noqa: E501 Insert a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.insert_chargeback(chargeback, async_req=True) >>> result = thread.get() :param async_req bool :param ChargebackDispute chargeback: Chargeback to insert (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.insert_chargeback_with_http_info(chargeback, **kwargs) # noqa: E501 else: (data) = self.insert_chargeback_with_http_info(chargeback, **kwargs) # noqa: E501 return data def insert_chargeback_with_http_info(self, chargeback, **kwargs): # noqa: E501 """Insert a chargeback # noqa: E501 Insert a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.insert_chargeback_with_http_info(chargeback, async_req=True) >>> result = thread.get() :param async_req bool :param ChargebackDispute chargeback: Chargeback to insert (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ all_params = ['chargeback', 'expand'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method insert_chargeback" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'chargeback' is set if ('chargeback' not in params or params['chargeback'] is None): raise ValueError("Missing the required parameter `chargeback` when calling `insert_chargeback`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'expand' in params: query_params.append(('_expand', params['expand'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'chargeback' in params: body_params = params['chargeback'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json; charset=UTF-8']) # noqa: E501 # Authentication setting auth_settings = ['ultraCartOauth', 'ultraCartSimpleApiKey'] # noqa: E501 return self.api_client.call_api( '/chargeback/chargebacks', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ChargebackDisputeResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) def update_chargeback(self, chargeback, chargeback_dispute_oid, **kwargs): # noqa: E501 """Update a chargeback # noqa: E501 Update a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_chargeback(chargeback, chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param ChargebackDispute chargeback: Chargeback to update (required) :param int chargeback_dispute_oid: The chargeback_dispute_oid to update. (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.update_chargeback_with_http_info(chargeback, chargeback_dispute_oid, **kwargs) # noqa: E501 else: (data) = self.update_chargeback_with_http_info(chargeback, chargeback_dispute_oid, **kwargs) # noqa: E501 return data def update_chargeback_with_http_info(self, chargeback, chargeback_dispute_oid, **kwargs): # noqa: E501 """Update a chargeback # noqa: E501 Update a chargeback on the UltraCart account. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_chargeback_with_http_info(chargeback, chargeback_dispute_oid, async_req=True) >>> result = thread.get() :param async_req bool :param ChargebackDispute chargeback: Chargeback to update (required) :param int chargeback_dispute_oid: The chargeback_dispute_oid to update. (required) :param str expand: The object expansion to perform on the result. See documentation for examples :return: ChargebackDisputeResponse If the method is called asynchronously, returns the request thread. """ all_params = ['chargeback', 'chargeback_dispute_oid', 'expand'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') params = locals() for key, val in six.iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method update_chargeback" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'chargeback' is set if ('chargeback' not in params or params['chargeback'] is None): raise ValueError("Missing the required parameter `chargeback` when calling `update_chargeback`") # noqa: E501 # verify the required parameter 'chargeback_dispute_oid' is set if ('chargeback_dispute_oid' not in params or params['chargeback_dispute_oid'] is None): raise ValueError("Missing the required parameter `chargeback_dispute_oid` when calling `update_chargeback`") # noqa: E501 collection_formats = {} path_params = {} if 'chargeback_dispute_oid' in params: path_params['chargeback_dispute_oid'] = params['chargeback_dispute_oid'] # noqa: E501 query_params = [] if 'expand' in params: query_params.append(('_expand', params['expand'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None if 'chargeback' in params: body_params = params['chargeback'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json; charset=UTF-8']) # noqa: E501 # Authentication setting auth_settings = ['ultraCartOauth', 'ultraCartSimpleApiKey'] # noqa: E501 return self.api_client.call_api( '/chargeback/chargebacks/{chargeback_dispute_oid}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ChargebackDisputeResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats)
44.770764
261
0.644739
3,085
26,952
5.399028
0.076175
0.045149
0.070845
0.021614
0.923031
0.900636
0.89127
0.868996
0.866174
0.864193
0
0.015779
0.271075
26,952
601
262
44.845258
0.832027
0.370882
0
0.72956
1
0
0.227438
0.085257
0
0
0
0
0
1
0.037736
false
0
0.015723
0
0.106918
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
f775476598df351443f989f6efe333252fa28cf6
4,132
py
Python
ibms_project/ibms/migrations/0002_auto_20170904_1150.py
mohdbakhrayba/ibms
029e1f3bf108586289c65bb1d547f86851f9494f
[ "Apache-2.0" ]
2
2019-09-07T20:39:29.000Z
2021-09-16T12:02:16.000Z
ibms_project/ibms/migrations/0002_auto_20170904_1150.py
mohdbakhrayba/ibms
029e1f3bf108586289c65bb1d547f86851f9494f
[ "Apache-2.0" ]
11
2020-06-18T06:53:01.000Z
2022-02-11T01:55:42.000Z
ibms_project/ibms/migrations/0002_auto_20170904_1150.py
mohdbakhrayba/ibms
029e1f3bf108586289c65bb1d547f86851f9494f
[ "Apache-2.0" ]
5
2016-01-18T04:36:48.000Z
2017-09-07T06:38:28.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-09-04 03:50 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ibms', '0001_initial'), ] operations = [ migrations.AlterField( model_name='corporatestrategy', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='erservicepriority', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='generalservicepriority', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='glpivdownload', name='financialYear', field=models.CharField(db_index=True, max_length=7), ), migrations.AlterField( model_name='ibmdata', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='ncservicepriority', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='ncstrategicplan', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='outcomes', name='financialYear', field=models.CharField(db_index=True, max_length=7), ), migrations.AlterField( model_name='pvsservicepriority', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), migrations.AlterField( model_name='sfmservicepriority', name='financialYear', field=models.CharField(choices=[('2010/11', '2010/11'), ('2011/12', '2011/12'), ('2012/13', '2012/13'), ('2013/14', '2013/14'), ('2014/15', '2014/15'), ('2015/16', '2015/16'), ('2016/17', '2016/17'), ('2017/18', '2017/18'), ('2018/19', '2018/19'), ('2019/20', '2019/20')], db_index=True, max_length=100), ), ]
62.606061
316
0.549371
523
4,132
4.271511
0.135755
0.042972
0.111907
0.129812
0.838406
0.838406
0.838406
0.838406
0.838406
0.838406
0
0.302493
0.194337
4,132
65
317
63.569231
0.368579
0.016457
0
0.689655
1
0
0.349175
0.005417
0
0
0
0
0
1
0
false
0
0.034483
0
0.086207
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0
0
1
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
9
f79cbf42fda1f6dbd2a432d6ede2618fb657307d
27,065
py
Python
test/test_team_builder_config_api.py
tweak-com-public/tweak-api-client-python
019f86da11fdb12683d516f8f37db5d717380bcc
[ "Apache-2.0" ]
null
null
null
test/test_team_builder_config_api.py
tweak-com-public/tweak-api-client-python
019f86da11fdb12683d516f8f37db5d717380bcc
[ "Apache-2.0" ]
null
null
null
test/test_team_builder_config_api.py
tweak-com-public/tweak-api-client-python
019f86da11fdb12683d516f8f37db5d717380bcc
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ tweak-api Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak. OpenAPI spec version: 1.0.8-beta.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from __future__ import absolute_import import os import sys import unittest import TweakApi from TweakApi.rest import ApiException from TweakApi.apis.team_builder_config_api import TeamBuilderConfigApi class TestTeamBuilderConfigApi(unittest.TestCase): """ TeamBuilderConfigApi unit test stubs """ def setUp(self): self.api = TweakApi.apis.team_builder_config_api.TeamBuilderConfigApi() def tearDown(self): pass def test_team_builder_configs_change_stream_get(self): """ Test case for team_builder_configs_change_stream_get Create a change stream. """ pass def test_team_builder_configs_change_stream_post(self): """ Test case for team_builder_configs_change_stream_post Create a change stream. """ pass def test_team_builder_configs_count_get(self): """ Test case for team_builder_configs_count_get Count instances of the model matched by where from the data source. """ pass def test_team_builder_configs_find_one_get(self): """ Test case for team_builder_configs_find_one_get Find first instance of the model matched by filter from the data source. """ pass def test_team_builder_configs_get(self): """ Test case for team_builder_configs_get Find all instances of the model matched by filter from the data source. """ pass def test_team_builder_configs_global_get(self): """ Test case for team_builder_configs_global_get Reset Team keys """ pass def test_team_builder_configs_id_delete(self): """ Test case for team_builder_configs_id_delete Delete a model instance by {{id}} from the data source. """ pass def test_team_builder_configs_id_exists_get(self): """ Test case for team_builder_configs_id_exists_get Check whether a model instance exists in the data source. """ pass def test_team_builder_configs_id_get(self): """ Test case for team_builder_configs_id_get Find a model instance by {{id}} from the data source. """ pass def test_team_builder_configs_id_head(self): """ Test case for team_builder_configs_id_head Check whether a model instance exists in the data source. """ pass def test_team_builder_configs_id_patch(self): """ Test case for team_builder_configs_id_patch Patch attributes for a model instance and persist it into the data source. """ pass def test_team_builder_configs_id_portals_count_get(self): """ Test case for team_builder_configs_id_portals_count_get Counts portals of TeamBuilderConfig. """ pass def test_team_builder_configs_id_portals_fk_delete(self): """ Test case for team_builder_configs_id_portals_fk_delete Delete a related item by id for portals. """ pass def test_team_builder_configs_id_portals_fk_get(self): """ Test case for team_builder_configs_id_portals_fk_get Find a related item by id for portals. """ pass def test_team_builder_configs_id_portals_fk_put(self): """ Test case for team_builder_configs_id_portals_fk_put Update a related item by id for portals. """ pass def test_team_builder_configs_id_portals_get(self): """ Test case for team_builder_configs_id_portals_get Queries portals of TeamBuilderConfig. """ pass def test_team_builder_configs_id_portals_post(self): """ Test case for team_builder_configs_id_portals_post Creates a new instance in portals of this model. """ pass def test_team_builder_configs_id_product_groups_count_get(self): """ Test case for team_builder_configs_id_product_groups_count_get Counts productGroups of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_groups_fk_delete(self): """ Test case for team_builder_configs_id_product_groups_fk_delete Delete a related item by id for productGroups. """ pass def test_team_builder_configs_id_product_groups_fk_get(self): """ Test case for team_builder_configs_id_product_groups_fk_get Find a related item by id for productGroups. """ pass def test_team_builder_configs_id_product_groups_fk_put(self): """ Test case for team_builder_configs_id_product_groups_fk_put Update a related item by id for productGroups. """ pass def test_team_builder_configs_id_product_groups_get(self): """ Test case for team_builder_configs_id_product_groups_get Queries productGroups of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_groups_nk_types_count_get(self): """ Test case for team_builder_configs_id_product_groups_nk_types_count_get Counts types of ProductGroup. """ pass def test_team_builder_configs_id_product_groups_nk_types_delete(self): """ Test case for team_builder_configs_id_product_groups_nk_types_delete Deletes all types of this model. """ pass def test_team_builder_configs_id_product_groups_nk_types_fk_delete(self): """ Test case for team_builder_configs_id_product_groups_nk_types_fk_delete Delete a related item by id for types. """ pass def test_team_builder_configs_id_product_groups_nk_types_fk_get(self): """ Test case for team_builder_configs_id_product_groups_nk_types_fk_get Find a related item by id for types. """ pass def test_team_builder_configs_id_product_groups_nk_types_fk_put(self): """ Test case for team_builder_configs_id_product_groups_nk_types_fk_put Update a related item by id for types. """ pass def test_team_builder_configs_id_product_groups_nk_types_get(self): """ Test case for team_builder_configs_id_product_groups_nk_types_get Queries types of ProductGroup. """ pass def test_team_builder_configs_id_product_groups_nk_types_post(self): """ Test case for team_builder_configs_id_product_groups_nk_types_post Creates a new instance in types of this model. """ pass def test_team_builder_configs_id_product_groups_post(self): """ Test case for team_builder_configs_id_product_groups_post Creates a new instance in productGroups of this model. """ pass def test_team_builder_configs_id_product_groups_rel_fk_delete(self): """ Test case for team_builder_configs_id_product_groups_rel_fk_delete Remove the productGroups relation to an item by id. """ pass def test_team_builder_configs_id_product_groups_rel_fk_head(self): """ Test case for team_builder_configs_id_product_groups_rel_fk_head Check the existence of productGroups relation to an item by id. """ pass def test_team_builder_configs_id_product_groups_rel_fk_put(self): """ Test case for team_builder_configs_id_product_groups_rel_fk_put Add a related item by id for productGroups. """ pass def test_team_builder_configs_id_product_size_materials_count_get(self): """ Test case for team_builder_configs_id_product_size_materials_count_get Counts productSizeMaterials of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_size_materials_fk_delete(self): """ Test case for team_builder_configs_id_product_size_materials_fk_delete Delete a related item by id for productSizeMaterials. """ pass def test_team_builder_configs_id_product_size_materials_fk_get(self): """ Test case for team_builder_configs_id_product_size_materials_fk_get Find a related item by id for productSizeMaterials. """ pass def test_team_builder_configs_id_product_size_materials_fk_put(self): """ Test case for team_builder_configs_id_product_size_materials_fk_put Update a related item by id for productSizeMaterials. """ pass def test_team_builder_configs_id_product_size_materials_get(self): """ Test case for team_builder_configs_id_product_size_materials_get Queries productSizeMaterials of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_size_materials_nk_material_get(self): """ Test case for team_builder_configs_id_product_size_materials_nk_material_get Fetches belongsTo relation material. """ pass def test_team_builder_configs_id_product_size_materials_nk_pdf_color_profile_get(self): """ Test case for team_builder_configs_id_product_size_materials_nk_pdf_color_profile_get Fetches belongsTo relation pdfColorProfile. """ pass def test_team_builder_configs_id_product_size_materials_nk_size_get(self): """ Test case for team_builder_configs_id_product_size_materials_nk_size_get Fetches belongsTo relation size. """ pass def test_team_builder_configs_id_product_size_materials_nk_team_get(self): """ Test case for team_builder_configs_id_product_size_materials_nk_team_get Fetches belongsTo relation team. """ pass def test_team_builder_configs_id_product_size_materials_post(self): """ Test case for team_builder_configs_id_product_size_materials_post Creates a new instance in productSizeMaterials of this model. """ pass def test_team_builder_configs_id_product_size_materials_rel_count_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_count_get Counts productSizeMaterialsRel of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_delete(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_delete Remove the productSizeMaterials relation to an item by id. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_delete_0(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_delete_0 Delete a related item by id for productSizeMaterialsRel. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_get Find a related item by id for productSizeMaterialsRel. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_head(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_head Check the existence of productSizeMaterials relation to an item by id. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_put(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_put Add a related item by id for productSizeMaterials. """ pass def test_team_builder_configs_id_product_size_materials_rel_fk_put_0(self): """ Test case for team_builder_configs_id_product_size_materials_rel_fk_put_0 Update a related item by id for productSizeMaterialsRel. """ pass def test_team_builder_configs_id_product_size_materials_rel_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_get Queries productSizeMaterialsRel of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_size_materials_rel_nk_builder_config_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_nk_builder_config_get Fetches belongsTo relation builderConfig. """ pass def test_team_builder_configs_id_product_size_materials_rel_nk_pdf_color_profile_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_nk_pdf_color_profile_get Fetches belongsTo relation pdfColorProfile. """ pass def test_team_builder_configs_id_product_size_materials_rel_nk_product_size_material_get(self): """ Test case for team_builder_configs_id_product_size_materials_rel_nk_product_size_material_get Fetches belongsTo relation productSizeMaterial. """ pass def test_team_builder_configs_id_product_size_materials_rel_post(self): """ Test case for team_builder_configs_id_product_size_materials_rel_post Creates a new instance in productSizeMaterialsRel of this model. """ pass def test_team_builder_configs_id_product_sizes_count_get(self): """ Test case for team_builder_configs_id_product_sizes_count_get Counts productSizes of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_sizes_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_fk_delete Delete a related item by id for productSizes. """ pass def test_team_builder_configs_id_product_sizes_fk_get(self): """ Test case for team_builder_configs_id_product_sizes_fk_get Find a related item by id for productSizes. """ pass def test_team_builder_configs_id_product_sizes_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_fk_put Update a related item by id for productSizes. """ pass def test_team_builder_configs_id_product_sizes_get(self): """ Test case for team_builder_configs_id_product_sizes_get Queries productSizes of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_count_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_count_get Counts materials of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_fk_delete Delete a related item by id for materials. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_fk_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_fk_get Find a related item by id for materials. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_fk_put Update a related item by id for materials. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_get Queries materials of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_post(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_post Creates a new instance in materials of this model. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_rel_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_rel_fk_delete Remove the materials relation to an item by id. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_rel_fk_head(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_rel_fk_head Check the existence of materials relation to an item by id. """ pass def test_team_builder_configs_id_product_sizes_nk_materials_rel_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_nk_materials_rel_fk_put Add a related item by id for materials. """ pass def test_team_builder_configs_id_product_sizes_nk_pdf_color_profile_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_pdf_color_profile_get Fetches belongsTo relation pdfColorProfile. """ pass def test_team_builder_configs_id_product_sizes_nk_products_count_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_count_get Counts products of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_products_delete(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_delete Deletes all products of this model. """ pass def test_team_builder_configs_id_product_sizes_nk_products_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_fk_delete Delete a related item by id for products. """ pass def test_team_builder_configs_id_product_sizes_nk_products_fk_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_fk_get Find a related item by id for products. """ pass def test_team_builder_configs_id_product_sizes_nk_products_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_fk_put Update a related item by id for products. """ pass def test_team_builder_configs_id_product_sizes_nk_products_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_get Queries products of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_products_post(self): """ Test case for team_builder_configs_id_product_sizes_nk_products_post Creates a new instance in products of this model. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_count_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_count_get Counts sizeMaterials of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_fk_delete Delete a related item by id for sizeMaterials. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_fk_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_fk_get Find a related item by id for sizeMaterials. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_fk_put Update a related item by id for sizeMaterials. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_get Queries sizeMaterials of ProductSize. """ pass def test_team_builder_configs_id_product_sizes_nk_size_materials_post(self): """ Test case for team_builder_configs_id_product_sizes_nk_size_materials_post Creates a new instance in sizeMaterials of this model. """ pass def test_team_builder_configs_id_product_sizes_nk_type_get(self): """ Test case for team_builder_configs_id_product_sizes_nk_type_get Fetches belongsTo relation type. """ pass def test_team_builder_configs_id_product_sizes_post(self): """ Test case for team_builder_configs_id_product_sizes_post Creates a new instance in productSizes of this model. """ pass def test_team_builder_configs_id_product_sizes_rel_fk_delete(self): """ Test case for team_builder_configs_id_product_sizes_rel_fk_delete Remove the productSizes relation to an item by id. """ pass def test_team_builder_configs_id_product_sizes_rel_fk_head(self): """ Test case for team_builder_configs_id_product_sizes_rel_fk_head Check the existence of productSizes relation to an item by id. """ pass def test_team_builder_configs_id_product_sizes_rel_fk_put(self): """ Test case for team_builder_configs_id_product_sizes_rel_fk_put Add a related item by id for productSizes. """ pass def test_team_builder_configs_id_product_types_count_get(self): """ Test case for team_builder_configs_id_product_types_count_get Counts productTypes of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_types_fk_delete(self): """ Test case for team_builder_configs_id_product_types_fk_delete Delete a related item by id for productTypes. """ pass def test_team_builder_configs_id_product_types_fk_get(self): """ Test case for team_builder_configs_id_product_types_fk_get Find a related item by id for productTypes. """ pass def test_team_builder_configs_id_product_types_fk_put(self): """ Test case for team_builder_configs_id_product_types_fk_put Update a related item by id for productTypes. """ pass def test_team_builder_configs_id_product_types_get(self): """ Test case for team_builder_configs_id_product_types_get Queries productTypes of TeamBuilderConfig. """ pass def test_team_builder_configs_id_product_types_nk_group_get(self): """ Test case for team_builder_configs_id_product_types_nk_group_get Fetches belongsTo relation group. """ pass def test_team_builder_configs_id_product_types_nk_sizes_count_get(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_count_get Counts sizes of ProductType. """ pass def test_team_builder_configs_id_product_types_nk_sizes_fk_delete(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_fk_delete Delete a related item by id for sizes. """ pass def test_team_builder_configs_id_product_types_nk_sizes_fk_get(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_fk_get Find a related item by id for sizes. """ pass def test_team_builder_configs_id_product_types_nk_sizes_fk_put(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_fk_put Update a related item by id for sizes. """ pass def test_team_builder_configs_id_product_types_nk_sizes_get(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_get Queries sizes of ProductType. """ pass def test_team_builder_configs_id_product_types_nk_sizes_post(self): """ Test case for team_builder_configs_id_product_types_nk_sizes_post Creates a new instance in sizes of this model. """ pass def test_team_builder_configs_id_product_types_post(self): """ Test case for team_builder_configs_id_product_types_post Creates a new instance in productTypes of this model. """ pass def test_team_builder_configs_id_product_types_rel_fk_delete(self): """ Test case for team_builder_configs_id_product_types_rel_fk_delete Remove the productTypes relation to an item by id. """ pass def test_team_builder_configs_id_product_types_rel_fk_head(self): """ Test case for team_builder_configs_id_product_types_rel_fk_head Check the existence of productTypes relation to an item by id. """ pass def test_team_builder_configs_id_product_types_rel_fk_put(self): """ Test case for team_builder_configs_id_product_types_rel_fk_put Add a related item by id for productTypes. """ pass def test_team_builder_configs_id_put(self): """ Test case for team_builder_configs_id_put Replace attributes for a model instance and persist it into the data source. """ pass def test_team_builder_configs_id_replace_post(self): """ Test case for team_builder_configs_id_replace_post Replace attributes for a model instance and persist it into the data source. """ pass def test_team_builder_configs_id_team_get(self): """ Test case for team_builder_configs_id_team_get Fetches belongsTo relation team. """ pass def test_team_builder_configs_post(self): """ Test case for team_builder_configs_post Create a new instance of the model and persist it into the data source. """ pass if __name__ == '__main__': unittest.main()
29.676535
165
0.697506
3,611
27,065
4.734146
0.052894
0.140275
0.227435
0.236326
0.91635
0.908394
0.892776
0.879087
0.856215
0.819187
0
0.000648
0.258452
27,065
911
166
29.709111
0.851121
0.481397
0
0.473913
0
0
0.000753
0
0
0
0
0
0
1
0.478261
false
0.473913
0.030435
0
0.513043
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
11
e3955982d94f5ea725251f20460b046fab53417c
142
py
Python
gb_genome_domestication/tests/__init__.py
bioinfcomav/goldebraid
7a50c9c4e65308fb51abf4f236457d12e9d028d6
[ "Apache-2.0" ]
null
null
null
gb_genome_domestication/tests/__init__.py
bioinfcomav/goldebraid
7a50c9c4e65308fb51abf4f236457d12e9d028d6
[ "Apache-2.0" ]
null
null
null
gb_genome_domestication/tests/__init__.py
bioinfcomav/goldebraid
7a50c9c4e65308fb51abf4f236457d12e9d028d6
[ "Apache-2.0" ]
null
null
null
from test_models import * #from test_views import * from test_fixtures import * #from test_domestication import * #from test_feature import *
23.666667
33
0.802817
20
142
5.45
0.4
0.366972
0.513761
0
0
0
0
0
0
0
0
0
0.140845
142
5
34
28.4
0.893443
0.577465
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
e3cebc9fbe5bca12b0b3de8f9bbfe7b6d008c761
940
py
Python
src/instamsg/mqtt/errors.py
InstaMsg/instamsg-python
016302427cc28a31a73547a1bcdaa55cd5a3c10f
[ "MIT" ]
null
null
null
src/instamsg/mqtt/errors.py
InstaMsg/instamsg-python
016302427cc28a31a73547a1bcdaa55cd5a3c10f
[ "MIT" ]
null
null
null
src/instamsg/mqtt/errors.py
InstaMsg/instamsg-python
016302427cc28a31a73547a1bcdaa55cd5a3c10f
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- class MqttClientError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value) class MqttConnectError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value) class MqttFrameError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value) class MqttDecoderError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value) class MqttEncoderError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value) class MqttTimeoutError(Exception): def __init__(self, value=''): self.value = value def __str__(self): return repr(self.value)
25.405405
34
0.626596
105
940
5.152381
0.171429
0.299445
0.177449
0.221811
0.80037
0.80037
0.80037
0.80037
0.80037
0.80037
0
0.001416
0.248936
940
37
35
25.405405
0.764873
0.02234
0
0.8
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0.2
0.8
0
0
0
0
null
1
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
12
e3fa295684464476ad24e20e4314204f4f5759f1
158
py
Python
pl_bolts/models/vision/__init__.py
pawelkobojek/pytorch-lightning-bolts
2f3f58045a44ffb32103a3644c2ee2be920a508b
[ "Apache-2.0" ]
null
null
null
pl_bolts/models/vision/__init__.py
pawelkobojek/pytorch-lightning-bolts
2f3f58045a44ffb32103a3644c2ee2be920a508b
[ "Apache-2.0" ]
null
null
null
pl_bolts/models/vision/__init__.py
pawelkobojek/pytorch-lightning-bolts
2f3f58045a44ffb32103a3644c2ee2be920a508b
[ "Apache-2.0" ]
null
null
null
from pl_bolts.models.vision.pixel_cnn import PixelCNN from pl_bolts.models.vision.unet import UNet from pl_bolts.models.vision.segmentation import SemSegment
39.5
58
0.867089
25
158
5.32
0.48
0.135338
0.24812
0.383459
0.518797
0
0
0
0
0
0
0
0.075949
158
3
59
52.666667
0.910959
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
581e1bca526a25bcdf587464f057e0e436fc29c0
123
py
Python
pybamm/models/submodels/interface/__init__.py
jedgedrudd/PyBaMM
79c9d34978382d50e09adaf8bf74c8fa4723f759
[ "BSD-3-Clause" ]
1
2019-10-29T19:06:04.000Z
2019-10-29T19:06:04.000Z
pybamm/models/submodels/interface/__init__.py
jedgedrudd/PyBaMM
79c9d34978382d50e09adaf8bf74c8fa4723f759
[ "BSD-3-Clause" ]
null
null
null
pybamm/models/submodels/interface/__init__.py
jedgedrudd/PyBaMM
79c9d34978382d50e09adaf8bf74c8fa4723f759
[ "BSD-3-Clause" ]
null
null
null
from .base_interface import BaseInterface from . import lead_acid from . import lead_acid_oxygen from . import lithium_ion
24.6
41
0.837398
18
123
5.444444
0.555556
0.306122
0.285714
0.367347
0
0
0
0
0
0
0
0
0.130081
123
4
42
30.75
0.915888
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
5862a9c786efdef6ac9465e1e839ca1de39d6bf1
66
py
Python
example/dcgan/src/util/__init__.py
dsanno/chainer-training-template
b9edb257c37a7ef32b57c509a0e94d163391b307
[ "MIT" ]
1
2017-11-13T01:39:45.000Z
2017-11-13T01:39:45.000Z
example/dcgan/src/util/__init__.py
dsanno/chainer-training-template
b9edb257c37a7ef32b57c509a0e94d163391b307
[ "MIT" ]
null
null
null
example/dcgan/src/util/__init__.py
dsanno/chainer-training-template
b9edb257c37a7ef32b57c509a0e94d163391b307
[ "MIT" ]
null
null
null
from util import create_network from util import create_optimizer
22
33
0.878788
10
66
5.6
0.6
0.285714
0.5
0.714286
0
0
0
0
0
0
0
0
0.121212
66
2
34
33
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
587f2ab4526b2340194a6be13c30f93fcfabed5f
1,570
py
Python
pySNMP-Set.py
nunomiguellopes/PythonTCPConnection
c26460b5547911adb96845a1286960d6dfd91dde
[ "Apache-2.0" ]
null
null
null
pySNMP-Set.py
nunomiguellopes/PythonTCPConnection
c26460b5547911adb96845a1286960d6dfd91dde
[ "Apache-2.0" ]
null
null
null
pySNMP-Set.py
nunomiguellopes/PythonTCPConnection
c26460b5547911adb96845a1286960d6dfd91dde
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python3 from pysnmp.hlapi import * from pysnmp.entity.rfc3413.oneliner import cmdgen #cmdGen = cmdgen.CommandGenerator() errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), CommunityData('pri'), UdpTransportTarget(('172.16.209.233', 161)), ContextData(), ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysLocation', 0)))) # Check for errors and print out results if errorIndication: print(errorIndication) else: if errorStatus: print('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1] or '?' ) ) else: for name, val in varBinds: print('%s = %s' % (name.prettyPrint(), val.prettyPrint())) g = setCmd(SnmpEngine(), CommunityData('pri'), UdpTransportTarget(('172.16.209.233', 161)), ContextData(), ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysLocation', 0), 'Test Linux i386')) next(g) errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), CommunityData('pri'), UdpTransportTarget(('172.16.209.233', 161)), ContextData(), ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysLocation', 0)))) if errorIndication: print(errorIndication) else: if errorStatus: print('%s at %s' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1] or '?' ) ) else: for name, val in varBinds: print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
28.035714
80
0.621656
157
1,570
6.216561
0.363057
0.02459
0.079918
0.135246
0.834016
0.834016
0.834016
0.834016
0.834016
0.834016
0
0.048053
0.23121
1,570
55
81
28.545455
0.760563
0.057962
0
0.795455
0
0
0.109079
0
0
0
0
0
0
1
0
false
0
0.045455
0
0.045455
0.136364
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
5465efa709ad8b2f6f20a52e3efba66f94d755fa
243
py
Python
temboo/core/Library/Parse/GeoPoints/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
7
2016-03-07T02:07:21.000Z
2022-01-21T02:22:41.000Z
temboo/core/Library/Parse/GeoPoints/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
null
null
null
temboo/core/Library/Parse/GeoPoints/__init__.py
jordanemedlock/psychtruths
52e09033ade9608bd5143129f8a1bfac22d634dd
[ "Apache-2.0" ]
8
2016-06-14T06:01:11.000Z
2020-04-22T09:21:44.000Z
from temboo.Library.Parse.GeoPoints.GeoPoint import GeoPoint, GeoPointInputSet, GeoPointResultSet, GeoPointChoreographyExecution from temboo.Library.Parse.GeoPoints.Query import Query, QueryInputSet, QueryResultSet, QueryChoreographyExecution
81
128
0.884774
22
243
9.772727
0.636364
0.093023
0.15814
0.204651
0.288372
0
0
0
0
0
0
0
0.057613
243
2
129
121.5
0.938865
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
49b502f6bf9afc0b6f3a4c3df18f489fc992d0f8
4,153
py
Python
Video_to_Image.py
Neutrino3316/First-Impression
00b7cebe8391c7c30b36de9c4ce5d9732daaf34d
[ "MIT" ]
24
2018-12-07T13:53:37.000Z
2022-01-11T11:54:34.000Z
Video_to_Image.py
Neutrino3316/First-Impression
00b7cebe8391c7c30b36de9c4ce5d9732daaf34d
[ "MIT" ]
6
2018-02-27T09:28:57.000Z
2020-09-08T15:37:56.000Z
Video_to_Image.py
Neutrino3316/First-Impression
00b7cebe8391c7c30b36de9c4ce5d9732daaf34d
[ "MIT" ]
21
2018-05-25T10:56:44.000Z
2022-02-24T08:06:24.000Z
''' Extract all the 6 training zipped files and 2 validation zipped files into data folder and then run this script ''' import cv2 import numpy as np import os import zipfile ## Runnin a loop throught all the zipped training file to extract all video and then extract 100 frames from each. for i in range(1,76): if i<10: zipfilename = 'training80_0'+str(i)+'.zip' else: zipfilename = 'training80_'+str(i)+'.zip' ## Accessing the zipfile i archive = zipfile.ZipFile('data/'+zipfilename, 'r') zipfilename = zipfilename.split('.zip')[0] ##Extracting all videos in it and saving it all to the new folder with same name as zipped one archive.extractall('unzippedData/'+zipfilename) ## Running a loop over all the videos in the zipped file and extracting 100 frames from each for file_name in archive.namelist(): cap = cv2.VideoCapture('unzippedData/'+zipfilename+'/'+file_name) file_name=(file_name.split('.mp4'))[0] ## Creating folder to save all the 100 frames from the video try: if not os.path.exists('ImageData/trainingData/'+file_name): os.makedirs('ImageData/trainingData/'+file_name) except OSError: print ('Error: Creating directory of data') ## Setting the frame limit to 100 cap.set(cv2.CAP_PROP_FRAME_COUNT, 101) length=101 count=0 ## Running a loop to each frame and saving it in the created folder while(cap.isOpened()): count+=1 if length==count: break ret, frame = cap.read() if frame is None: continue ## Resizing it to 256*256 to save the disk space and fit into the model frame = cv2.resize(frame,(256, 256), interpolation = cv2.INTER_CUBIC) # Saves image of the current frame in jpg file name = 'ImageData/trainingData/'+str(file_name)+'/frame' + str(count) + '.jpg' cv2.imwrite(name, frame) if cv2.waitKey(1) & 0xFF == ord('q'): break ## Print the file which is done print (zipfilename, ':', file_name) # for i in range(1,26): if i<10: zipfilename = 'validation80_0'+str(i)+'.zip' else: zipfilename = 'validation80_'+str(i)+'.zip' ## Accessing the zipfile i archive = zipfile.ZipFile('data/'+zipfilename, 'r') zipfilename = zipfilename.split('.zip')[0] ##Extracting all videos in it and saving it all to the new folder with same name as zipped one archive.extractall('unzippedData/'+zipfilename) ## Running a loop over all the videos in the zipped file and extracting 100 frames from each for file_name in archive.namelist(): cap = cv2.VideoCapture('unzippedData/'+zipfilename+'/'+file_name) file_name=(file_name.split('.mp4'))[0] ## Creating folder to save all the 100 frames from the video try: if not os.path.exists('ImageData/validationData/'+file_name): os.makedirs('ImageData/validationData/'+file_name) except OSError: print ('Error: Creating directory of data') ## Setting the frame limit to 100 cap.set(cv2.CAP_PROP_FRAME_COUNT, 101) length=101 count=0 ## Running a loop to each frame and saving it in the created folder while(cap.isOpened()): count+=1 if length==count: break ret, frame = cap.read() if frame is None: continue ## Resizing it to 256*256 to save the disk space and fit into the model frame = cv2.resize(frame,(256, 256), interpolation = cv2.INTER_CUBIC) # Saves image of the current frame in jpg file name = 'ImageData/validationData/'+str(file_name)+'/frame' + str(count) + '.jpg' cv2.imwrite(name, frame) if cv2.waitKey(1) & 0xFF == ord('q'): break ## Print the file which is done print (zipfilename, ':', file_name)
38.453704
114
0.603419
542
4,153
4.571956
0.232472
0.058111
0.026231
0.025827
0.85109
0.812752
0.794189
0.794189
0.794189
0.794189
0
0.036326
0.297375
4,153
107
115
38.813084
0.812886
0.296171
0
0.764706
0
0
0.132685
0.050017
0
0
0.002779
0
0
1
0
false
0
0.058824
0
0.058824
0.058824
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
b7361411c54e139db4716426fa7c71a8d8b6eac5
93
py
Python
eod/plugins/__init__.py
feixiang7701/EOD
0138d0cefb706f64ccaea93d87ed0fe88d2fcebe
[ "Apache-2.0" ]
1
2021-11-24T09:32:27.000Z
2021-11-24T09:32:27.000Z
eod/plugins/__init__.py
jinfagang/EOD
a45b74430070d82d9248a10fb5e1116bb7ababe1
[ "Apache-2.0" ]
null
null
null
eod/plugins/__init__.py
jinfagang/EOD
a45b74430070d82d9248a10fb5e1116bb7ababe1
[ "Apache-2.0" ]
null
null
null
from .yolox import * # noqa from .yolov5 import * # noqa from .classification import * # noqa
31
36
0.72043
12
93
5.583333
0.5
0.447761
0.41791
0
0
0
0
0
0
0
0
0.013158
0.182796
93
3
36
31
0.868421
0.150538
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
3fb27cb0940e0ef7d29c740fff15f87d96f70c11
12,054
py
Python
base-LASED/LASED/time_evolution.py
mvpmanish/LASED
7793037b3e77ee9205f631d7ff6c511895108400
[ "MIT" ]
7
2021-06-07T14:58:01.000Z
2022-03-24T18:08:13.000Z
base-LASED/LASED/.ipynb_checkpoints/time_evolution-checkpoint.py
mvpmanish/LASED
7793037b3e77ee9205f631d7ff6c511895108400
[ "MIT" ]
13
2021-06-07T14:15:54.000Z
2022-03-29T11:06:10.000Z
base-LASED/LASED/time_evolution.py
mvpmanish/LASED
7793037b3e77ee9205f631d7ff6c511895108400
[ "MIT" ]
2
2021-12-09T06:31:23.000Z
2022-03-18T17:29:48.000Z
''' This file contains the function to calculate the time evolution of the density matrix for an atomic system interacting with a laser. ''' from LASED.constants import * from LASED.detuning import * from LASED.half_rabi_freq import * from LASED.matrix_methods import * from LASED.time_evolution_matrix import * import numpy as np import scipy.linalg as la def timeEvolution(n, E, G, Q, Q_decay, tau, laser_intensity, laser_wavelength, time, rho0, rho_output, tau_f = None, detuning = None, rabi_scaling = None, rabi_factors = None, print_eq = None, pretty_print_eq = None, atomic_velocity = None): """Calculates the time evolution of a laser-atom system. Uses a flattened density matrix rho0 and calculates the time evolution over the time specified. The density matrix at each time step is stored in rho_output. """ rabi = halfRabiFreq(laser_intensity, tau, laser_wavelength) A = timeEvolutionMatrix(n, E, G, Q, Q_decay, tau, laser_wavelength, laser_intensity, tau_f = tau_f, detuning = detuning, rabi_scaling = rabi_scaling, rabi_factors = rabi_factors, symbolic_print = pretty_print_eq, numeric_print = print_eq, atomic_velocity = atomic_velocity) # Compute the diagonalised matrix D and matrix of eigenvectors V D = diagonalise(A) V = matrixOfEigenvec(A) f = np.dot(la.inv(V), rho0) # Compute V^-1*rho(0) # Calculate the exponential for position, t in enumerate(time, start = 0): # Use expm() which computes the matrix exponential using the Pade approximation expS = la.expm(D*t) # Compute exp(D*t), this takes the longest so needs speeding up VexpDt = np.dot(V, expS) rho_t = np.dot(VexpDt, f) # Append density matrix elements # rho(t)_ee for e in E: for ep in E: rho_output[index(e, ep, n)][position] = rho_t[index(e, ep, n), 0] # rho(t)_gg for g in G: for gp in G: rho_output[index(g, gp, n)][position] = rho_t[index(g, gp, n), 0] # rho(t)_eg for e in E: for g in G: rho_output[index(e, g, n)][position] = rho_t[index(e, g, n), 0] #rho(t)_ge for g in G: for e in E: rho_output[index(g, e, n)][position] = rho_t[index(g, e, n), 0] def timeEvolutionDopplerAveraging(n, E, G, Q, Q_decay, tau, laser_intensity, laser_wavelength, doppler_width, doppler_detunings, time, rho0, rho_output, tau_f = None, detuning = None, rabi_scaling = None, rabi_factors = None, print_eq = None, pretty_print_eq = None, atomic_velocity = None): """Calculates the time evolution of a laser-atom system with a Gaussian doppler profile for the atoms. Uses a flattened density matrix rho0 and calculates the time evolution over the time specified. The density matrix at each time step is stored in rho_output. """ if(print_eq or pretty_print_eq != None): print("Cannot print equations when beam profile or doppler averaging!") print_eq = None pretty_print_eq = None # Calculate doppler_spacing d_doppler = abs(doppler_detunings[1] - doppler_detunings[0]) doppler_factor = d_doppler/(np.sqrt(2*PI*doppler_width*doppler_width)) for doppler_delta in doppler_detunings: # Calculate the half-rabi frequency rabi = halfRabiFreq(laser_intensity, tau, laser_wavelength) A = timeEvolutionMatrix(n, E, G, Q, Q_decay, tau, laser_wavelength, laser_intensity, tau_f = tau_f, detuning = detuning, rabi_scaling = rabi_scaling, rabi_factors = rabi_factors, symbolic_print = pretty_print_eq, numeric_print = print_eq, atomic_velocity = atomic_velocity) # Compute the diagonalised matrix D and matrix of eigenvectors V D = diagonalise(A) V = matrixOfEigenvec(A) f = np.dot(la.inv(V), rho0) # Compute V^-1*rho(0) # Calculate the exponential for position, t in enumerate(time, start = 0): # Use expm() which computes the matrix exponential using the Pade approximation VexpDt = np.dot(V, la.expm(D*t)) # Can I make this is faster? rho_t = np.dot(VexpDt, f) # Append density matrix for each ring and each detuning fraction # rho(t)_ee for e in E: for ep in E: rho_output[index(e, ep, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(rho_t[index(e, ep, n), 0]) # rho(t)_gg for g in G: for gp in G: rho_output[index(g, gp, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(rho_t[index(g, gp, n), 0]) # rho(t)_eg for e in E: for g in G: rho_output[index(e, g, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(rho_t[index(e, g, n), 0]) #rho(t)_ge for g in G: for e in E: rho_output[index(g, e, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(rho_t[index(e, g, n), 0]) def timeEvolutionGaussianAveraging(n, E, G, Q, Q_decay, tau, laser_power, r_sigma, n_intensity, laser_wavelength, time, rho0, rho_output, tau_f = None, detuning = None, rabi_scaling = None, rabi_factors = None, print_eq = None, pretty_print_eq = None, atomic_velocity = None): """Calculates the time evolution of a laser-atom system with a Gaussian laser beam profile. Uses a flattened density matrix rho0 and calculates the time evolution over the time specified. The density matrix at each time step is stored in rho_output. """ if(print_eq or pretty_print_eq != None): print("Cannot print equations when beam profile or doppler averaging!") print_eq = None pretty_print_eq = None # Create rings of laser beam to integrate populations over R = np.linspace(r_sigma, 3*r_sigma, n_intensity) for k, r in enumerate(R, start = 0): # Calculate the half-rabi frequency laser_intensity = gaussianIntensity(laser_power, r_sigma, r) rabi = halfRabiFreq(laser_intensity, tau, laser_wavelength) A = timeEvolutionMatrix(n, E, G, Q, Q_decay, tau, laser_wavelength, laser_intensity, tau_f = tau_f, rabi_scaling = rabi_scaling, rabi_factors = rabi_factors, detuning = detuning, symbolic_print = pretty_print_eq, numeric_print = print_eq, atomic_velocity = atomic_velocity) # Compute the diagonalised matrix D and matrix of eigenvectors V D = diagonalise(A) V = matrixOfEigenvec(A) f = np.dot(la.inv(V), rho0) # Compute V^-1*rho(0) # Calculate the exponential for position, t in enumerate(time, start = 0): # Use expm() which computes the matrix exponential using the Pade approximation VexpDt = np.dot(V, la.expm(D*t)) # Can I make this faster? rho_t = np.dot(VexpDt, f) # Append density matrix for each ring # rho(t)_ee for e in E: for ep in E: rho_output[index(e, ep, n)][position] += (2*k+1)*(rho_t[index(e, ep, n), 0])/(n_intensity*n_intensity) # rho(t)_gg for g in G: for gp in G: rho_output[index(g, gp, n)][position] += (2*k+1)*(rho_t[index(g, gp, n), 0])/(n_intensity*n_intensity) # rho(t)_eg for e in E: for g in G: rho_output[index(e, g, n)][position] += (2*k+1)*(rho_t[index(e, g, n), 0])/(n_intensity*n_intensity) #rho(t)_ge for g in G: for e in E: rho_output[index(g, e, n)][position] += (2*k+1)*(rho_t[index(e, g, n), 0])/(n_intensity*n_intensity) def timeEvolutionGaussianAndDopplerAveraging(n, E, G, Q, Q_decay, tau, laser_power, r_sigma, n_intensity, laser_wavelength, doppler_width, doppler_detunings, time, rho0, rho_output, tau_f = None, detuning = None, rabi_scaling = None, rabi_factors = None, print_eq = None, pretty_print_eq = None, atomic_velocity = None): """Calculates the time evolution of a laser-atom system with a Gaussian doppler profile for the atoms and a Gaussian laser beam profile. Uses a flattened density matrix rho0 and calculates the time evolution over the time specified. The density matrix at each time step is stored in rho_output. """ if(print_eq or pretty_print_eq != None): print("Cannot print equations when beam profile or doppler averaging!") print_eq = None pretty_print_eq = None # Create rings of laser beam to integrate populations over R = np.linspace(r_sigma, 3*r_sigma, n_intensity) # Calculate doppler_spacing d_doppler = abs(doppler_detunings[1] - doppler_detunings[0]) doppler_factor = d_doppler/(np.sqrt(2*PI*doppler_width*doppler_width)) for doppler_delta in doppler_detunings: for k, r in enumerate(R, start = 0): # Calculate the half-rabi frequency laser_intensity = gaussianIntensity(laser_power, r_sigma, r) rabi = halfRabiFreq(laser_intensity, tau, laser_wavelength) A = timeEvolutionMatrix(n, E, G, Q, Q_decay, tau, laser_wavelength, laser_intensity, tau_f = tau_f, rabi_scaling = rabi_scaling, rabi_factors = rabi_factors, detuning = detuning, symbolic_print = pretty_print_eq, numeric_print = print_eq, atomic_velocity = atomic_velocity) # Compute the diagonalised matrix D and matrix of eigenvectors V D = diagonalise(A) V = matrixOfEigenvec(A) f = np.dot(la.inv(V), rho0) # Compute V^-1*rho(0) # Calculate the exponential for position, t in enumerate(time, start = 0): # Use expm() which computes the matrix exponential using the Pade approximation VexpDt = np.dot(V, la.expm(D*t)) # Can I make this faster? rho_t = np.dot(VexpDt, f) # Append density matrix for each ring and each detuning fraction # rho(t)_ee for e in E: for ep in E: rho_output[index(e, ep, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(2*k+1)*(rho_t[index(e, ep, n), 0])/(n_intensity*n_intensity) # rho(t)_gg for g in G: for gp in G: rho_output[index(g, gp, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(2*k+1)*(rho_t[index(g, gp, n), 0])/(n_intensity*n_intensity) # rho(t)_eg for e in E: for g in G: rho_output[index(e, g, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(2*k+1)*(rho_t[index(e, g, n), 0])/(n_intensity*n_intensity) #rho(t)_ge for g in G: for e in E: rho_output[index(g, e, n)][position] += doppler_factor*np.exp(-np.power(doppler_delta/doppler_width, 2)/2)*(2*k+1)*(rho_t[index(e, g, n), 0])/(n_intensity*n_intensity)
53.336283
320
0.593496
1,672
12,054
4.114234
0.092703
0.020933
0.027184
0.012211
0.927606
0.92339
0.921936
0.921936
0.921936
0.916848
0
0.00988
0.311432
12,054
226
321
53.336283
0.818916
0.219927
0
0.773438
0
0
0.020082
0
0
0
0
0
0
1
0.03125
false
0
0.054688
0
0.085938
0.1875
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3fe07564fa477b598f55d5bbbfe925b19642200b
23,173
py
Python
test/dsklayout/graph/edgesTests.py
ptomulik/dsklayout
e90c50724a144a2ce5bfb180d38e550943350d10
[ "Unlicense" ]
null
null
null
test/dsklayout/graph/edgesTests.py
ptomulik/dsklayout
e90c50724a144a2ce5bfb180d38e550943350d10
[ "Unlicense" ]
null
null
null
test/dsklayout/graph/edgesTests.py
ptomulik/dsklayout
e90c50724a144a2ce5bfb180d38e550943350d10
[ "Unlicense" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf8 -*- import unittest import dsklayout.graph.edges_ as edges_ class Test__Edges(unittest.TestCase): def test__init__0(self): edges = edges_.Edges() self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__init__1(self): edges = edges_.Edges([('s1', 't1'), ('s2', 't2')]) self.assertEqual(edges.data, {('s1','t1'): None, ('s2','t2'): None}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__2(self): edges = edges_.Edges([('s1', 't1'), ('s2', 't2'), ('s1', 't1')]) self.assertEqual(edges.data, {('s1','t1'): None, ('s2','t2'): None}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__3(self): edges = edges_.Edges([(('r1','s1'), 't1'), (('r2', 's2'), 't2')]) self.assertEqual(edges.data, {(('r1','s1'),'t1'): None, (('r2','s2'), 't2'): None}) self.assertEqual(edges.successors_dict, {('r1','s1'): set(('t1',)), ('r2', 's2'): set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set((('r1','s1'),)), 't2': set((('r2','s2'),))}) def test__init__3_data_true(self): edges = edges_.Edges([(('s1','t1'), 'E1'), (('s2', 't2'), 'E2')], data=True) self.assertEqual(edges.data, {('s1','t1'): 'E1', ('s2','t2'): 'E2'}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__3_edgedata_true(self): edges = edges_.Edges([(('s1','t1'), 'E1'), (('s2', 't2'), 'E2')], edgedata=True) self.assertEqual(edges.data, {('s1','t1'): 'E1', ('s2','t2'): 'E2'}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__3_edgedata_true_data_false(self): edges = edges_.Edges([(('s1','t1'), 'E1'), (('s2', 't2'), 'E2')], edgedata=True, data=False) self.assertEqual(edges.data, {('s1','t1'): 'E1', ('s2','t2'): 'E2'}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__4(self): edges = edges_.Edges({('s1','t1'): 'E1', ('s2','t2'): 'E2'}) self.assertEqual(edges.data, {('s1','t1'): 'E1', ('s2','t2'): 'E2'}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__4_data_false(self): edges = edges_.Edges({('r1','s1'): 't1', ('r2', 's2'): 't2'}, data=False) self.assertEqual(edges.data, {(('r1','s1'),'t1'): None, (('r2','s2'), 't2'): None}) self.assertEqual(edges.successors_dict, {('r1','s1'): set(('t1',)), ('r2', 's2'): set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set((('r1','s1'),)), 't2': set((('r2','s2'),))}) def test__init__4_edgedata_false(self): edges = edges_.Edges({('r1','s1'): 't1', ('r2', 's2'): 't2'}, edgedata=False) self.assertEqual(edges.data, {(('r1','s1'),'t1'): None, (('r2','s2'), 't2'): None}) self.assertEqual(edges.successors_dict, {('r1','s1'): set(('t1',)), ('r2', 's2'): set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set((('r1','s1'),)), 't2': set((('r2','s2'),))}) def test__init__4_edgedata_false_data_true(self): edges = edges_.Edges({('r1','s1'): 't1', ('r2', 's2'): 't2'}, edgedata=False, data=True) self.assertEqual(edges.data, {(('r1','s1'),'t1'): None, (('r2','s2'), 't2'): None}) self.assertEqual(edges.successors_dict, {('r1','s1'): set(('t1',)), ('r2', 's2'): set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set((('r1','s1'),)), 't2': set((('r2','s2'),))}) def test__init__5(self): edges = edges_.Edges({'s1': 'E1', 's2': 'E2'}) self.assertEqual(edges.data, {('s','1'): 'E1', ('s','2'): 'E2'}) self.assertEqual(edges.successors_dict, {'s': set(('1','2'))}) self.assertEqual(edges.predecessors_dict, {'1': set(('s',)), '2': set(('s',))}) def test__init__5_data_false(self): edges = edges_.Edges({'s1': 't1', 's2': 't2'}, data=False) self.assertEqual(edges.data, {('s1','t1'): None, ('s2','t2'): None}) self.assertEqual(edges.successors_dict, {'s1': set(('t1',)), 's2': set(('t2',))}) self.assertEqual(edges.predecessors_dict, {'t1': set(('s1',)), 't2': set(('s2',))}) def test__init__6(self): edges = edges_.Edges(['pq', 'rs']) # yes, quite strange, so just warn you here... self.assertEqual(edges.data, {('p','q'): None, ('r','s'): None}) def test__has_successors(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('q', 's')]) self.assertTrue(edges.has_successors('p')) self.assertTrue(edges.has_successors('q')) self.assertFalse(edges.has_successors('r')) self.assertFalse(edges.has_successors('s')) self.assertFalse(edges.has_successors('x')) def test__has_predecessors(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertFalse(edges.has_predecessors('p')) self.assertTrue(edges.has_predecessors('q')) self.assertTrue(edges.has_predecessors('r')) self.assertFalse(edges.has_predecessors('s')) self.assertFalse(edges.has_predecessors('x')) def test__has_neighbors(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertTrue(edges.has_neighbors('p')) self.assertTrue(edges.has_neighbors('q')) self.assertTrue(edges.has_neighbors('r')) self.assertTrue(edges.has_neighbors('s')) self.assertFalse(edges.has_neighbors('x')) def test__successors__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.successors('p')), set) def test__successors__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('q', 's')]) self.assertEqual(edges.successors('p'), set(('q',))) self.assertEqual(edges.successors('q'), set(('r','s'))) self.assertEqual(edges.successors('r'), set()) def test__successors__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.successors('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__predecessors__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.predecessors('q')), set) def test__predecessors__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertEqual(edges.predecessors('p'), set()) self.assertEqual(edges.predecessors('q'), set(('p',))) self.assertEqual(edges.predecessors('r'), set(('q','s'))) self.assertEqual(edges.predecessors('s'), set()) def test__predecessors__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.predecessors('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__neighbors__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.neighbors('p')), set) def test__neighbors__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertEqual(edges.neighbors('p'), set(('q',))) self.assertEqual(edges.neighbors('q'), set(('p','r'))) self.assertEqual(edges.neighbors('r'), set(('q','s'))) self.assertEqual(edges.neighbors('s'), set(('r',))) def test__neighbors__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.neighbors('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__outward__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.outward('p')), set) def test__outward__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertEqual(edges.outward('p'), set([('p','q'),])) self.assertEqual(edges.outward('q'), set([('q','r'),])) self.assertEqual(edges.outward('r'), set()) self.assertEqual(edges.outward('s'), set([('s','r'),])) def test__outward__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.outward('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__inward__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.inward('p')), set) def test__inward__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertEqual(edges.inward('p'), set()) self.assertEqual(edges.inward('q'), set([('p','q'),])) self.assertEqual(edges.inward('r'), set([('q','r'), ('s','r')])) self.assertEqual(edges.inward('s'), set()) def test__inward__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.inward('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__incident__1(self): edges = edges_.Edges([('p', 'q')]) self.assertEqual(type(edges.incident('p')), set) def test__incident__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r'), ('s', 'r')]) self.assertEqual(edges.incident('p'), set([('p','q')])) self.assertEqual(edges.incident('q'), set([('p','q'), ('q','r')])) self.assertEqual(edges.incident('r'), set([('q','r'), ('s','r')])) self.assertEqual(edges.incident('s'), set([('s','r')])) def test__incident__KeyError(self): edges = edges_.Edges([('p', 'q')]) with self.assertRaises(KeyError) as context: edges.incident('n0') self.assertEqual(repr('n0'), str(context.exception)) def test__adjacent__1(self): self.assertEqual(edges_.Edges.adjacent('p', ('p', 'q')), 'q') self.assertEqual(edges_.Edges.adjacent('q', ('p', 'q')), 'p') def test__adjacent__2(self): self.assertEqual(edges_.Edges.adjacent('p', ['p', 'q']), 'q') self.assertEqual(edges_.Edges.adjacent('q', ['p', 'q']), 'p') def test__adjacent__KeyError(self): with self.assertRaises(KeyError) as context: edges_.Edges.adjacent('r', ('p', 'q')) self.assertEqual(repr('r'), str(context.exception)) def test__adjacent__ValueError_1(self): with self.assertRaises(ValueError) as context: edges_.Edges.adjacent('r', ('p',)) ## self.assertIn("not enough values to unpack", str(context.exception)) def test__adjacent__ValueError_2(self): with self.assertRaises(ValueError) as context: edges_.Edges.adjacent('r', ('p','q','r')) ## self.assertIn("too many values to unpack", str(context.exception)) def test__contains__1(self): edges = edges_.Edges([('p', 'q'), ('q', 'r')]) self.assertIn(('p','q'), edges) self.assertIn(('q','r'), edges) def test__contains__2(self): edges = edges_.Edges([('p', 'q'), ('q', 'r')]) self.assertIn(['p','q'], edges) self.assertIn(['q','r'], edges) def test__contains__3(self): edges = edges_.Edges([('p', 'q'), ('q', 'r')]) self.assertNotIn(('p','r'), edges) self.assertNotIn(('t','q'), edges) # must not throw def test__contains__4(self): edges = edges_.Edges([('p', 'q'), ('q', 'r')]) self.assertNotIn(('p','r'), edges) self.assertNotIn(('p',), edges) # must not throw self.assertNotIn(('p','q', 'r'), edges) # must not throw def test__contains__5(self): edges = edges_.Edges({('p', 'q'): 'E1', ('q', 'r'): 'E2'}) self.assertNotIn('E1', edges) self.assertNotIn('E2', edges) def test__contains__6(self): edges = edges_.Edges([('p', 'q'), ('r', 's')]) self.assertIn('pq', edges) # yes, quite strange, so I just warn you here... self.assertIn('rs', edges) # yes, quite strange, so I just warn you here... def test__contains__7(self): edges = edges_.Edges(['pq', 'rs']) # yes, quite strange, so I just warn you here... self.assertIn('pq', edges) # yes, quite strange, so I just warn you here... self.assertIn('rs', edges) # yes, quite strange, so I just warn you here... def test__iter__(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(list(iter(edges)), list(iter(edges.data))) def test__len__(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(len(edges), 2) def test__repr__1(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(repr(edges), "Edges(%s)" % repr(edges.data)) def test__repr__2(self): edges = edges_.Edges() self.assertEqual(repr(edges), "Edges()") def test__getitem__1(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges[('p','q')],'E1') self.assertEqual(edges[('q','r')],'E2') def test__getitem__2(self): edges = edges_.Edges({('p','q'): 'E1', ('r','s'): 'E2'}) self.assertEqual(edges['pq'],'E1') self.assertEqual(edges['rs'],'E2') def test__getitem__KeyError_1(self): edges = edges_.Edges() with self.assertRaises(KeyError) as context: edges[('p', 'q')] self.assertEqual(repr(('p', 'q')), str(context.exception)) def test__getitem__KeyError_2(self): edges = edges_.Edges() with self.assertRaises(KeyError) as context: edges[['p', 'q']] self.assertEqual(repr(['p', 'q']), str(context.exception)) def test__getitem__KeyError_3(self): edges = edges_.Edges() with self.assertRaises(KeyError) as context: edges['pq'] self.assertEqual(repr('pq'), str(context.exception)) def test__getitem__KeyError_4(self): edges = edges_.Edges([('p','q'), ('q','r')]) with self.assertRaises(KeyError) as context: edges[('p',)] self.assertEqual(repr(('p',)), str(context.exception)) def test__getitem__KeyError_5(self): edges = edges_.Edges([('p','q'), ('q','r')]) with self.assertRaises(KeyError) as context: edges[('p','q','r')] self.assertEqual(repr(('p','q','r')), str(context.exception)) def test__setitem__1(self): edges = edges_.Edges({('p','q'): 'E1'}) edges[('p','q')] = '_E1_' self.assertEqual(edges.data, {('p','q'): '_E1_'}) self.assertEqual(edges.successors_dict, {'p': set(('q',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',))}) def test__setitem__2(self): edges = edges_.Edges({('p','q'): 'E1'}) edges[('p','q')] = '_E1_' edges[('q','r')] = '_E2_' self.assertEqual(edges.data, {('p','q'): '_E1_', ('q','r'): '_E2_'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__setitem__ValueError_1(self): edges = edges_.Edges() with self.assertRaises(ValueError) as context: edges[('p',)] = 'E1' ## self.assertIn("not enough values to unpack", str(context.exception)) self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__setitem__ValueError_2(self): edges = edges_.Edges() with self.assertRaises(ValueError) as context: edges[('p','q','r')] = 'E1' ## self.assertIn("too many values to unpack", str(context.exception)) self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__delitem__1(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) del edges[('p','q')] self.assertEqual(edges.data, {('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'r': set(('q',))}) def test__delitem__KeyError_1(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) with self.assertRaises(KeyError) as context: del edges[('r','p')] self.assertEqual(repr(('r','p')), str(context.exception)) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__delitem__KeyError_2(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) with self.assertRaises(KeyError) as context: del edges[('q','p')] self.assertEqual(repr(('q','p')), str(context.exception)) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__delitem__KeyError_3(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) with self.assertRaises(KeyError) as context: del edges[('p',)] self.assertEqual(repr(('p',)), str(context.exception)) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__delitem__KeyError_4(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) with self.assertRaises(KeyError) as context: del edges[('p','q','r')] self.assertEqual(repr(('p','q','r')), str(context.exception)) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__add__1(self): edges = edges_.Edges({('p','q'): 'E1'}) edges.add(('p','q'), '_E1_') edges.add(('q','r'), '_E2_') self.assertEqual(edges.data, {('p','q'): '_E1_', ('q','r'): '_E2_'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__add__2(self): edges = edges_.Edges({('p','q'): 'E1'}) edges.add(('p','q')) edges.add(('q','r')) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): None}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__add__ValueError_1(self): edges = edges_.Edges() with self.assertRaises(ValueError) as context: edges.add(('p',)) ## self.assertIn("not enough values to unpack", str(context.exception)) self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__add__ValueError_2(self): edges = edges_.Edges() with self.assertRaises(ValueError) as context: edges.add(('p','q','r')) ## self.assertIn("too many values to unpack", str(context.exception)) self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__discard__1(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) edges.discard(('p','q')) self.assertEqual(edges.data, {('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'r': set(('q',))}) def test__discard__2(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) edges.discard(('r','p')) self.assertEqual(edges.data, {('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__clear(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) edges.clear() self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__items(self): edges = edges_.Edges({('p','q'): 'E1', ('q','r'): 'E2'}) self.assertEqual(list(edges.items()), list(edges.data.items())) def test__del_incident__1(self): edges = edges_.Edges([('p','q'), ('q','r'), ('s', 'q')]) edges.del_incident('s') self.assertEqual(edges.data, {('p','q'): None, ('q','r'): None}) self.assertEqual(edges.successors_dict, {'p': set(('q',)), 'q': set(('r',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',)), 'r': set(('q',))}) def test__del_incident__2(self): edges = edges_.Edges([('p','q'), ('q','r'), ('s', 'q')]) edges.del_incident('q') self.assertEqual(edges.data, dict()) self.assertEqual(edges.successors_dict, dict()) self.assertEqual(edges.predecessors_dict, dict()) def test__del_incident__3(self): edges = edges_.Edges([('p','q'), ('q','r'), ('s', 'r')]) edges.del_incident('r') self.assertEqual(edges.data, {('p','q'): None}) self.assertEqual(edges.successors_dict, {'p': set(('q',))}) self.assertEqual(edges.predecessors_dict, {'q': set(('p',))}) def test__del_incident__KeyError(self): edges = edges_.Edges([('p','q'), ('q','r')]) with self.assertRaises(KeyError) as context: edges.del_incident('s') self.assertEqual(repr('s'), str(context.exception)) if __name__ == '__main__': unittest.main() # vim: set ft=python et ts=4 sw=4:
46.532129
105
0.554784
2,915
23,173
4.224357
0.038079
0.127497
0.207893
0.114179
0.889475
0.828244
0.794137
0.755888
0.734124
0.720887
0
0.0207
0.199456
23,173
497
106
46.625755
0.643092
0.036681
0
0.475248
0
0
0.054801
0
0
0
0
0
0.517327
1
0.195545
false
0
0.004951
0
0.20297
0
0
0
0
null
0
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
b77acf69c9c127b7adc472210c295dabef9a7ca2
8,764
py
Python
tests/test_nodes.py
EajksEajks/pillar-python-sdk
04761f09c6783baca8e3e6f57712cef1a1e732b1
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
tests/test_nodes.py
EajksEajks/pillar-python-sdk
04761f09c6783baca8e3e6f57712cef1a1e732b1
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
tests/test_nodes.py
EajksEajks/pillar-python-sdk
04761f09c6783baca8e3e6f57712cef1a1e732b1
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
import unittest import responses import pillarsdk import pillarsdk.exceptions as sdk_exceptions mock = responses.RequestsMock(assert_all_requests_are_fired=True) class AssetNodesTests(unittest.TestCase): def setUp(self): self.endpoint = 'http://localhost:12345' self.api = pillarsdk.Api( endpoint=self.endpoint, username='', password='', token='jemoeder', ) self.project_id = 1234 @mock.activate def test_create_asset_from_file__always_new_node(self): parent_node_id = 24 * 'a' mock.add(responses.POST, '%s/nodes' % self.endpoint, json={ '_id': 24 * 'b', 'parent': parent_node_id, 'name': 'test_nodes.py', 'project': self.project_id, }, status=201) mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'ok', 'file_id': 24 * 'c', }, status=201) node = pillarsdk.Node.create_asset_from_file( project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, always_create_new_node=True, api=self.api) self.assertEqual(node['_id'], 24 * 'b') self.assertEqual(node['parent'], parent_node_id) self.assertEqual(node['name'], 'test_nodes.py') self.assertEqual(node['node_type'], 'asset') self.assertEqual(node['properties']['content_type'], 'image') self.assertEqual(node['properties']['file'], 24 * 'c') @mock.activate def test_create_asset_from_file__update_existing_node(self): parent_node_id = 24 * 'a' asset_node_id = 24 * 'b' # Uploading the file mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'ok', 'file_id': 24 * 'c', }, status=201) # Finding the existing node mock.add(responses.GET, '%s/nodes' % self.endpoint, json={'_items': [{ '_id': asset_node_id, '_etag': 'awesome-etag', 'name': 'test_nodes.py', 'node_type': 'asset', 'project': self.project_id, 'parent': parent_node_id, 'properties': { 'content_type': 'video', 'file': 24 * 'e', }} ] }) # Updating the node mock.add(responses.PUT, '%s/nodes/%s' % (self.endpoint, asset_node_id), json={'_created': 'Wed, 29 Jun 2016 14:45:35 GMT', '_deleted': False, '_etag': 'df983fb8834802be83f0f657201cbf7a3d177a9c', '_id': asset_node_id, '_status': 'OK', '_updated': 'Tue, 05 Jul 2016 14:12:27 GMT'}, status=200) node = pillarsdk.Node.create_asset_from_file( project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, api=self.api) self.assertEqual(node['_id'], asset_node_id) self.assertEqual(node['parent'], parent_node_id) self.assertEqual(node['name'], 'test_nodes.py') self.assertEqual(node['node_type'], 'asset') self.assertEqual(node['properties']['content_type'], 'image') self.assertEqual(node['properties']['file'], 24 * 'c') @mock.activate def test_create_asset_from_file__create_new_node(self): parent_node_id = 24 * 'a' asset_node_id = 24 * 'b' # Upload the file mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'ok', 'file_id': 24 * 'c', }, status=201) # Try to find whether the node exists (it doesn't). mock.add(responses.GET, '%s/nodes' % self.endpoint, json={'_items': []}) # Create a new node mock.add(responses.POST, '%s/nodes' % self.endpoint, json={ '_id': asset_node_id, 'parent': parent_node_id, 'name': 'test_nodes.py', 'project': self.project_id, }, status=201) node = pillarsdk.Node.create_asset_from_file( project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, api=self.api) self.assertEqual(node['_id'], asset_node_id) self.assertEqual(node['parent'], parent_node_id) self.assertEqual(node['name'], 'test_nodes.py') self.assertEqual(node['node_type'], 'asset') self.assertEqual(node['properties']['content_type'], 'image') self.assertEqual(node['properties']['file'], 24 * 'c') @mock.activate def test_create_asset_from_file__upload_fails(self): parent_node_id = 24 * 'a' # Upload the file mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'error', 'error': 'Internal server error' }, status=500) self.assertRaises( sdk_exceptions.ServerError, pillarsdk.Node.create_asset_from_file, project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, api=self.api) @mock.activate def test_create_asset_from_file__create_new_node_fails(self): parent_node_id = 24 * 'a' asset_node_id = 24 * 'b' # Upload the file mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'ok', 'file_id': 24 * 'c', }, status=201) # Try to find whether the node exists (it doesn't). mock.add(responses.GET, '%s/nodes' % self.endpoint, json={'_items': []}) # Create a new node, which fails mock.add(responses.POST, '%s/nodes' % self.endpoint, status=500) self.assertRaises( sdk_exceptions.ServerError, pillarsdk.Node.create_asset_from_file, project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, api=self.api) @mock.activate def test_create_asset_from_file__update_existing_node_fails(self): parent_node_id = 24 * 'a' asset_node_id = 24 * 'b' # Uploading the file mock.add(responses.POST, '%s/storage/stream/%s' % (self.endpoint, self.project_id), json={ 'status': 'ok', 'file_id': 24 * 'c', }, status=201) # Finding the existing node mock.add(responses.GET, '%s/nodes' % self.endpoint, json={'_items': [{ '_id': asset_node_id, '_etag': 'awesome-etag', 'name': 'test_nodes.py', 'node_type': 'asset', 'project': self.project_id, 'parent': parent_node_id, 'properties': { 'content_type': 'video', 'file': 24 * 'e', }} ] }) # Updating the node fails mock.add(responses.PUT, '%s/nodes/%s' % (self.endpoint, asset_node_id), status=500) self.assertRaises( sdk_exceptions.ServerError, pillarsdk.Node.create_asset_from_file, project_id=self.project_id, parent_node_id=parent_node_id, asset_type='image', filename=__file__, api=self.api)
34.101167
75
0.4911
876
8,764
4.63242
0.130137
0.059142
0.073928
0.056185
0.866683
0.86619
0.86619
0.852637
0.827501
0.827501
0
0.025319
0.391602
8,764
256
76
34.234375
0.735746
0.037426
0
0.799043
0
0
0.125148
0.004749
0
0
0
0
0.105263
1
0.033493
false
0.004785
0.019139
0
0.057416
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
b7c6a0cb107dca32c218911736f178055b60e7f0
8,911
py
Python
examples/measure_throughput.py
jethrosun/SafeBricks
290734c3f50a41dfd7bcd155d0447dd250e4fc10
[ "ISC" ]
null
null
null
examples/measure_throughput.py
jethrosun/SafeBricks
290734c3f50a41dfd7bcd155d0447dd250e4fc10
[ "ISC" ]
null
null
null
examples/measure_throughput.py
jethrosun/SafeBricks
290734c3f50a41dfd7bcd155d0447dd250e4fc10
[ "ISC" ]
null
null
null
import os import time from termcolor import colored import datetime CmdSafeBricks = { 'startdpdk': 'cd .. && ./run_dpdk.sh {num_queue} 2>/dev/null &', 'startsgx': 'cd .. && ./run_sgx.sh {task} {num_queue} 2>/dev/null &', 'killdpdk': 'sudo pkill dpdkIO', 'killsgx': 'sudo pkill sgx-runner', } CmdPktgen = { 'start': 'ssh -i /home/yangz/.ssh/id_rsa yangz@10.243.38.93 "cd ./pktgen/dpdk_zeroloss_dyn/ && bash run_netbricks.sh ../l2.conf 0.1 32 60 1 {type}"', 'kill': 'sudo pkill "ssh yangz@10.243.38.93" 2>/dev/null' } start_string = 'pkt sent, ' end_string = ' Mpps' def task_exec_reboot(task, pktgen_types, num_queue, repeat_num, throughput_res): # repeat the booting until succeeding for i in range(repeat_num): for pktgen_type in pktgen_types: while(1): fail_count_inner = 0 print "start task %s" % (task,) os.system(CmdSafeBricks['startdpdk'].format(num_queue=num_queue)) time.sleep(5) # wait for dpdk gets actually started os.system(CmdSafeBricks['startsgx'].format(task=task, num_queue=num_queue)) time.sleep(10 * num_queue) # wait for task gets actually started print "start pktgen %s" % (pktgen_type,) pktgen_results = os.popen(CmdPktgen['start'].format(type=pktgen_type)).read() print "end pktgen %s" % (pktgen_type,) print pktgen_results start_index = pktgen_results.find(start_string) + len(start_string) # this task executes error. if start_index == -1: print colored("%s %s %s fails" % (task, pktgen_type, num_queue), 'red') fail_count_inner += 1 os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(5) # wait for the port being restored. continue end_index = pktgen_results.find(end_string, start_index) if end_index == -1: print colored("%s %s %s fails" % (task, pktgen_type, num_queue), 'red') os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(5) # wait for the port being restored. fail_count_inner += 1 continue if fail_count_inner > 5: return -1 throughput_val = pktgen_results[start_index: end_index] throughput_val = float(throughput_val) start_index = pktgen_results.find("avg_latency: ") + len("avg_latency: ") end_index = pktgen_results.find(", tail_latency: ", start_index) avg_latency_val = pktgen_results[start_index: end_index] avg_latency_val = float(avg_latency_val) start_index = pktgen_results.find(", tail_latency: ") + len(", tail_latency: ") end_index = pktgen_results.find("\n", start_index) tail_latency_val = pktgen_results[start_index: end_index] tail_latency_val = float(tail_latency_val) print colored("throughput_val: %lf, avg_latency_val: %lf, tail_latency_val: %lf" % (throughput_val, avg_latency_val, tail_latency_val), 'blue') throughput_res.write(task + "," + pktgen_type + "," + str(num_queue) + "," + str(throughput_val) + "," + str(avg_latency_val) + "," + str(tail_latency_val) + "\n") throughput_res.flush() os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(10) # wait for the port being restored. break return 0 def task_exec(task, pktgen_types, num_queue, repeat_num, throughput_res): # repeat the booting until succeeding fail_count_inner = 0 test_pktgen = pktgen_types[0] while(1): print "start task %s" % (task,) os.system(CmdSafeBricks['startdpdk'].format(num_queue=num_queue)) time.sleep(5) # wait for dpdk gets actually started os.system(CmdSafeBricks['startsgx'].format(task=task, num_queue=num_queue)) time.sleep(10 * num_queue) # wait for task gets actually started print "start pktgen %s" % (test_pktgen,) pktgen_results = os.popen(CmdPktgen['start'].format(type=test_pktgen)).read() print "end pktgen %s" % (test_pktgen,) print pktgen_results start_index = pktgen_results.find(start_string) + len(start_string) # this task executes error. if start_index == -1: print colored("%s %s %s fails" % (task, test_pktgen, num_queue), 'red') fail_count_inner += 1 os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(5) # wait for the port being restored. continue end_index = pktgen_results.find(end_string, start_index) if end_index == -1: print colored("%s %s %s fails" % (task, test_pktgen, num_queue), 'red') os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(5) # wait for the port being restored. fail_count_inner += 1 continue if fail_count_inner > 5: return -1 else: break for i in range(repeat_num): for pktgen_type in pktgen_types: print "start pktgen %s" % (pktgen_type,) pktgen_results = os.popen(CmdPktgen['start'].format(type=pktgen_type)).read() print "end pktgen %s" % (pktgen_type,) print pktgen_results start_index = pktgen_results.find(start_string) + len(start_string) end_index = pktgen_results.find(end_string, start_index) throughput_val = pktgen_results[start_index: end_index] throughput_val = float(throughput_val) start_index = pktgen_results.find("avg_latency: ") + len("avg_latency: ") end_index = pktgen_results.find(", tail_latency: ", start_index) avg_latency_val = pktgen_results[start_index: end_index] avg_latency_val = float(avg_latency_val) start_index = pktgen_results.find(", tail_latency: ") + len(", tail_latency: ") end_index = pktgen_results.find("\n", start_index) tail_latency_val = pktgen_results[start_index: end_index] tail_latency_val = float(tail_latency_val) print colored("throughput_val: %lf, avg_latency_val: %lf, tail_latency_val: %lf" % (throughput_val, avg_latency_val, tail_latency_val), 'blue') throughput_res.write(task + "," + pktgen_type + "," + str(num_queue) + "," + str(throughput_val) + "," + str(avg_latency_val) + "," + str(tail_latency_val) + "\n") throughput_res.flush() os.system(CmdSafeBricks['killdpdk']) time.sleep(5) # wait for the port being restored. os.system(CmdSafeBricks['killsgx']) # os.system(CmdSafeBricks['killsgx']) time.sleep(10) # wait for the port being restored. return 0 tasks_nonreboot = [ "lpm", "maglev"] tasks_reboot = ["acl-fw", "dpi", "monitoring", "nat-tcp-v4"] pktgens = ["ICTF", "CAIDA64", "CAIDA256", "CAIDA512", "CAIDA1024"] pktgens_acl = ["ICTF_ACL", "CAIDA64_ACL", "CAIDA256_ACL", "CAIDA512_ACL", "CAIDA1024_ACL"] tasks_ipsec_nonreboot = [] tasks_ipsec_reboot = ["lpm-ipsec", "maglev-ipsec", "acl-fw-ipsec", "dpi-ipsec", "monitoring-ipsec", "nat-tcp-v4-ipsec"] pktgens_ipsec = ["ICTF_IPSEC", "CAIDA64_IPSEC", "CAIDA256_IPSEC", "CAIDA512_IPSEC", "CAIDA1024_IPSEC"] pktgens_ipsec_acl = ["ICTF_IPSEC_ACL", "CAIDA64_IPSEC_ACL", "CAIDA256_IPSEC_ACL", "CAIDA512_IPSEC_ACL", "CAIDA1024_IPSEC_ACL"] num_queues = [1, 2, 4] # num_queues = [1] # ps -ef | grep release # sudo kill -9 #### TIMES = 10 if __name__ == '__main__': now = datetime.datetime.now() throughput_res = open("./throughput-eva/throughput.txt_" + now.isoformat(), 'w') fail_cases = list() run_count = 0 fail_count = 0 for task in tasks_reboot: for num_queue in num_queues: run_count += 1 if task == "acl-fw": status = task_exec_reboot(task, pktgens_acl, num_queue, TIMES, throughput_res) else: status = task_exec_reboot(task, pktgens, num_queue, TIMES, throughput_res) if status == -1: fail_count += 1 fail_cases.append(task + " " + num_queue) for task in tasks_nonreboot: for num_queue in num_queues: run_count += 1 status = task_exec(task, pktgens, num_queue, TIMES, throughput_res) if status == -1: fail_count += 1 fail_cases.append(task + " " + num_queue) for task in tasks_ipsec_reboot: for num_queue in num_queues: run_count += 1 if task == "acl-fw-ipsec": status = task_exec_reboot(task, pktgens_ipsec_acl, num_queue, TIMES, throughput_res) else: status = task_exec_reboot(task, pktgens_ipsec, num_queue, TIMES, throughput_res) if status == -1: fail_count += 1 fail_cases.append(task + " " + num_queue) for task in tasks_ipsec_nonreboot: for num_queue in num_queues: run_count += 1 status = task_exec(task, pktgens_ipsec, num_queue, TIMES, throughput_res) if status == -1: fail_count += 1 fail_cases.append(task + " " + num_queue) print colored(("success runs: %d/%d", (run_count - fail_count), run_count), 'green') throughput_res.close()
37.441176
167
0.701493
1,268
8,911
4.671136
0.125394
0.045923
0.078001
0.052001
0.805504
0.792166
0.786932
0.780854
0.773426
0.765997
0
0.018613
0.161935
8,911
237
168
37.599156
0.774505
0.105824
0
0.714286
0
0.005495
0.181772
0.010337
0
0
0
0
0
0
null
null
0
0.021978
null
null
0.098901
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
8
b7d072b5de07bda743660c696caa611d91431f57
3,208
py
Python
tests/test_cloud_discovery.py
pyToshka/cloud-discovery
c66eb8b5c5c9a0566994fe9436abea64d57dcf99
[ "BSD-3-Clause" ]
5
2021-01-14T14:02:05.000Z
2022-01-18T10:29:00.000Z
tests/test_cloud_discovery.py
pyToshka/cloud-discovery
c66eb8b5c5c9a0566994fe9436abea64d57dcf99
[ "BSD-3-Clause" ]
null
null
null
tests/test_cloud_discovery.py
pyToshka/cloud-discovery
c66eb8b5c5c9a0566994fe9436abea64d57dcf99
[ "BSD-3-Clause" ]
1
2021-01-26T19:37:50.000Z
2021-01-26T19:37:50.000Z
def test_import_cloud_discovery(): import cloud_discovery assert cloud_discovery is not None def test_cloud_discovery_plugin_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin"]) plugin = app.plugins.get("cloud_discovery_plugin") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin) def test_cloud_discovery_plugin_azure_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_azure my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_azure"]) plugin = app.plugins.get("cloud_discovery_plugin_azure") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_azure) def test_cloud_discovery_plugin_do_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_do my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_do"]) plugin = app.plugins.get("cloud_discovery_plugin_do") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_do) def test_cloud_discovery_plugin_gce_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_gce my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_gce"]) plugin = app.plugins.get("cloud_discovery_plugin_gce") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_gce) def test_cloud_discovery_plugin_k8s_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_k8s my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_k8s"]) plugin = app.plugins.get("cloud_discovery_plugin_k8s") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_k8s) def test_cloud_discovery_plugin_li_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_linode my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_linode"]) plugin = app.plugins.get("cloud_discovery_plugin_linode") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_linode) def test_cloud_discovery_plugin_os_activation(): from cloud_discovery.applications import CLOUD_DISCOVERY_APP from cloud_discovery.plugins import cloud_discovery_plugin_os my_app = CLOUD_DISCOVERY_APP() app = my_app.app app.plugins.activate(["cloud_discovery_plugin_os"]) plugin = app.plugins.get("cloud_discovery_plugin_os") assert plugin is not None assert isinstance(plugin, cloud_discovery_plugin_os)
36.044944
69
0.794888
429
3,208
5.536131
0.060606
0.389053
0.294737
0.061895
0.925474
0.845895
0.845895
0.730947
0.730947
0.730947
0
0.001819
0.14308
3,208
88
70
36.454545
0.862132
0
0
0.424242
0
0
0.112843
0.112843
0
0
0
0
0.227273
1
0.121212
false
0
0.242424
0
0.363636
0
0
0
0
null
1
1
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
4d09c1699e331d94a1b15566f76fb30c8900bb56
1,374
py
Python
harun/src/sign.py
wangrl2016/coding
fd6cd342cade42379c4a0447d83e17c6596fd3a3
[ "MIT" ]
4
2021-02-20T03:47:48.000Z
2021-11-09T17:25:43.000Z
harun/src/sign.py
wangrl2016/coding
fd6cd342cade42379c4a0447d83e17c6596fd3a3
[ "MIT" ]
null
null
null
harun/src/sign.py
wangrl2016/coding
fd6cd342cade42379c4a0447d83e17c6596fd3a3
[ "MIT" ]
null
null
null
from src import phone def zhaoshang(device, w, h): return None def toutiao(device, w, h): phone.tap(device, w / 2, 2340) def kuaishou(device, w, h): return None def douyin(device, w, h): return None def jingdong(device, w, h): return None def fanqie(device, w, h): return None def fanchang(device, w, h): return None def kuchang(device, w, h): return None def shuqi(device, w, h): return None def yingke(device, w, h): return None def kugou(device, w, h): return None def zhongqing(device, w, h): return None def kuaiyin(device, w, h): return None def kuge(device, w, h): return None def momo(device, w, h): return None def qingtuanshe(device, w, h): return None def eleme(device, w, h): return None def changdou(device, w, h): return None def kuaikandian(device, w, h): return None def qutoutiao(device, w, h): phone.tap(device, 750, 2330) def baidu(device, w, h): phone.tap(device, 750, 2330) def weishi(device, w, h): return None def douhuo(device, w, h): return None def chejia(device, w, h): return None def uc(device, w, h): return None def diantao(device, w, h): return None def huitoutiao(device, w, h): return None def touda(device, w, h): return None def shuabao(device, w, h): return None
11.644068
34
0.622999
217
1,374
3.9447
0.202765
0.245327
0.271028
0.425234
0.734813
0.713785
0.074766
0.074766
0.074766
0
0
0.018682
0.259825
1,374
117
35
11.74359
0.823009
0
0
0.474576
0
0
0
0
0
0
0
0
0
1
0.491525
false
0
0.016949
0.440678
0.949153
0
0
0
0
null
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
7
4d1de4503d50dfe94fa82447d62a500c4564c099
2,866
py
Python
test/pyaz/afd/origin_group/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
null
null
null
test/pyaz/afd/origin_group/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
9
2021-09-24T16:37:24.000Z
2021-12-24T00:39:19.000Z
test/pyaz/afd/origin_group/__init__.py
bigdatamoore/py-az-cli
54383a4ee7cc77556f6183e74e992eec95b28e01
[ "MIT" ]
null
null
null
import json, subprocess from ... pyaz_utils import get_cli_name, get_params def show(resource_group, profile_name, origin_group_name): params = get_params(locals()) command = "az afd origin-group show " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def list(resource_group, profile_name): params = get_params(locals()) command = "az afd origin-group list " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def create(resource_group, profile_name, origin_group_name, sample_size, successful_samples_required, additional_latency_in_milliseconds, probe_request_type, probe_protocol, probe_path, probe_interval_in_seconds=None): params = get_params(locals()) command = "az afd origin-group create " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def update(resource_group, profile_name, origin_group_name, sample_size=None, successful_samples_required=None, additional_latency_in_milliseconds=None, probe_request_type=None, probe_protocol=None, probe_path=None, probe_interval_in_seconds=None): params = get_params(locals()) command = "az afd origin-group update " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr) def delete(resource_group, profile_name, origin_group_name, yes=None): params = get_params(locals()) command = "az afd origin-group delete " + params print(command) output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = output.stdout.decode("utf-8") stderr = output.stderr.decode("utf-8") if stdout: return json.loads(stdout) print(stdout) else: raise Exception(stderr) print(stderr)
38.72973
248
0.693999
359
2,866
5.392758
0.164345
0.072314
0.051653
0.061983
0.820248
0.820248
0.820248
0.782025
0.782025
0.731405
0
0.004354
0.198535
2,866
73
249
39.260274
0.838485
0
0
0.820896
0
0
0.063154
0
0
0
0
0
0
1
0.074627
false
0
0.029851
0
0.179104
0.223881
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4d3282b44a1f933060833650754908acc33d4a2f
138
py
Python
chainerrl/initializers/__init__.py
yuishihara/chainerrl
74901712a8ed8207b9d526d3f45b04bf22996b8d
[ "MIT" ]
18
2018-08-07T07:27:41.000Z
2018-08-20T01:51:21.000Z
chainerrl/initializers/__init__.py
yuishihara/chainerrl
74901712a8ed8207b9d526d3f45b04bf22996b8d
[ "MIT" ]
null
null
null
chainerrl/initializers/__init__.py
yuishihara/chainerrl
74901712a8ed8207b9d526d3f45b04bf22996b8d
[ "MIT" ]
2
2018-08-16T06:47:26.000Z
2018-08-20T01:51:22.000Z
from chainerrl.initializers.constant import VarianceScalingConstant # NOQA from chainerrl.initializers.normal import LeCunNormal # NOQA
46
75
0.855072
14
138
8.428571
0.642857
0.220339
0.423729
0
0
0
0
0
0
0
0
0
0.101449
138
2
76
69
0.951613
0.065217
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
4da81369b7479e6e6230649c6209c52601ca895e
6,086
py
Python
Multi-Net/src/MatrixTM.py
Chngzz/Dynamic-Gesture-Recognition-Based-on-FMCW
11b97e65b6f552972660b0d191eff7ec42965a2f
[ "Apache-2.0" ]
2
2021-06-29T12:09:29.000Z
2021-07-16T02:50:28.000Z
Multi-Net/src/MatrixTM.py
Chngzz/Dynamic-Gesture-Recognition-Based-on-FMCW
11b97e65b6f552972660b0d191eff7ec42965a2f
[ "Apache-2.0" ]
1
2021-12-12T10:59:53.000Z
2021-12-13T15:18:23.000Z
Multi-Net/src/MatrixTM.py
Chngzz/Dynamic-Gesture-Recognition-Based-on-FMCW
11b97e65b6f552972660b0d191eff7ec42965a2f
[ "Apache-2.0" ]
null
null
null
# app.py import tensorflow as tf import vgg import tfRecord import utils import tools import time import warnings import numpy as np warnings.filterwarnings('ignore') def evalDTM(): ''' Train the model defined ''' with tf.name_scope('input'): # train_image_batch, train_label_batch = tfRecord.createShuffleBatch('../tfRecords/train/train.DTM.tfrecords', utils.batch_size) val_image_batch, val_label_batch = tfRecord.createBatch('../tfRecords/test/test.DTM.tfrecords', 101) x = tf.placeholder(tf.float32, shape=[None, utils.img_width, utils.img_height, utils.img_channels]) y_ = tf.placeholder(tf.int16, shape = [None, utils.num_class]) logits = vgg.vgg16('inputx',x, utils.num_class, False) accuracy = tools.accuracy(logits, y_) my_global_step = tf.Variable(0, name='global_step', trainable=False) saver = tf.train.Saver() with tf.Session() as sess: saver.restore(sess, '../model/TrainDTM/model-DTM.ckpt-200') print('** my global step:{}'.format(sess.run(my_global_step))) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess,coord=coord) #time_start = time.time() try: for i in range(4): val_images, val_labels = sess.run([val_image_batch, val_label_batch]) val_logits = sess.run(logits, feed_dict={x:val_images}) print('\n -------') # val_logits = val_logits.tolist() print('type(val_logits) = ',type(val_logits)) print('val_logits:\n', np.argmax(val_logits,1)) # val_labels = val_labels.tolist() print('type(val_labels) = ',type(val_labels)) print('val_labels:\n', np.argmax(val_labels,1)) # print('** val accuracy = %.2f%% **'%(val_acc)) except tf.errors.OutOfRangeError: print('Done training -- epoch limit reached.') finally: print('In finally') coord.request_stop() coord.join(threads) def evalDTM(): ''' Train the model defined ''' with tf.name_scope('input'): # train_image_batch, train_label_batch = tfRecord.createShuffleBatch('../tfRecords/train/train.DTM.tfrecords', utils.batch_size) val_image_batch, val_label_batch = tfRecord.createBatch('../tfRecords/test/test.DTM.tfrecords', 101) x = tf.placeholder(tf.float32, shape=[None, utils.img_width, utils.img_height, utils.img_channels]) y_ = tf.placeholder(tf.int16, shape = [None, utils.num_class]) logits = vgg.vgg16('inputx',x, utils.num_class, False) accuracy = tools.accuracy(logits, y_) my_global_step = tf.Variable(0, name='global_step', trainable=False) saver = tf.train.Saver() with tf.Session() as sess: saver.restore(sess, '../model/TrainDTM/model-DTM.ckpt-200') print('** my global step:{}'.format(sess.run(my_global_step))) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess,coord=coord) #time_start = time.time() try: for i in range(4): val_images, val_labels = sess.run([val_image_batch, val_label_batch]) val_logits = sess.run(logits, feed_dict={x:val_images}) print('\n -------') # val_logits = val_logits.tolist() print('type(val_logits) = ',type(val_logits)) print('val_logits:\n', np.argmax(val_logits,1)) # val_labels = val_labels.tolist() print('type(val_labels) = ',type(val_labels)) print('val_labels:\n', np.argmax(val_labels,1)) # print('** val accuracy = %.2f%% **'%(val_acc)) except tf.errors.OutOfRangeError: print('Done training -- epoch limit reached.') finally: print('In finally') coord.request_stop() coord.join(threads) def evalDTM(): ''' Train the model defined ''' with tf.name_scope('input'): # train_image_batch, train_label_batch = tfRecord.createShuffleBatch('../tfRecords/train/train.DTM.tfrecords', utils.batch_size) val_image_batch, val_label_batch = tfRecord.createBatch('../tfRecords/test/test.DTM.tfrecords', 101) x = tf.placeholder(tf.float32, shape=[None, utils.img_width, utils.img_height, utils.img_channels]) y_ = tf.placeholder(tf.int16, shape = [None, utils.num_class]) logits = vgg.vgg16('inputx',x, utils.num_class, False) accuracy = tools.accuracy(logits, y_) my_global_step = tf.Variable(0, name='global_step', trainable=False) saver = tf.train.Saver() with tf.Session() as sess: saver.restore(sess, '../model/TrainDTM/model-DTM.ckpt-200') print('** my global step:{}'.format(sess.run(my_global_step))) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(sess=sess,coord=coord) #time_start = time.time() try: for i in range(4): val_images, val_labels = sess.run([val_image_batch, val_label_batch]) val_logits = sess.run(logits, feed_dict={x:val_images}) print('\n -------') # val_logits = val_logits.tolist() print('type(val_logits) = ',type(val_logits)) print('val_logits:\n', np.argmax(val_logits,1)) # val_labels = val_labels.tolist() print('type(val_labels) = ',type(val_labels)) print('val_labels:\n', np.argmax(val_labels,1)) # print('** val accuracy = %.2f%% **'%(val_acc)) except tf.errors.OutOfRangeError: print('Done training -- epoch limit reached.') finally: print('In finally') coord.request_stop() coord.join(threads) if __name__ == '__main__': evalDTM()
40.573333
137
0.593986
737
6,086
4.698779
0.14654
0.054577
0.031187
0.027722
0.95553
0.95553
0.95553
0.95553
0.95553
0.95553
0
0.011435
0.267171
6,086
149
138
40.845638
0.765022
0.143115
0
0.887755
0
0
0.143656
0.043157
0
0
0
0
0
1
0.030612
false
0
0.081633
0
0.112245
0.244898
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4dbd58dd284b9729b42621839573ea70a6804dae
9,167
py
Python
casbin/management_enforcer.py
nghnam/pycasbin
90ded85e352026838a69aacd7e5a36e0bb7ac763
[ "Apache-2.0" ]
null
null
null
casbin/management_enforcer.py
nghnam/pycasbin
90ded85e352026838a69aacd7e5a36e0bb7ac763
[ "Apache-2.0" ]
null
null
null
casbin/management_enforcer.py
nghnam/pycasbin
90ded85e352026838a69aacd7e5a36e0bb7ac763
[ "Apache-2.0" ]
null
null
null
from casbin.internal_enforcer import InternalEnforcer class ManagementEnforcer(InternalEnforcer): """ ManagementEnforcer = InternalEnforcer + Management API. """ def get_all_subjects(self): """gets the list of subjects that show up in the current policy.""" return self.get_all_named_subjects('p') def get_all_named_subjects(self, ptype): """gets the list of subjects that show up in the current named policy.""" return self.model.get_values_for_field_in_policy('p', ptype, 0) def get_all_objects(self): """gets the list of objects that show up in the current policy.""" return self.get_all_named_objects('p') def get_all_named_objects(self, ptype): """gets the list of objects that show up in the current named policy.""" return self.model.get_values_for_field_in_policy('p', ptype, 1) def get_all_actions(self): """gets the list of actions that show up in the current policy.""" return self.get_all_named_actions('p') def get_all_named_actions(self, ptype): """gets the list of actions that show up in the current named policy.""" return self.model.get_values_for_field_in_policy('p', ptype, 2) def get_all_roles(self): """gets the list of roles that show up in the current named policy.""" return self.get_all_named_roles('g') def get_all_named_roles(self, ptype): """gets all the authorization rules in the policy.""" return self.model.get_values_for_field_in_policy('g', ptype, 1) def get_policy(self): """gets all the authorization rules in the policy.""" return self.get_named_policy('p') def get_filtered_policy(self, field_index, *field_values): """gets all the authorization rules in the policy, field filters can be specified.""" return self.get_filtered_named_policy('p', field_index, *field_values) def get_named_policy(self, ptype): """gets all the authorization rules in the named policy.""" return self.model.get_policy('p', ptype) def get_filtered_named_policy(self, ptype, field_index, *field_values): """gets all the authorization rules in the named policy, field filters can be specified.""" return self.model.get_filtered_policy('p', ptype, field_index, *field_values) def get_grouping_policy(self): """gets all the role inheritance rules in the policy.""" return self.get_named_grouping_policy('g') def get_filtered_grouping_policy(self, field_index, *field_values): """gets all the role inheritance rules in the policy, field filters can be specified.""" return self.get_filtered_named_grouping_policy("g", field_index, *field_values) def get_named_grouping_policy(self, ptype): """gets all the role inheritance rules in the policy.""" return self.model.get_policy('g', ptype) def get_filtered_named_grouping_policy(self, ptype, field_index, *field_values): """gets all the role inheritance rules in the policy, field filters can be specified.""" return self.model.get_filtered_policy('g', ptype, field_index, *field_values) def has_policy(self, *params): """determines whether an authorization rule exists.""" return self.has_named_policy('p', *params) def has_named_policy(self, ptype, *params): """determines whether a named authorization rule exists.""" if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] return self.model.has_policy('p', ptype, str_slice) policy = [] for param in params: policy.append(param) return self.model.has_policy('p', ptype, policy) def add_policy(self, *params): """adds an authorization rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule. """ return self.add_named_policy('p', *params) def add_named_policy(self, ptype, *params): """adds an authorization rule to the current named policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule. """ if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] rule_added = self._add_policy('p', ptype, str_slice) else: policy = [] for param in params: policy.append(param) rule_added = self._add_policy('p', ptype, policy) return rule_added def remove_policy(self, *params): """removes an authorization rule from the current policy.""" return self.remove_named_policy('p', *params) def remove_filtered_policy(self, field_index, *field_values): """removes an authorization rule from the current policy, field filters can be specified.""" return self.remove_filtered_named_policy('p', field_index, *field_values) def remove_named_policy(self, ptype, *params): """removes an authorization rule from the current named policy.""" if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] rule_removed = self._remove_policy('p', ptype, str_slice) else: policy = [] for param in params: policy.append(param) rule_removed = self._remove_policy('p', ptype, policy) return rule_removed def remove_filtered_named_policy(self, ptype, field_index, *field_values): """removes an authorization rule from the current named policy, field filters can be specified.""" return self._remove_filtered_policy('p', ptype, field_index, *field_values) def has_grouping_policy(self, *params): """determines whether a role inheritance rule exists.""" return self.has_named_grouping_policy("g", *params) def has_named_grouping_policy(self, ptype, *params): """determines whether a named role inheritance rule exists.""" if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] return self.model.has_policy('g', ptype, str_slice) policy = [] for param in params: policy.append(param) return self.model.has_policy('g', ptype, policy) def add_grouping_policy(self, *params): """adds a role inheritance rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule. """ return self.add_named_grouping_policy('p', *params) def add_named_grouping_policy(self, ptype, *params): """adds a named role inheritance rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule. """ if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] rule_added = self._add_policy('g', ptype, str_slice) else: policy = [] for param in params: policy.append(param) rule_added = self._add_policy('g', ptype, policy) if self.auto_build_role_links: self.build_role_links() return rule_added def remove_grouping_policy(self, *params): """removes a role inheritance rule from the current policy.""" return self.remove_named_grouping_policy('g', *params) def remove_filtered_grouping_policy(self, field_index, *field_values): """removes a role inheritance rule from the current policy, field filters can be specified.""" return self.remove_filtered_named_grouping_policy('g', field_index, *field_values) def remove_named_grouping_policy(self, ptype, *params): """removes a role inheritance rule from the current named policy.""" if len(params) == 1 and isinstance(params[0], list): str_slice = params[0] rule_removed = self._remove_policy('g', ptype, str_slice) else: policy = [] for param in params: policy.append(param) rule_removed = self._remove_policy('g', ptype, policy) if self.auto_build_role_links: self.build_role_links() return rule_removed def remove_filtered_named_grouping_policy(self, ptype, field_index, *field_values): """removes a role inheritance rule from the current named policy, field filters can be specified.""" rule_removed = self._remove_filtered_policy('g', ptype, field_index, *field_values) if self.auto_build_role_links: self.build_role_links() return rule_removed def add_function(self, name, func): """adds a customized function.""" self.fm.add_function(name, func)
39.512931
108
0.660958
1,225
9,167
4.742041
0.075918
0.049923
0.041315
0.057841
0.898089
0.843863
0.786882
0.764331
0.7089
0.639525
0
0.003181
0.245446
9,167
231
109
39.683983
0.836634
0.298571
0
0.378151
0
0
0.006184
0
0
0
0
0
0
1
0.277311
false
0
0.008403
0
0.579832
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
8
4dd04b55b787cf75823993819e034580714e4a66
25,738
py
Python
autoencoders/internal.py
Loptt/pong-autoencoder
c5123bb2466f644f7513d807044e11a4a17aae22
[ "MIT" ]
null
null
null
autoencoders/internal.py
Loptt/pong-autoencoder
c5123bb2466f644f7513d807044e11a4a17aae22
[ "MIT" ]
1
2021-03-19T03:06:46.000Z
2021-08-02T13:29:05.000Z
autoencoders/internal.py
Loptt/pong-autoencoder
c5123bb2466f644f7513d807044e11a4a17aae22
[ "MIT" ]
null
null
null
import math import keras import numpy as np import tensorflow as tf from .perceptual_networks import PerceptualNetwork from .ball_finder import find_balls, find_balls_tf class VAEInternal(keras.Model): def __init__(self, encoder, decoder, beta=1, **kwargs): super(VAEInternal, self).__init__(**kwargs) self.encoder = encoder self.decoder = decoder self.beta = beta self.total_loss_tracker = keras.metrics.Mean(name="total_loss") self.reconstruction_loss_tracker = keras.metrics.Mean( name="reconstruction_loss" ) self.kl_loss_tracker = keras.metrics.Mean(name="kl_loss") def call(self, inputs): z_mean, z_log_var, z = self.encoder(inputs) return self.decoder(z) @property def metrics(self): return [ self.total_loss_tracker, self.reconstruction_loss_tracker, self.kl_loss_tracker, ] def train_step(self, data): if isinstance(data, tuple): data = data[0] with tf.GradientTape() as tape: z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean( tf.reduce_sum( keras.losses.binary_crossentropy(data, reconstruction), axis=(1, 2) ) ) # Calculate KL loss and total loss kl_loss = (-0.5 * self.beta) * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss # Get and propagate gradients grads = tape.gradient(total_loss, self.trainable_weights) self.optimizer.apply_gradients(zip(grads, self.trainable_weights)) # Update loss self.total_loss_tracker.update_state(total_loss) self.reconstruction_loss_tracker.update_state(reconstruction_loss) self.kl_loss_tracker.update_state(kl_loss) return { "loss": self.total_loss_tracker.result(), "reconstruction_loss": self.reconstruction_loss_tracker.result(), "kl_loss": self.kl_loss_tracker.result(), } def test_step(self, data): if isinstance(data, tuple): data = data[0] z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean( tf.reduce_sum( keras.losses.binary_crossentropy(data, reconstruction), axis=(1, 2) ) ) # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss return { "loss": total_loss, "reconstruction_loss": reconstruction_loss, "kl_loss": kl_loss, } class VAEInternalPerceptual(VAEInternal): def __init__(self, encoder, decoder, **kwargs): super().__init__(encoder, decoder, **kwargs) self.perceptual_model = PerceptualNetwork( model="VGG19", layer_amount=6, # Ignore batch size (1) and channels (-1) and add three channels at the end input_shape=tuple(list(encoder.input_shape)[1:-1] + [3]) ) def train_step(self, data): if isinstance(data, tuple): data = data[0] with tf.GradientTape() as tape: z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) rgb_reconstruction = tf.image.grayscale_to_rgb(reconstruction) rgb_data = tf.image.grayscale_to_rgb(data) perception_rec = self.perceptual_model.call( rgb_reconstruction) # shape (batch, 51200) perception_orig = self.perceptual_model.call(rgb_data) # Variable already tensor? # perception_rec = tf.constant(perception_rec) # perception_orig = tf.constant(perception_orig) diff = perception_rec - perception_orig sq_diff = tf.square(diff) # shape (batch, 51200) mean_sq_diff = tf.reduce_mean(sq_diff, axis=1) # shape (batch) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean(mean_sq_diff) # shape 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss # Get and propagate gradients grads = tape.gradient(total_loss, self.trainable_weights) self.optimizer.apply_gradients(zip(grads, self.trainable_weights)) # Update loss self.total_loss_tracker.update_state(total_loss) self.reconstruction_loss_tracker.update_state(reconstruction_loss) self.kl_loss_tracker.update_state(kl_loss) return { "loss": self.total_loss_tracker.result(), "reconstruction_loss": self.reconstruction_loss_tracker.result(), "kl_loss": self.kl_loss_tracker.result(), } def test_step(self, data): if isinstance(data, tuple): data = data[0] z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) rgb_reconstruction = tf.image.grayscale_to_rgb(reconstruction) rgb_data = tf.image.grayscale_to_rgb(data) perception_rec = self.perceptual_model.call( rgb_reconstruction) # shape (batch, 51200) perception_orig = self.perceptual_model.call(rgb_data) # Variable already tensor? # perception_rec = tf.constant(perception_rec) # perception_orig = tf.constant(perception_orig) diff = perception_rec - perception_orig sq_diff = tf.square(diff) # shape (batch, 51200) mean_sq_diff = tf.reduce_mean(sq_diff, axis=1) # shape (batch) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean(mean_sq_diff) # shape 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss return { "loss": total_loss, "reconstruction_loss": reconstruction_loss, "kl_loss": kl_loss, } def summary_perceptual(self): self.perceptual_model.summary() class VAEBallTrackInternal(keras.Model): def __init__(self, encoder, decoder, **kwargs): super(VAEBallTrackInternal, self).__init__(**kwargs) self.encoder = encoder self.decoder = decoder self.diagonal = math.sqrt( encoder.input_shape[1] ** 2 + encoder.input_shape[2] ** 2) self.total_loss_tracker = keras.metrics.Mean(name="total_loss") self.reconstruction_loss_tracker = keras.metrics.Mean( name="reconstruction_loss" ) self.kl_loss_tracker = keras.metrics.Mean(name="kl_loss") self.ball_loss_tracker = keras.metrics.Mean(name="ball_loss") self.coord_array = self.build_coordinate_array(32, 40, 40) def call(self, inputs): z_mean, z_log_var, z = self.encoder(inputs) return self.decoder(z) @property def metrics(self): return [ self.total_loss_tracker, self.reconstruction_loss_tracker, self.kl_loss_tracker, self.ball_loss_tracker ] def build_coordinate_array(self, batch_size, screen_width, screen_height): result = np.zeros((screen_height, screen_width, 2), np.float32) for x in range(screen_width): # todo: look up numpy mesh to do this faster? for y in range(screen_height): result[y, x, 0] = x result[y, x, 1] = y # should be shape [batch_size, screen_height, screen_width, 2] result = np.stack([result]*batch_size, axis=0) return tf.constant(result) def calculate_ball_loss(self, original, reconstruction): original_np = original.numpy() reconstruction_np = reconstruction.numpy() batch = len(original_np) balls_positions_orig = [] balls_positions_rec = [] for dp in original_np: balls_positions_orig.append(find_balls(dp, 5, 34)) for dp in reconstruction_np: balls_positions_rec.append(find_balls(dp, 5, 34)) loss = 0.0 for ball_poss_or, ball_poss_rec in zip(balls_positions_orig, balls_positions_rec): # In the case where no ball is present in the original, we penalize with the # maximum loss, which is the diagnoal of the screen for each ball in the reconstuction. if len(ball_poss_or) < 1: loss += self.diagonal * len(ball_poss_rec) # If there is no ball in the reconstruction, but there is a ball in the original, # apply a diagonal loss times a factor elif len(ball_poss_rec) < 1: loss += self.diagonal * 4 else: # The original only has one ball, so we retrieve that ball ball_orig = ball_poss_or[0] # We now calculate the euclidean distance of each ball to the original ball and sum # them to calculate the final loss loss += sum([math.sqrt((pos[0] - ball_orig[0]) ** 2 + (pos[1] - ball_orig[1]) ** 2) for pos in ball_poss_rec]) return loss / batch def calculate_ball_loss_slow(self, ball_locations, reconstruction): # on entry, ball locations is shape [batch, 2] example, [[original_image1_ballx,original_image1_bally],[original_image2_ballx,original_image2_bally],...] # reconstraction shape [batch, screen_height, screen_width,1]??? batch_size = ball_locations.shape[0] screen_width = reconstruction.shape[2] screen_height = reconstruction.shape[1] score = 0 for b in range(batch_size): ball_x = ball_locations[b, 0] ball_y = ball_locations[b, 1] reconstucted_image = reconstruction[b, :, :, 0] reconstucted_image_brightness = tf.reduce_sum( reconstucted_image*reconstucted_image)+1e-6 normalised_brightness_image = reconstucted_image/reconstucted_image_brightness for x in range(screen_width): for y in range(screen_height): score += normalised_brightness_image[x, y]*tf.sqrt((x-ball_x)**2+(y-ball_y)**2) return score @tf.function def calculate_ball_loss_fast(self, ball_locations, reconstruction): # on entry, ball locations is shape [batch, 2] example, [[original_image1_ballx,original_image1_bally],[original_image2_ballx,original_image2_bally],...] # reconstraction shape [batch, screen_height, screen_width,1]??? batch_size = ball_locations.shape[0] screen_width = reconstruction.shape[2] screen_height = reconstruction.shape[1] score = tf.zeros([batch_size], tf.float32) ball_x = tf.cast(ball_locations[:, 0], tf.float32) ball_y = tf.cast(ball_locations[:, 1], tf.float32) reconstucted_image = reconstruction[:, :, :, 0] # should leave us with a vector of shape [batch_size] reconstucted_image_brightness = tf.reduce_sum( reconstucted_image, axis=[1, 2])+1e-6 normalised_brightness_image = reconstucted_image / \ tf.reshape(reconstucted_image_brightness, [batch_size, 1, 1]) for x in range(5, 34): for y in range(screen_height): score += normalised_brightness_image[:, y, x]*tf.sqrt((x-ball_x)**2+(y-ball_y)**2) return tf.reduce_mean(score) # @tf.function def calculate_ball_loss_fast2(self, ball_locations, reconstruction, coordinate_array): # on entry, ball locations is shape [batch, 2] example, [[original_image1_ballx,original_image1_bally],[original_image2_ballx,original_image2_bally],...] # reconstraction shape [batch, screen_height, screen_width,1]??? # coordinate_array is shape [batch_size, screen_height, screen_width, 2] coordinate_array_temp = coordinate_array batch_size = ball_locations.shape[0] screen_width = reconstruction.shape[2] screen_height = reconstruction.shape[1] try: assert coordinate_array.shape[0] == batch_size except AssertionError: # print( # f"Batch Size {batch_size}, Coord array batch {coordinate_array.shape[0]}") coordinate_array_temp = coordinate_array[:batch_size] assert coordinate_array_temp.shape[1] == screen_height assert coordinate_array_temp.shape[2] == screen_width ball_locations_r = tf.reshape(ball_locations, [batch_size, 1, 1, 2]) relative_locations = coordinate_array_temp - \ tf.cast(ball_locations_r, tf.float32) relative_locations_squared = tf.square(relative_locations) # will work out x*x+y*y. Output shape should be [batch_size, screen_height, screen_widht) temp = tf.reduce_sum(relative_locations_squared, axis=3) # Output shape should be [batch_size, screen_height, screen_widht) pythagorean_distances = tf.sqrt(temp) # shape should be [batch_size, screen_height, screen_width) reconstructed_image = reconstruction[:, :, :, 0] # should leave us with a vector of shape [batch_size] ''' reconstucted_image_brightness = tf.reduce_sum( reconstucted_image, axis=[1, 2])+1e-6 normalised_brightness_image = reconstucted_image / \ tf.reshape(reconstucted_image_brightness, [batch_size, 1, 1]) ''' # slice off paddles: #reconstructed_image = reconstructed_image[:, :, 5:34] #pythagorean_distances = pythagorean_distances[:, :, 5:34] # # this will slightly brighten every pixel. It will ensure # a) we can't get a division by zero when normalising the brigtness. # b) That the neural network cannot learn to cheat by setting the brigthness of every pixel to zero. brightened_reconstructed_image = reconstructed_image+1e-6 reconstucted_image_brightness = tf.reduce_sum( brightened_reconstructed_image, axis=[1, 2]) normalised_brightness_image = brightened_reconstructed_image / \ tf.reshape(reconstucted_image_brightness, [batch_size, 1, 1]) # shape should be [batch_size, screen_height, screen_width) score = normalised_brightness_image*pythagorean_distances # shape should be [batch_size) score = tf.reduce_sum(score, axis=[1, 2]) result = tf.reduce_mean(score) # old_result = self.calculate_ball_loss_fast( # ball_locations, reconstruction) #print("Checking: ", result, old_result) #assert abs(result-old_result) < 1e-5 return result def train_step(self, data): if isinstance(data, tuple): data = data[0] data_np = data.numpy() ball_locations = [] for d in data_np: loc = find_balls(d, 5, 34) if len(loc) < 1: loc = [0, 0] else: loc = loc[0] ball_locations.append(loc) ball_locations = np.array(ball_locations) with tf.GradientTape() as tape: z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean( tf.reduce_sum( keras.losses.binary_crossentropy(data, reconstruction), axis=(1, 2) ) ) ball_loss = self.calculate_ball_loss_fast2( ball_locations, reconstruction, self.coord_array) * 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss + ball_loss # Get and propagate gradients grads = tape.gradient(total_loss, self.trainable_weights) self.optimizer.apply_gradients(zip(grads, self.trainable_weights)) # Update loss self.total_loss_tracker.update_state(total_loss) self.reconstruction_loss_tracker.update_state(reconstruction_loss) self.kl_loss_tracker.update_state(kl_loss) self.ball_loss_tracker.update_state(ball_loss) return { "loss": self.total_loss_tracker.result(), "reconstruction_loss": self.reconstruction_loss_tracker.result(), "kl_loss": self.kl_loss_tracker.result(), "ball_loss": self.ball_loss_tracker.result(), } def test_step(self, data): if isinstance(data, tuple): data = data[0] data_np = data.numpy() ball_locations = [] for d in data_np: loc = find_balls(d, 5, 34) if len(loc) < 1: loc = [0, 0] else: loc = loc[0] ball_locations.append(loc) ball_locations = np.array(ball_locations) z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) # Calculate reconstruction loss reconstruction_loss = tf.reduce_mean( tf.reduce_sum( keras.losses.binary_crossentropy(data, reconstruction), axis=(1, 2) ) ) ball_loss = self.calculate_ball_loss_fast2( ball_locations, reconstruction, self.coord_array) * 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = reconstruction_loss + kl_loss + ball_loss return { "loss": total_loss, "reconstruction_loss": reconstruction_loss, "kl_loss": kl_loss, "ball_loss": ball_loss, } class VAEBallTrackNoPaddleInternal(keras.Model): def __init__(self, encoder, decoder, **kwargs): super(VAEBallTrackNoPaddleInternal, self).__init__(**kwargs) self.encoder = encoder self.decoder = decoder self.diagonal = math.sqrt( encoder.input_shape[1] ** 2 + encoder.input_shape[2] ** 2) self.total_loss_tracker = keras.metrics.Mean(name="total_loss") self.kl_loss_tracker = keras.metrics.Mean(name="kl_loss") self.ball_loss_tracker = keras.metrics.Mean(name="ball_loss") self.encoder_shape = encoder.input_shape def call(self, inputs): z_mean, z_log_var, z = self.encoder(inputs) return self.decoder(z) def setup_coordinate_array(self, batch): self.coord_array = self.build_coordinate_array( batch, self.encoder_shape[2], self.encoder_shape[1]) @property def metrics(self): return [ self.total_loss_tracker, self.kl_loss_tracker, self.ball_loss_tracker ] def build_coordinate_array(self, batch_size, screen_width, screen_height): result = np.zeros((screen_height, screen_width, 2), np.float32) for x in range(screen_width): # todo: look up numpy mesh to do this faster? for y in range(screen_height): result[y, x, 0] = x result[y, x, 1] = y # should be shape [batch_size, screen_height, screen_width, 2] result = np.stack([result]*batch_size, axis=0) return tf.constant(result) # @tf.function def calculate_ball_loss_fast2(self, ball_locations, reconstruction, coordinate_array): # on entry, ball locations is shape [batch, 2] example, [[original_image1_ballx,original_image1_bally],[original_image2_ballx,original_image2_bally],...] # reconstraction shape [batch, screen_height, screen_width,1]??? # coordinate_array is shape [batch_size, screen_height, screen_width, 2] coordinate_array_temp = coordinate_array batch_size = ball_locations.shape[0] screen_width = reconstruction.shape[2] screen_height = reconstruction.shape[1] try: assert coordinate_array.shape[0] == batch_size except AssertionError: # print( # f"Batch Size {batch_size}, Coord array batch {coordinate_array.shape[0]}") coordinate_array_temp = coordinate_array[:batch_size] assert coordinate_array_temp.shape[1] == screen_height assert coordinate_array_temp.shape[2] == screen_width ball_locations_r = tf.reshape(ball_locations, [batch_size, 1, 1, 2]) relative_locations = coordinate_array_temp - \ tf.cast(ball_locations_r, tf.float32) relative_locations_squared = tf.square(relative_locations) # will work out x*x+y*y. Output shape should be [batch_size, screen_height, screen_widht) temp = tf.reduce_sum(relative_locations_squared, axis=3) # Output shape should be [batch_size, screen_height, screen_widht) pythagorean_distances = tf.sqrt(temp) # shape should be [batch_size, screen_height, screen_width) reconstructed_image = reconstruction[:, :, :, 0] # should leave us with a vector of shape [batch_size] ''' reconstucted_image_brightness = tf.reduce_sum( reconstucted_image, axis=[1, 2])+1e-6 normalised_brightness_image = reconstucted_image / \ tf.reshape(reconstucted_image_brightness, [batch_size, 1, 1]) ''' # slice off paddles: #reconstructed_image = reconstructed_image[:, :, 5:34] #pythagorean_distances = pythagorean_distances[:, :, 5:34] # # this will slightly brighten every pixel. It will ensure # a) we can't get a division by zero when normalising the brigtness. # b) That the neural network cannot learn to cheat by setting the brigthness of every pixel to zero. brightened_reconstructed_image = reconstructed_image+1e-6 reconstucted_image_brightness = tf.reduce_sum( brightened_reconstructed_image, axis=[1, 2]) normalised_brightness_image = brightened_reconstructed_image / \ tf.reshape(reconstucted_image_brightness, [batch_size, 1, 1]) # shape should be [batch_size, screen_height, screen_width) score = normalised_brightness_image*pythagorean_distances # shape should be [batch_size) score = tf.reduce_sum(score, axis=[1, 2]) result = tf.reduce_mean(score) # old_result = self.calculate_ball_loss_fast( # ball_locations, reconstruction) #print("Checking: ", result, old_result) #assert abs(result-old_result) < 1e-5 return result def train_step(self, data): if isinstance(data, tuple): data = data[0] data_np = data.numpy() ball_locations = find_balls_tf(data) with tf.GradientTape() as tape: z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) ball_loss = self.calculate_ball_loss_fast2( ball_locations, reconstruction, self.coord_array) * 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = kl_loss + ball_loss # Get and propagate gradients grads = tape.gradient(total_loss, self.trainable_weights) self.optimizer.apply_gradients(zip(grads, self.trainable_weights)) # Update loss self.total_loss_tracker.update_state(total_loss) self.kl_loss_tracker.update_state(kl_loss) self.ball_loss_tracker.update_state(ball_loss) return { "loss": self.total_loss_tracker.result(), "kl_loss": self.kl_loss_tracker.result(), "ball_loss": self.ball_loss_tracker.result(), } def test_step(self, data): if isinstance(data, tuple): data = data[0] data_np = data.numpy() ball_locations = find_balls_tf(data) z_mean, z_log_var, z = self.encoder(data) reconstruction = self.decoder(z) ball_loss = self.calculate_ball_loss_fast2( ball_locations, reconstruction, self.coord_array) * 1 # Calculate KL loss and total loss kl_loss = -0.5 * (1 + z_log_var - tf.square(z_mean) - tf.exp(z_log_var)) kl_loss = tf.reduce_mean(tf.reduce_sum(kl_loss, axis=1)) total_loss = kl_loss + ball_loss return { "loss": total_loss, "kl_loss": kl_loss, "ball_loss": ball_loss, }
40.027994
162
0.625301
3,141
25,738
4.848138
0.081503
0.028763
0.012411
0.018387
0.887641
0.885146
0.876478
0.861505
0.857893
0.847715
0
0.015435
0.282578
25,738
642
163
40.090343
0.809261
0.181405
0
0.779097
0
0
0.017107
0
0
0
0
0.003115
0.019002
1
0.064133
false
0
0.014252
0.007126
0.137767
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
4dd8980bde4d440212224c4fb0f9a11bf95ba4ff
57,982
py
Python
pdfminer3/fontmetrics.py
herrnici/pdfminer3
0442ea2fd5f15a5ca6f79f21df9369be99be3eb2
[ "MIT" ]
44
2018-12-16T19:51:33.000Z
2022-02-07T21:36:28.000Z
pdfminer3/fontmetrics.py
herrnici/pdfminer3
0442ea2fd5f15a5ca6f79f21df9369be99be3eb2
[ "MIT" ]
7
2018-12-16T19:56:45.000Z
2021-08-12T14:29:28.000Z
pdfminer3/fontmetrics.py
herrnici/pdfminer3
0442ea2fd5f15a5ca6f79f21df9369be99be3eb2
[ "MIT" ]
12
2019-02-21T06:30:14.000Z
2021-04-23T07:50:35.000Z
""" Font metrics for the Adobe core 14 fonts. Font metrics are used to compute the boundary of each character written with a proportional font. The following data were extracted from the AFM files: http://www.ctan.org/tex-archive/fonts/adobe/afm/ """ ### BEGIN Verbatim copy of the license part # # Adobe Core 35 AFM Files with 314 Glyph Entries - ReadMe # # This file and the 35 PostScript(R) AFM files it accompanies may be # used, copied, and distributed for any purpose and without charge, # with or without modification, provided that all copyright notices # are retained; that the AFM files are not distributed without this # file; that all modifications to this file or any of the AFM files # are prominently noted in the modified file(s); and that this # paragraph is not modified. Adobe Systems has no responsibility or # obligation to support the use of the AFM files. # ### END Verbatim copy of the license part FONT_METRICS = { 'Courier': ({'FontName': 'Courier', 'Descent': -194.0, 'FontBBox': (-6.0, -249.0, 639.0, 803.0), 'FontWeight': 'Medium', 'CapHeight': 572.0, 'FontFamily': 'Courier', 'Flags': 64, 'XHeight': 434.0, 'ItalicAngle': 0.0, 'Ascent': 627.0}, {' ': 600, '!': 600, '"': 600, '#': 600, '$': 600, '%': 600, '&': 600, u"'": 600, '(': 600, ')': 600, '*': 600, '+': 600, ',': 600, '-': 600, '.': 600, '/': 600, '0': 600, '1': 600, '2': 600, '3': 600, '4': 600, '5': 600, '6': 600, '7': 600, '8': 600, '9': 600, ':': 600, ';': 600, '<': 600, '=': 600, '>': 600, '?': 600, '@': 600, 'A': 600, 'B': 600, 'C': 600, 'D': 600, 'E': 600, 'F': 600, 'G': 600, 'H': 600, 'I': 600, 'J': 600, 'K': 600, 'L': 600, 'M': 600, 'N': 600, 'O': 600, 'P': 600, 'Q': 600, 'R': 600, 'S': 600, 'T': 600, 'U': 600, 'V': 600, 'W': 600, 'X': 600, 'Y': 600, 'Z': 600, '[': 600, '\\': 600, ']': 600, '^': 600, '_': 600, '`': 600, 'a': 600, 'b': 600, 'c': 600, 'd': 600, 'e': 600, 'f': 600, 'g': 600, 'h': 600, 'i': 600, 'j': 600, 'k': 600, 'l': 600, 'm': 600, 'n': 600, 'o': 600, 'p': 600, 'q': 600, 'r': 600, 's': 600, 't': 600, 'u': 600, 'v': 600, 'w': 600, 'x': 600, 'y': 600, 'z': 600, '{': 600, '|': 600, '}': 600, '~': 600, '\xa1': 600, '\xa2': 600, '\xa3': 600, '\xa4': 600, '\xa5': 600, '\xa6': 600, '\xa7': 600, '\xa8': 600, '\xa9': 600, '\xaa': 600, '\xab': 600, '\xac': 600, '\xae': 600, '\xaf': 600, '\xb0': 600, '\xb1': 600, '\xb2': 600, '\xb3': 600, '\xb4': 600, '\xb5': 600, '\xb6': 600, '\xb7': 600, '\xb8': 600, '\xb9': 600, '\xba': 600, '\xbb': 600, '\xbc': 600, '\xbd': 600, '\xbe': 600, '\xbf': 600, '\xc0': 600, '\xc1': 600, '\xc2': 600, '\xc3': 600, '\xc4': 600, '\xc5': 600, '\xc6': 600, '\xc7': 600, '\xc8': 600, '\xc9': 600, '\xca': 600, '\xcb': 600, '\xcc': 600, '\xcd': 600, '\xce': 600, '\xcf': 600, '\xd0': 600, '\xd1': 600, '\xd2': 600, '\xd3': 600, '\xd4': 600, '\xd5': 600, '\xd6': 600, '\xd7': 600, '\xd8': 600, '\xd9': 600, '\xda': 600, '\xdb': 600, '\xdc': 600, '\xdd': 600, '\xde': 600, '\xdf': 600, '\xe0': 600, '\xe1': 600, '\xe2': 600, '\xe3': 600, '\xe4': 600, '\xe5': 600, '\xe6': 600, '\xe7': 600, '\xe8': 600, '\xe9': 600, '\xea': 600, '\xeb': 600, '\xec': 600, '\xed': 600, '\xee': 600, '\xef': 600, '\xf0': 600, '\xf1': 600, '\xf2': 600, '\xf3': 600, '\xf4': 600, '\xf5': 600, '\xf6': 600, '\xf7': 600, '\xf8': 600, '\xf9': 600, '\xfa': 600, '\xfb': 600, '\xfc': 600, '\xfd': 600, '\xfe': 600, '\xff': 600, '\u0100': 600, '\u0101': 600, '\u0102': 600, '\u0103': 600, '\u0104': 600, '\u0105': 600, '\u0106': 600, '\u0107': 600, '\u010c': 600, '\u010d': 600, '\u010e': 600, '\u010f': 600, '\u0110': 600, '\u0111': 600, '\u0112': 600, '\u0113': 600, '\u0116': 600, '\u0117': 600, '\u0118': 600, '\u0119': 600, '\u011a': 600, '\u011b': 600, '\u011e': 600, '\u011f': 600, '\u0122': 600, '\u0123': 600, '\u012a': 600, '\u012b': 600, '\u012e': 600, '\u012f': 600, '\u0130': 600, '\u0131': 600, '\u0136': 600, '\u0137': 600, '\u0139': 600, '\u013a': 600, '\u013b': 600, '\u013c': 600, '\u013d': 600, '\u013e': 600, '\u0141': 600, '\u0142': 600, '\u0143': 600, '\u0144': 600, '\u0145': 600, '\u0146': 600, '\u0147': 600, '\u0148': 600, '\u014c': 600, '\u014d': 600, '\u0150': 600, '\u0151': 600, '\u0152': 600, '\u0153': 600, '\u0154': 600, '\u0155': 600, '\u0156': 600, '\u0157': 600, '\u0158': 600, '\u0159': 600, '\u015a': 600, '\u015b': 600, '\u015e': 600, '\u015f': 600, '\u0160': 600, '\u0161': 600, '\u0162': 600, '\u0163': 600, '\u0164': 600, '\u0165': 600, '\u016a': 600, '\u016b': 600, '\u016e': 600, '\u016f': 600, '\u0170': 600, '\u0171': 600, '\u0172': 600, '\u0173': 600, '\u0178': 600, '\u0179': 600, '\u017a': 600, '\u017b': 600, '\u017c': 600, '\u017d': 600, '\u017e': 600, '\u0192': 600, '\u0218': 600, '\u0219': 600, '\u02c6': 600, '\u02c7': 600, '\u02d8': 600, '\u02d9': 600, '\u02da': 600, '\u02db': 600, '\u02dc': 600, '\u02dd': 600, '\u2013': 600, '\u2014': 600, '\u2018': 600, '\u2019': 600, '\u201a': 600, '\u201c': 600, '\u201d': 600, '\u201e': 600, '\u2020': 600, '\u2021': 600, '\u2022': 600, '\u2026': 600, '\u2030': 600, '\u2039': 600, '\u203a': 600, '\u2044': 600, '\u2122': 600, '\u2202': 600, '\u2206': 600, '\u2211': 600, '\u2212': 600, '\u221a': 600, '\u2260': 600, '\u2264': 600, '\u2265': 600, '\u25ca': 600, '\uf6c3': 600, '\ufb01': 600, '\ufb02': 600}), 'Courier-Bold': ({'FontName': 'Courier-Bold', 'Descent': -194.0, 'FontBBox': (-88.0, -249.0, 697.0, 811.0), 'FontWeight': 'Bold', 'CapHeight': 572.0, 'FontFamily': 'Courier', 'Flags': 64, 'XHeight': 434.0, 'ItalicAngle': 0.0, 'Ascent': 627.0}, {' ': 600, '!': 600, '"': 600, '#': 600, '$': 600, '%': 600, '&': 600, u"'": 600, '(': 600, ')': 600, '*': 600, '+': 600, ',': 600, '-': 600, '.': 600, '/': 600, '0': 600, '1': 600, '2': 600, '3': 600, '4': 600, '5': 600, '6': 600, '7': 600, '8': 600, '9': 600, ':': 600, ';': 600, '<': 600, '=': 600, '>': 600, '?': 600, '@': 600, 'A': 600, 'B': 600, 'C': 600, 'D': 600, 'E': 600, 'F': 600, 'G': 600, 'H': 600, 'I': 600, 'J': 600, 'K': 600, 'L': 600, 'M': 600, 'N': 600, 'O': 600, 'P': 600, 'Q': 600, 'R': 600, 'S': 600, 'T': 600, 'U': 600, 'V': 600, 'W': 600, 'X': 600, 'Y': 600, 'Z': 600, '[': 600, '\\': 600, ']': 600, '^': 600, '_': 600, '`': 600, 'a': 600, 'b': 600, 'c': 600, 'd': 600, 'e': 600, 'f': 600, 'g': 600, 'h': 600, 'i': 600, 'j': 600, 'k': 600, 'l': 600, 'm': 600, 'n': 600, 'o': 600, 'p': 600, 'q': 600, 'r': 600, 's': 600, 't': 600, 'u': 600, 'v': 600, 'w': 600, 'x': 600, 'y': 600, 'z': 600, '{': 600, '|': 600, '}': 600, '~': 600, '\xa1': 600, '\xa2': 600, '\xa3': 600, '\xa4': 600, '\xa5': 600, '\xa6': 600, '\xa7': 600, '\xa8': 600, '\xa9': 600, '\xaa': 600, '\xab': 600, '\xac': 600, '\xae': 600, '\xaf': 600, '\xb0': 600, '\xb1': 600, '\xb2': 600, '\xb3': 600, '\xb4': 600, '\xb5': 600, '\xb6': 600, '\xb7': 600, '\xb8': 600, '\xb9': 600, '\xba': 600, '\xbb': 600, '\xbc': 600, '\xbd': 600, '\xbe': 600, '\xbf': 600, '\xc0': 600, '\xc1': 600, '\xc2': 600, '\xc3': 600, '\xc4': 600, '\xc5': 600, '\xc6': 600, '\xc7': 600, '\xc8': 600, '\xc9': 600, '\xca': 600, '\xcb': 600, '\xcc': 600, '\xcd': 600, '\xce': 600, '\xcf': 600, '\xd0': 600, '\xd1': 600, '\xd2': 600, '\xd3': 600, '\xd4': 600, '\xd5': 600, '\xd6': 600, '\xd7': 600, '\xd8': 600, '\xd9': 600, '\xda': 600, '\xdb': 600, '\xdc': 600, '\xdd': 600, '\xde': 600, '\xdf': 600, '\xe0': 600, '\xe1': 600, '\xe2': 600, '\xe3': 600, '\xe4': 600, '\xe5': 600, '\xe6': 600, '\xe7': 600, '\xe8': 600, '\xe9': 600, '\xea': 600, '\xeb': 600, '\xec': 600, '\xed': 600, '\xee': 600, '\xef': 600, '\xf0': 600, '\xf1': 600, '\xf2': 600, '\xf3': 600, '\xf4': 600, '\xf5': 600, '\xf6': 600, '\xf7': 600, '\xf8': 600, '\xf9': 600, '\xfa': 600, '\xfb': 600, '\xfc': 600, '\xfd': 600, '\xfe': 600, '\xff': 600, '\u0100': 600, '\u0101': 600, '\u0102': 600, '\u0103': 600, '\u0104': 600, '\u0105': 600, '\u0106': 600, '\u0107': 600, '\u010c': 600, '\u010d': 600, '\u010e': 600, '\u010f': 600, '\u0110': 600, '\u0111': 600, '\u0112': 600, '\u0113': 600, '\u0116': 600, '\u0117': 600, '\u0118': 600, '\u0119': 600, '\u011a': 600, '\u011b': 600, '\u011e': 600, '\u011f': 600, '\u0122': 600, '\u0123': 600, '\u012a': 600, '\u012b': 600, '\u012e': 600, '\u012f': 600, '\u0130': 600, '\u0131': 600, '\u0136': 600, '\u0137': 600, '\u0139': 600, '\u013a': 600, '\u013b': 600, '\u013c': 600, '\u013d': 600, '\u013e': 600, '\u0141': 600, '\u0142': 600, '\u0143': 600, '\u0144': 600, '\u0145': 600, '\u0146': 600, '\u0147': 600, '\u0148': 600, '\u014c': 600, '\u014d': 600, '\u0150': 600, '\u0151': 600, '\u0152': 600, '\u0153': 600, '\u0154': 600, '\u0155': 600, '\u0156': 600, '\u0157': 600, '\u0158': 600, '\u0159': 600, '\u015a': 600, '\u015b': 600, '\u015e': 600, '\u015f': 600, '\u0160': 600, '\u0161': 600, '\u0162': 600, '\u0163': 600, '\u0164': 600, '\u0165': 600, '\u016a': 600, '\u016b': 600, '\u016e': 600, '\u016f': 600, '\u0170': 600, '\u0171': 600, '\u0172': 600, '\u0173': 600, '\u0178': 600, '\u0179': 600, '\u017a': 600, '\u017b': 600, '\u017c': 600, '\u017d': 600, '\u017e': 600, '\u0192': 600, '\u0218': 600, '\u0219': 600, '\u02c6': 600, '\u02c7': 600, '\u02d8': 600, '\u02d9': 600, '\u02da': 600, '\u02db': 600, '\u02dc': 600, '\u02dd': 600, '\u2013': 600, '\u2014': 600, '\u2018': 600, '\u2019': 600, '\u201a': 600, '\u201c': 600, '\u201d': 600, '\u201e': 600, '\u2020': 600, '\u2021': 600, '\u2022': 600, '\u2026': 600, '\u2030': 600, '\u2039': 600, '\u203a': 600, '\u2044': 600, '\u2122': 600, '\u2202': 600, '\u2206': 600, '\u2211': 600, '\u2212': 600, '\u221a': 600, '\u2260': 600, '\u2264': 600, '\u2265': 600, '\u25ca': 600, '\uf6c3': 600, '\ufb01': 600, '\ufb02': 600}), 'Courier-BoldOblique': ({'FontName': 'Courier-BoldOblique', 'Descent': -194.0, 'FontBBox': (-49.0, -249.0, 758.0, 811.0), 'FontWeight': 'Bold', 'CapHeight': 572.0, 'FontFamily': 'Courier', 'Flags': 64, 'XHeight': 434.0, 'ItalicAngle': -11.0, 'Ascent': 627.0}, {' ': 600, '!': 600, '"': 600, '#': 600, '$': 600, '%': 600, '&': 600, u"'": 600, '(': 600, ')': 600, '*': 600, '+': 600, ',': 600, '-': 600, '.': 600, '/': 600, '0': 600, '1': 600, '2': 600, '3': 600, '4': 600, '5': 600, '6': 600, '7': 600, '8': 600, '9': 600, ':': 600, ';': 600, '<': 600, '=': 600, '>': 600, '?': 600, '@': 600, 'A': 600, 'B': 600, 'C': 600, 'D': 600, 'E': 600, 'F': 600, 'G': 600, 'H': 600, 'I': 600, 'J': 600, 'K': 600, 'L': 600, 'M': 600, 'N': 600, 'O': 600, 'P': 600, 'Q': 600, 'R': 600, 'S': 600, 'T': 600, 'U': 600, 'V': 600, 'W': 600, 'X': 600, 'Y': 600, 'Z': 600, '[': 600, '\\': 600, ']': 600, '^': 600, '_': 600, '`': 600, 'a': 600, 'b': 600, 'c': 600, 'd': 600, 'e': 600, 'f': 600, 'g': 600, 'h': 600, 'i': 600, 'j': 600, 'k': 600, 'l': 600, 'm': 600, 'n': 600, 'o': 600, 'p': 600, 'q': 600, 'r': 600, 's': 600, 't': 600, 'u': 600, 'v': 600, 'w': 600, 'x': 600, 'y': 600, 'z': 600, '{': 600, '|': 600, '}': 600, '~': 600, '\xa1': 600, '\xa2': 600, '\xa3': 600, '\xa4': 600, '\xa5': 600, '\xa6': 600, '\xa7': 600, '\xa8': 600, '\xa9': 600, '\xaa': 600, '\xab': 600, '\xac': 600, '\xae': 600, '\xaf': 600, '\xb0': 600, '\xb1': 600, '\xb2': 600, '\xb3': 600, '\xb4': 600, '\xb5': 600, '\xb6': 600, '\xb7': 600, '\xb8': 600, '\xb9': 600, '\xba': 600, '\xbb': 600, '\xbc': 600, '\xbd': 600, '\xbe': 600, '\xbf': 600, '\xc0': 600, '\xc1': 600, '\xc2': 600, '\xc3': 600, '\xc4': 600, '\xc5': 600, '\xc6': 600, '\xc7': 600, '\xc8': 600, '\xc9': 600, '\xca': 600, '\xcb': 600, '\xcc': 600, '\xcd': 600, '\xce': 600, '\xcf': 600, '\xd0': 600, '\xd1': 600, '\xd2': 600, '\xd3': 600, '\xd4': 600, '\xd5': 600, '\xd6': 600, '\xd7': 600, '\xd8': 600, '\xd9': 600, '\xda': 600, '\xdb': 600, '\xdc': 600, '\xdd': 600, '\xde': 600, '\xdf': 600, '\xe0': 600, '\xe1': 600, '\xe2': 600, '\xe3': 600, '\xe4': 600, '\xe5': 600, '\xe6': 600, '\xe7': 600, '\xe8': 600, '\xe9': 600, '\xea': 600, '\xeb': 600, '\xec': 600, '\xed': 600, '\xee': 600, '\xef': 600, '\xf0': 600, '\xf1': 600, '\xf2': 600, '\xf3': 600, '\xf4': 600, '\xf5': 600, '\xf6': 600, '\xf7': 600, '\xf8': 600, '\xf9': 600, '\xfa': 600, '\xfb': 600, '\xfc': 600, '\xfd': 600, '\xfe': 600, '\xff': 600, '\u0100': 600, '\u0101': 600, '\u0102': 600, '\u0103': 600, '\u0104': 600, '\u0105': 600, '\u0106': 600, '\u0107': 600, '\u010c': 600, '\u010d': 600, '\u010e': 600, '\u010f': 600, '\u0110': 600, '\u0111': 600, '\u0112': 600, '\u0113': 600, '\u0116': 600, '\u0117': 600, '\u0118': 600, '\u0119': 600, '\u011a': 600, '\u011b': 600, '\u011e': 600, '\u011f': 600, '\u0122': 600, '\u0123': 600, '\u012a': 600, '\u012b': 600, '\u012e': 600, '\u012f': 600, '\u0130': 600, '\u0131': 600, '\u0136': 600, '\u0137': 600, '\u0139': 600, '\u013a': 600, '\u013b': 600, '\u013c': 600, '\u013d': 600, '\u013e': 600, '\u0141': 600, '\u0142': 600, '\u0143': 600, '\u0144': 600, '\u0145': 600, '\u0146': 600, '\u0147': 600, '\u0148': 600, '\u014c': 600, '\u014d': 600, '\u0150': 600, '\u0151': 600, '\u0152': 600, '\u0153': 600, '\u0154': 600, '\u0155': 600, '\u0156': 600, '\u0157': 600, '\u0158': 600, '\u0159': 600, '\u015a': 600, '\u015b': 600, '\u015e': 600, '\u015f': 600, '\u0160': 600, '\u0161': 600, '\u0162': 600, '\u0163': 600, '\u0164': 600, '\u0165': 600, '\u016a': 600, '\u016b': 600, '\u016e': 600, '\u016f': 600, '\u0170': 600, '\u0171': 600, '\u0172': 600, '\u0173': 600, '\u0178': 600, '\u0179': 600, '\u017a': 600, '\u017b': 600, '\u017c': 600, '\u017d': 600, '\u017e': 600, '\u0192': 600, '\u0218': 600, '\u0219': 600, '\u02c6': 600, '\u02c7': 600, '\u02d8': 600, '\u02d9': 600, '\u02da': 600, '\u02db': 600, '\u02dc': 600, '\u02dd': 600, '\u2013': 600, '\u2014': 600, '\u2018': 600, '\u2019': 600, '\u201a': 600, '\u201c': 600, '\u201d': 600, '\u201e': 600, '\u2020': 600, '\u2021': 600, '\u2022': 600, '\u2026': 600, '\u2030': 600, '\u2039': 600, '\u203a': 600, '\u2044': 600, '\u2122': 600, '\u2202': 600, '\u2206': 600, '\u2211': 600, '\u2212': 600, '\u221a': 600, '\u2260': 600, '\u2264': 600, '\u2265': 600, '\u25ca': 600, '\uf6c3': 600, '\ufb01': 600, '\ufb02': 600}), 'Courier-Oblique': ({'FontName': 'Courier-Oblique', 'Descent': -194.0, 'FontBBox': (-49.0, -249.0, 749.0, 803.0), 'FontWeight': 'Medium', 'CapHeight': 572.0, 'FontFamily': 'Courier', 'Flags': 64, 'XHeight': 434.0, 'ItalicAngle': -11.0, 'Ascent': 627.0}, {' ': 600, '!': 600, '"': 600, '#': 600, '$': 600, '%': 600, '&': 600, u"'": 600, '(': 600, ')': 600, '*': 600, '+': 600, ',': 600, '-': 600, '.': 600, '/': 600, '0': 600, '1': 600, '2': 600, '3': 600, '4': 600, '5': 600, '6': 600, '7': 600, '8': 600, '9': 600, ':': 600, ';': 600, '<': 600, '=': 600, '>': 600, '?': 600, '@': 600, 'A': 600, 'B': 600, 'C': 600, 'D': 600, 'E': 600, 'F': 600, 'G': 600, 'H': 600, 'I': 600, 'J': 600, 'K': 600, 'L': 600, 'M': 600, 'N': 600, 'O': 600, 'P': 600, 'Q': 600, 'R': 600, 'S': 600, 'T': 600, 'U': 600, 'V': 600, 'W': 600, 'X': 600, 'Y': 600, 'Z': 600, '[': 600, '\\': 600, ']': 600, '^': 600, '_': 600, '`': 600, 'a': 600, 'b': 600, 'c': 600, 'd': 600, 'e': 600, 'f': 600, 'g': 600, 'h': 600, 'i': 600, 'j': 600, 'k': 600, 'l': 600, 'm': 600, 'n': 600, 'o': 600, 'p': 600, 'q': 600, 'r': 600, 's': 600, 't': 600, 'u': 600, 'v': 600, 'w': 600, 'x': 600, 'y': 600, 'z': 600, '{': 600, '|': 600, '}': 600, '~': 600, '\xa1': 600, '\xa2': 600, '\xa3': 600, '\xa4': 600, '\xa5': 600, '\xa6': 600, '\xa7': 600, '\xa8': 600, '\xa9': 600, '\xaa': 600, '\xab': 600, '\xac': 600, '\xae': 600, '\xaf': 600, '\xb0': 600, '\xb1': 600, '\xb2': 600, '\xb3': 600, '\xb4': 600, '\xb5': 600, '\xb6': 600, '\xb7': 600, '\xb8': 600, '\xb9': 600, '\xba': 600, '\xbb': 600, '\xbc': 600, '\xbd': 600, '\xbe': 600, '\xbf': 600, '\xc0': 600, '\xc1': 600, '\xc2': 600, '\xc3': 600, '\xc4': 600, '\xc5': 600, '\xc6': 600, '\xc7': 600, '\xc8': 600, '\xc9': 600, '\xca': 600, '\xcb': 600, '\xcc': 600, '\xcd': 600, '\xce': 600, '\xcf': 600, '\xd0': 600, '\xd1': 600, '\xd2': 600, '\xd3': 600, '\xd4': 600, '\xd5': 600, '\xd6': 600, '\xd7': 600, '\xd8': 600, '\xd9': 600, '\xda': 600, '\xdb': 600, '\xdc': 600, '\xdd': 600, '\xde': 600, '\xdf': 600, '\xe0': 600, '\xe1': 600, '\xe2': 600, '\xe3': 600, '\xe4': 600, '\xe5': 600, '\xe6': 600, '\xe7': 600, '\xe8': 600, '\xe9': 600, '\xea': 600, '\xeb': 600, '\xec': 600, '\xed': 600, '\xee': 600, '\xef': 600, '\xf0': 600, '\xf1': 600, '\xf2': 600, '\xf3': 600, '\xf4': 600, '\xf5': 600, '\xf6': 600, '\xf7': 600, '\xf8': 600, '\xf9': 600, '\xfa': 600, '\xfb': 600, '\xfc': 600, '\xfd': 600, '\xfe': 600, '\xff': 600, '\u0100': 600, '\u0101': 600, '\u0102': 600, '\u0103': 600, '\u0104': 600, '\u0105': 600, '\u0106': 600, '\u0107': 600, '\u010c': 600, '\u010d': 600, '\u010e': 600, '\u010f': 600, '\u0110': 600, '\u0111': 600, '\u0112': 600, '\u0113': 600, '\u0116': 600, '\u0117': 600, '\u0118': 600, '\u0119': 600, '\u011a': 600, '\u011b': 600, '\u011e': 600, '\u011f': 600, '\u0122': 600, '\u0123': 600, '\u012a': 600, '\u012b': 600, '\u012e': 600, '\u012f': 600, '\u0130': 600, '\u0131': 600, '\u0136': 600, '\u0137': 600, '\u0139': 600, '\u013a': 600, '\u013b': 600, '\u013c': 600, '\u013d': 600, '\u013e': 600, '\u0141': 600, '\u0142': 600, '\u0143': 600, '\u0144': 600, '\u0145': 600, '\u0146': 600, '\u0147': 600, '\u0148': 600, '\u014c': 600, '\u014d': 600, '\u0150': 600, '\u0151': 600, '\u0152': 600, '\u0153': 600, '\u0154': 600, '\u0155': 600, '\u0156': 600, '\u0157': 600, '\u0158': 600, '\u0159': 600, '\u015a': 600, '\u015b': 600, '\u015e': 600, '\u015f': 600, '\u0160': 600, '\u0161': 600, '\u0162': 600, '\u0163': 600, '\u0164': 600, '\u0165': 600, '\u016a': 600, '\u016b': 600, '\u016e': 600, '\u016f': 600, '\u0170': 600, '\u0171': 600, '\u0172': 600, '\u0173': 600, '\u0178': 600, '\u0179': 600, '\u017a': 600, '\u017b': 600, '\u017c': 600, '\u017d': 600, '\u017e': 600, '\u0192': 600, '\u0218': 600, '\u0219': 600, '\u02c6': 600, '\u02c7': 600, '\u02d8': 600, '\u02d9': 600, '\u02da': 600, '\u02db': 600, '\u02dc': 600, '\u02dd': 600, '\u2013': 600, '\u2014': 600, '\u2018': 600, '\u2019': 600, '\u201a': 600, '\u201c': 600, '\u201d': 600, '\u201e': 600, '\u2020': 600, '\u2021': 600, '\u2022': 600, '\u2026': 600, '\u2030': 600, '\u2039': 600, '\u203a': 600, '\u2044': 600, '\u2122': 600, '\u2202': 600, '\u2206': 600, '\u2211': 600, '\u2212': 600, '\u221a': 600, '\u2260': 600, '\u2264': 600, '\u2265': 600, '\u25ca': 600, '\uf6c3': 600, '\ufb01': 600, '\ufb02': 600}), 'Helvetica': ({'FontName': 'Helvetica', 'Descent': -207.0, 'FontBBox': (-166.0, -225.0, 1000.0, 931.0), 'FontWeight': 'Medium', 'CapHeight': 718.0, 'FontFamily': 'Helvetica', 'Flags': 0, 'XHeight': 523.0, 'ItalicAngle': 0.0, 'Ascent': 718.0}, {' ': 278, '!': 278, '"': 355, '#': 556, '$': 556, '%': 889, '&': 667, u"'": 191, '(': 333, ')': 333, '*': 389, '+': 584, ',': 278, '-': 333, '.': 278, '/': 278, '0': 556, '1': 556, '2': 556, '3': 556, '4': 556, '5': 556, '6': 556, '7': 556, '8': 556, '9': 556, ':': 278, ';': 278, '<': 584, '=': 584, '>': 584, '?': 556, '@': 1015, 'A': 667, 'B': 667, 'C': 722, 'D': 722, 'E': 667, 'F': 611, 'G': 778, 'H': 722, 'I': 278, 'J': 500, 'K': 667, 'L': 556, 'M': 833, 'N': 722, 'O': 778, 'P': 667, 'Q': 778, 'R': 722, 'S': 667, 'T': 611, 'U': 722, 'V': 667, 'W': 944, 'X': 667, 'Y': 667, 'Z': 611, '[': 278, '\\': 278, ']': 278, '^': 469, '_': 556, '`': 333, 'a': 556, 'b': 556, 'c': 500, 'd': 556, 'e': 556, 'f': 278, 'g': 556, 'h': 556, 'i': 222, 'j': 222, 'k': 500, 'l': 222, 'm': 833, 'n': 556, 'o': 556, 'p': 556, 'q': 556, 'r': 333, 's': 500, 't': 278, 'u': 556, 'v': 500, 'w': 722, 'x': 500, 'y': 500, 'z': 500, '{': 334, '|': 260, '}': 334, '~': 584, '\xa1': 333, '\xa2': 556, '\xa3': 556, '\xa4': 556, '\xa5': 556, '\xa6': 260, '\xa7': 556, '\xa8': 333, '\xa9': 737, '\xaa': 370, '\xab': 556, '\xac': 584, '\xae': 737, '\xaf': 333, '\xb0': 400, '\xb1': 584, '\xb2': 333, '\xb3': 333, '\xb4': 333, '\xb5': 556, '\xb6': 537, '\xb7': 278, '\xb8': 333, '\xb9': 333, '\xba': 365, '\xbb': 556, '\xbc': 834, '\xbd': 834, '\xbe': 834, '\xbf': 611, '\xc0': 667, '\xc1': 667, '\xc2': 667, '\xc3': 667, '\xc4': 667, '\xc5': 667, '\xc6': 1000, '\xc7': 722, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 278, '\xcd': 278, '\xce': 278, '\xcf': 278, '\xd0': 722, '\xd1': 722, '\xd2': 778, '\xd3': 778, '\xd4': 778, '\xd5': 778, '\xd6': 778, '\xd7': 584, '\xd8': 778, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 667, '\xde': 667, '\xdf': 611, '\xe0': 556, '\xe1': 556, '\xe2': 556, '\xe3': 556, '\xe4': 556, '\xe5': 556, '\xe6': 889, '\xe7': 500, '\xe8': 556, '\xe9': 556, '\xea': 556, '\xeb': 556, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 556, '\xf1': 556, '\xf2': 556, '\xf3': 556, '\xf4': 556, '\xf5': 556, '\xf6': 556, '\xf7': 584, '\xf8': 611, '\xf9': 556, '\xfa': 556, '\xfb': 556, '\xfc': 556, '\xfd': 500, '\xfe': 556, '\xff': 500, '\u0100': 667, '\u0101': 556, '\u0102': 667, '\u0103': 556, '\u0104': 667, '\u0105': 556, '\u0106': 722, '\u0107': 500, '\u010c': 722, '\u010d': 500, '\u010e': 722, '\u010f': 643, '\u0110': 722, '\u0111': 556, '\u0112': 667, '\u0113': 556, '\u0116': 667, '\u0117': 556, '\u0118': 667, '\u0119': 556, '\u011a': 667, '\u011b': 556, '\u011e': 778, '\u011f': 556, '\u0122': 778, '\u0123': 556, '\u012a': 278, '\u012b': 278, '\u012e': 278, '\u012f': 222, '\u0130': 278, '\u0131': 278, '\u0136': 667, '\u0137': 500, '\u0139': 556, '\u013a': 222, '\u013b': 556, '\u013c': 222, '\u013d': 556, '\u013e': 299, '\u0141': 556, '\u0142': 222, '\u0143': 722, '\u0144': 556, '\u0145': 722, '\u0146': 556, '\u0147': 722, '\u0148': 556, '\u014c': 778, '\u014d': 556, '\u0150': 778, '\u0151': 556, '\u0152': 1000, '\u0153': 944, '\u0154': 722, '\u0155': 333, '\u0156': 722, '\u0157': 333, '\u0158': 722, '\u0159': 333, '\u015a': 667, '\u015b': 500, '\u015e': 667, '\u015f': 500, '\u0160': 667, '\u0161': 500, '\u0162': 611, '\u0163': 278, '\u0164': 611, '\u0165': 317, '\u016a': 722, '\u016b': 556, '\u016e': 722, '\u016f': 556, '\u0170': 722, '\u0171': 556, '\u0172': 722, '\u0173': 556, '\u0178': 667, '\u0179': 611, '\u017a': 500, '\u017b': 611, '\u017c': 500, '\u017d': 611, '\u017e': 500, '\u0192': 556, '\u0218': 667, '\u0219': 500, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 556, '\u2014': 1000, '\u2018': 222, '\u2019': 222, '\u201a': 222, '\u201c': 333, '\u201d': 333, '\u201e': 333, '\u2020': 556, '\u2021': 556, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 476, '\u2206': 612, '\u2211': 600, '\u2212': 584, '\u221a': 453, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 471, '\uf6c3': 250, '\ufb01': 500, '\ufb02': 500}), 'Helvetica-Bold': ({'FontName': 'Helvetica-Bold', 'Descent': -207.0, 'FontBBox': (-170.0, -228.0, 1003.0, 962.0), 'FontWeight': 'Bold', 'CapHeight': 718.0, 'FontFamily': 'Helvetica', 'Flags': 0, 'XHeight': 532.0, 'ItalicAngle': 0.0, 'Ascent': 718.0}, {' ': 278, '!': 333, '"': 474, '#': 556, '$': 556, '%': 889, '&': 722, u"'": 238, '(': 333, ')': 333, '*': 389, '+': 584, ',': 278, '-': 333, '.': 278, '/': 278, '0': 556, '1': 556, '2': 556, '3': 556, '4': 556, '5': 556, '6': 556, '7': 556, '8': 556, '9': 556, ':': 333, ';': 333, '<': 584, '=': 584, '>': 584, '?': 611, '@': 975, 'A': 722, 'B': 722, 'C': 722, 'D': 722, 'E': 667, 'F': 611, 'G': 778, 'H': 722, 'I': 278, 'J': 556, 'K': 722, 'L': 611, 'M': 833, 'N': 722, 'O': 778, 'P': 667, 'Q': 778, 'R': 722, 'S': 667, 'T': 611, 'U': 722, 'V': 667, 'W': 944, 'X': 667, 'Y': 667, 'Z': 611, '[': 333, '\\': 278, ']': 333, '^': 584, '_': 556, '`': 333, 'a': 556, 'b': 611, 'c': 556, 'd': 611, 'e': 556, 'f': 333, 'g': 611, 'h': 611, 'i': 278, 'j': 278, 'k': 556, 'l': 278, 'm': 889, 'n': 611, 'o': 611, 'p': 611, 'q': 611, 'r': 389, 's': 556, 't': 333, 'u': 611, 'v': 556, 'w': 778, 'x': 556, 'y': 556, 'z': 500, '{': 389, '|': 280, '}': 389, '~': 584, '\xa1': 333, '\xa2': 556, '\xa3': 556, '\xa4': 556, '\xa5': 556, '\xa6': 280, '\xa7': 556, '\xa8': 333, '\xa9': 737, '\xaa': 370, '\xab': 556, '\xac': 584, '\xae': 737, '\xaf': 333, '\xb0': 400, '\xb1': 584, '\xb2': 333, '\xb3': 333, '\xb4': 333, '\xb5': 611, '\xb6': 556, '\xb7': 278, '\xb8': 333, '\xb9': 333, '\xba': 365, '\xbb': 556, '\xbc': 834, '\xbd': 834, '\xbe': 834, '\xbf': 611, '\xc0': 722, '\xc1': 722, '\xc2': 722, '\xc3': 722, '\xc4': 722, '\xc5': 722, '\xc6': 1000, '\xc7': 722, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 278, '\xcd': 278, '\xce': 278, '\xcf': 278, '\xd0': 722, '\xd1': 722, '\xd2': 778, '\xd3': 778, '\xd4': 778, '\xd5': 778, '\xd6': 778, '\xd7': 584, '\xd8': 778, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 667, '\xde': 667, '\xdf': 611, '\xe0': 556, '\xe1': 556, '\xe2': 556, '\xe3': 556, '\xe4': 556, '\xe5': 556, '\xe6': 889, '\xe7': 556, '\xe8': 556, '\xe9': 556, '\xea': 556, '\xeb': 556, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 611, '\xf1': 611, '\xf2': 611, '\xf3': 611, '\xf4': 611, '\xf5': 611, '\xf6': 611, '\xf7': 584, '\xf8': 611, '\xf9': 611, '\xfa': 611, '\xfb': 611, '\xfc': 611, '\xfd': 556, '\xfe': 611, '\xff': 556, '\u0100': 722, '\u0101': 556, '\u0102': 722, '\u0103': 556, '\u0104': 722, '\u0105': 556, '\u0106': 722, '\u0107': 556, '\u010c': 722, '\u010d': 556, '\u010e': 722, '\u010f': 743, '\u0110': 722, '\u0111': 611, '\u0112': 667, '\u0113': 556, '\u0116': 667, '\u0117': 556, '\u0118': 667, '\u0119': 556, '\u011a': 667, '\u011b': 556, '\u011e': 778, '\u011f': 611, '\u0122': 778, '\u0123': 611, '\u012a': 278, '\u012b': 278, '\u012e': 278, '\u012f': 278, '\u0130': 278, '\u0131': 278, '\u0136': 722, '\u0137': 556, '\u0139': 611, '\u013a': 278, '\u013b': 611, '\u013c': 278, '\u013d': 611, '\u013e': 400, '\u0141': 611, '\u0142': 278, '\u0143': 722, '\u0144': 611, '\u0145': 722, '\u0146': 611, '\u0147': 722, '\u0148': 611, '\u014c': 778, '\u014d': 611, '\u0150': 778, '\u0151': 611, '\u0152': 1000, '\u0153': 944, '\u0154': 722, '\u0155': 389, '\u0156': 722, '\u0157': 389, '\u0158': 722, '\u0159': 389, '\u015a': 667, '\u015b': 556, '\u015e': 667, '\u015f': 556, '\u0160': 667, '\u0161': 556, '\u0162': 611, '\u0163': 333, '\u0164': 611, '\u0165': 389, '\u016a': 722, '\u016b': 611, '\u016e': 722, '\u016f': 611, '\u0170': 722, '\u0171': 611, '\u0172': 722, '\u0173': 611, '\u0178': 667, '\u0179': 611, '\u017a': 500, '\u017b': 611, '\u017c': 500, '\u017d': 611, '\u017e': 500, '\u0192': 556, '\u0218': 667, '\u0219': 556, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 556, '\u2014': 1000, '\u2018': 278, '\u2019': 278, '\u201a': 278, '\u201c': 500, '\u201d': 500, '\u201e': 500, '\u2020': 556, '\u2021': 556, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 494, '\u2206': 612, '\u2211': 600, '\u2212': 584, '\u221a': 549, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 494, '\uf6c3': 250, '\ufb01': 611, '\ufb02': 611}), 'Helvetica-BoldOblique': ({'FontName': 'Helvetica-BoldOblique', 'Descent': -207.0, 'FontBBox': (-175.0, -228.0, 1114.0, 962.0), 'FontWeight': 'Bold', 'CapHeight': 718.0, 'FontFamily': 'Helvetica', 'Flags': 0, 'XHeight': 532.0, 'ItalicAngle': -12.0, 'Ascent': 718.0}, {' ': 278, '!': 333, '"': 474, '#': 556, '$': 556, '%': 889, '&': 722, u"'": 238, '(': 333, ')': 333, '*': 389, '+': 584, ',': 278, '-': 333, '.': 278, '/': 278, '0': 556, '1': 556, '2': 556, '3': 556, '4': 556, '5': 556, '6': 556, '7': 556, '8': 556, '9': 556, ':': 333, ';': 333, '<': 584, '=': 584, '>': 584, '?': 611, '@': 975, 'A': 722, 'B': 722, 'C': 722, 'D': 722, 'E': 667, 'F': 611, 'G': 778, 'H': 722, 'I': 278, 'J': 556, 'K': 722, 'L': 611, 'M': 833, 'N': 722, 'O': 778, 'P': 667, 'Q': 778, 'R': 722, 'S': 667, 'T': 611, 'U': 722, 'V': 667, 'W': 944, 'X': 667, 'Y': 667, 'Z': 611, '[': 333, '\\': 278, ']': 333, '^': 584, '_': 556, '`': 333, 'a': 556, 'b': 611, 'c': 556, 'd': 611, 'e': 556, 'f': 333, 'g': 611, 'h': 611, 'i': 278, 'j': 278, 'k': 556, 'l': 278, 'm': 889, 'n': 611, 'o': 611, 'p': 611, 'q': 611, 'r': 389, 's': 556, 't': 333, 'u': 611, 'v': 556, 'w': 778, 'x': 556, 'y': 556, 'z': 500, '{': 389, '|': 280, '}': 389, '~': 584, '\xa1': 333, '\xa2': 556, '\xa3': 556, '\xa4': 556, '\xa5': 556, '\xa6': 280, '\xa7': 556, '\xa8': 333, '\xa9': 737, '\xaa': 370, '\xab': 556, '\xac': 584, '\xae': 737, '\xaf': 333, '\xb0': 400, '\xb1': 584, '\xb2': 333, '\xb3': 333, '\xb4': 333, '\xb5': 611, '\xb6': 556, '\xb7': 278, '\xb8': 333, '\xb9': 333, '\xba': 365, '\xbb': 556, '\xbc': 834, '\xbd': 834, '\xbe': 834, '\xbf': 611, '\xc0': 722, '\xc1': 722, '\xc2': 722, '\xc3': 722, '\xc4': 722, '\xc5': 722, '\xc6': 1000, '\xc7': 722, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 278, '\xcd': 278, '\xce': 278, '\xcf': 278, '\xd0': 722, '\xd1': 722, '\xd2': 778, '\xd3': 778, '\xd4': 778, '\xd5': 778, '\xd6': 778, '\xd7': 584, '\xd8': 778, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 667, '\xde': 667, '\xdf': 611, '\xe0': 556, '\xe1': 556, '\xe2': 556, '\xe3': 556, '\xe4': 556, '\xe5': 556, '\xe6': 889, '\xe7': 556, '\xe8': 556, '\xe9': 556, '\xea': 556, '\xeb': 556, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 611, '\xf1': 611, '\xf2': 611, '\xf3': 611, '\xf4': 611, '\xf5': 611, '\xf6': 611, '\xf7': 584, '\xf8': 611, '\xf9': 611, '\xfa': 611, '\xfb': 611, '\xfc': 611, '\xfd': 556, '\xfe': 611, '\xff': 556, '\u0100': 722, '\u0101': 556, '\u0102': 722, '\u0103': 556, '\u0104': 722, '\u0105': 556, '\u0106': 722, '\u0107': 556, '\u010c': 722, '\u010d': 556, '\u010e': 722, '\u010f': 743, '\u0110': 722, '\u0111': 611, '\u0112': 667, '\u0113': 556, '\u0116': 667, '\u0117': 556, '\u0118': 667, '\u0119': 556, '\u011a': 667, '\u011b': 556, '\u011e': 778, '\u011f': 611, '\u0122': 778, '\u0123': 611, '\u012a': 278, '\u012b': 278, '\u012e': 278, '\u012f': 278, '\u0130': 278, '\u0131': 278, '\u0136': 722, '\u0137': 556, '\u0139': 611, '\u013a': 278, '\u013b': 611, '\u013c': 278, '\u013d': 611, '\u013e': 400, '\u0141': 611, '\u0142': 278, '\u0143': 722, '\u0144': 611, '\u0145': 722, '\u0146': 611, '\u0147': 722, '\u0148': 611, '\u014c': 778, '\u014d': 611, '\u0150': 778, '\u0151': 611, '\u0152': 1000, '\u0153': 944, '\u0154': 722, '\u0155': 389, '\u0156': 722, '\u0157': 389, '\u0158': 722, '\u0159': 389, '\u015a': 667, '\u015b': 556, '\u015e': 667, '\u015f': 556, '\u0160': 667, '\u0161': 556, '\u0162': 611, '\u0163': 333, '\u0164': 611, '\u0165': 389, '\u016a': 722, '\u016b': 611, '\u016e': 722, '\u016f': 611, '\u0170': 722, '\u0171': 611, '\u0172': 722, '\u0173': 611, '\u0178': 667, '\u0179': 611, '\u017a': 500, '\u017b': 611, '\u017c': 500, '\u017d': 611, '\u017e': 500, '\u0192': 556, '\u0218': 667, '\u0219': 556, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 556, '\u2014': 1000, '\u2018': 278, '\u2019': 278, '\u201a': 278, '\u201c': 500, '\u201d': 500, '\u201e': 500, '\u2020': 556, '\u2021': 556, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 494, '\u2206': 612, '\u2211': 600, '\u2212': 584, '\u221a': 549, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 494, '\uf6c3': 250, '\ufb01': 611, '\ufb02': 611}), 'Helvetica-Oblique': ({'FontName': 'Helvetica-Oblique', 'Descent': -207.0, 'FontBBox': (-171.0, -225.0, 1116.0, 931.0), 'FontWeight': 'Medium', 'CapHeight': 718.0, 'FontFamily': 'Helvetica', 'Flags': 0, 'XHeight': 523.0, 'ItalicAngle': -12.0, 'Ascent': 718.0}, {' ': 278, '!': 278, '"': 355, '#': 556, '$': 556, '%': 889, '&': 667, u"'": 191, '(': 333, ')': 333, '*': 389, '+': 584, ',': 278, '-': 333, '.': 278, '/': 278, '0': 556, '1': 556, '2': 556, '3': 556, '4': 556, '5': 556, '6': 556, '7': 556, '8': 556, '9': 556, ':': 278, ';': 278, '<': 584, '=': 584, '>': 584, '?': 556, '@': 1015, 'A': 667, 'B': 667, 'C': 722, 'D': 722, 'E': 667, 'F': 611, 'G': 778, 'H': 722, 'I': 278, 'J': 500, 'K': 667, 'L': 556, 'M': 833, 'N': 722, 'O': 778, 'P': 667, 'Q': 778, 'R': 722, 'S': 667, 'T': 611, 'U': 722, 'V': 667, 'W': 944, 'X': 667, 'Y': 667, 'Z': 611, '[': 278, '\\': 278, ']': 278, '^': 469, '_': 556, '`': 333, 'a': 556, 'b': 556, 'c': 500, 'd': 556, 'e': 556, 'f': 278, 'g': 556, 'h': 556, 'i': 222, 'j': 222, 'k': 500, 'l': 222, 'm': 833, 'n': 556, 'o': 556, 'p': 556, 'q': 556, 'r': 333, 's': 500, 't': 278, 'u': 556, 'v': 500, 'w': 722, 'x': 500, 'y': 500, 'z': 500, '{': 334, '|': 260, '}': 334, '~': 584, '\xa1': 333, '\xa2': 556, '\xa3': 556, '\xa4': 556, '\xa5': 556, '\xa6': 260, '\xa7': 556, '\xa8': 333, '\xa9': 737, '\xaa': 370, '\xab': 556, '\xac': 584, '\xae': 737, '\xaf': 333, '\xb0': 400, '\xb1': 584, '\xb2': 333, '\xb3': 333, '\xb4': 333, '\xb5': 556, '\xb6': 537, '\xb7': 278, '\xb8': 333, '\xb9': 333, '\xba': 365, '\xbb': 556, '\xbc': 834, '\xbd': 834, '\xbe': 834, '\xbf': 611, '\xc0': 667, '\xc1': 667, '\xc2': 667, '\xc3': 667, '\xc4': 667, '\xc5': 667, '\xc6': 1000, '\xc7': 722, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 278, '\xcd': 278, '\xce': 278, '\xcf': 278, '\xd0': 722, '\xd1': 722, '\xd2': 778, '\xd3': 778, '\xd4': 778, '\xd5': 778, '\xd6': 778, '\xd7': 584, '\xd8': 778, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 667, '\xde': 667, '\xdf': 611, '\xe0': 556, '\xe1': 556, '\xe2': 556, '\xe3': 556, '\xe4': 556, '\xe5': 556, '\xe6': 889, '\xe7': 500, '\xe8': 556, '\xe9': 556, '\xea': 556, '\xeb': 556, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 556, '\xf1': 556, '\xf2': 556, '\xf3': 556, '\xf4': 556, '\xf5': 556, '\xf6': 556, '\xf7': 584, '\xf8': 611, '\xf9': 556, '\xfa': 556, '\xfb': 556, '\xfc': 556, '\xfd': 500, '\xfe': 556, '\xff': 500, '\u0100': 667, '\u0101': 556, '\u0102': 667, '\u0103': 556, '\u0104': 667, '\u0105': 556, '\u0106': 722, '\u0107': 500, '\u010c': 722, '\u010d': 500, '\u010e': 722, '\u010f': 643, '\u0110': 722, '\u0111': 556, '\u0112': 667, '\u0113': 556, '\u0116': 667, '\u0117': 556, '\u0118': 667, '\u0119': 556, '\u011a': 667, '\u011b': 556, '\u011e': 778, '\u011f': 556, '\u0122': 778, '\u0123': 556, '\u012a': 278, '\u012b': 278, '\u012e': 278, '\u012f': 222, '\u0130': 278, '\u0131': 278, '\u0136': 667, '\u0137': 500, '\u0139': 556, '\u013a': 222, '\u013b': 556, '\u013c': 222, '\u013d': 556, '\u013e': 299, '\u0141': 556, '\u0142': 222, '\u0143': 722, '\u0144': 556, '\u0145': 722, '\u0146': 556, '\u0147': 722, '\u0148': 556, '\u014c': 778, '\u014d': 556, '\u0150': 778, '\u0151': 556, '\u0152': 1000, '\u0153': 944, '\u0154': 722, '\u0155': 333, '\u0156': 722, '\u0157': 333, '\u0158': 722, '\u0159': 333, '\u015a': 667, '\u015b': 500, '\u015e': 667, '\u015f': 500, '\u0160': 667, '\u0161': 500, '\u0162': 611, '\u0163': 278, '\u0164': 611, '\u0165': 317, '\u016a': 722, '\u016b': 556, '\u016e': 722, '\u016f': 556, '\u0170': 722, '\u0171': 556, '\u0172': 722, '\u0173': 556, '\u0178': 667, '\u0179': 611, '\u017a': 500, '\u017b': 611, '\u017c': 500, '\u017d': 611, '\u017e': 500, '\u0192': 556, '\u0218': 667, '\u0219': 500, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 556, '\u2014': 1000, '\u2018': 222, '\u2019': 222, '\u201a': 222, '\u201c': 333, '\u201d': 333, '\u201e': 333, '\u2020': 556, '\u2021': 556, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 476, '\u2206': 612, '\u2211': 600, '\u2212': 584, '\u221a': 453, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 471, '\uf6c3': 250, '\ufb01': 500, '\ufb02': 500}), 'Symbol': ({'FontName': 'Symbol', 'FontBBox': (-180.0, -293.0, 1090.0, 1010.0), 'FontWeight': 'Medium', 'FontFamily': 'Symbol', 'Flags': 0, 'ItalicAngle': 0.0}, {' ': 250, '!': 333, '#': 500, '%': 833, '&': 778, '(': 333, ')': 333, '+': 549, ',': 250, '.': 250, '/': 278, '0': 500, '1': 500, '2': 500, '3': 500, '4': 500, '5': 500, '6': 500, '7': 500, '8': 500, '9': 500, ':': 278, ';': 278, '<': 549, '=': 549, '>': 549, '?': 444, '[': 333, ']': 333, '_': 500, '{': 480, '|': 200, '}': 480, '\xac': 713, '\xb0': 400, '\xb1': 549, '\xb5': 576, '\xd7': 549, '\xf7': 549, '\u0192': 500, '\u0391': 722, '\u0392': 667, '\u0393': 603, '\u0395': 611, '\u0396': 611, '\u0397': 722, '\u0398': 741, '\u0399': 333, '\u039a': 722, '\u039b': 686, '\u039c': 889, '\u039d': 722, '\u039e': 645, '\u039f': 722, '\u03a0': 768, '\u03a1': 556, '\u03a3': 592, '\u03a4': 611, '\u03a5': 690, '\u03a6': 763, '\u03a7': 722, '\u03a8': 795, '\u03b1': 631, '\u03b2': 549, '\u03b3': 411, '\u03b4': 494, '\u03b5': 439, '\u03b6': 494, '\u03b7': 603, '\u03b8': 521, '\u03b9': 329, '\u03ba': 549, '\u03bb': 549, '\u03bd': 521, '\u03be': 493, '\u03bf': 549, '\u03c0': 549, '\u03c1': 549, '\u03c2': 439, '\u03c3': 603, '\u03c4': 439, '\u03c5': 576, '\u03c6': 521, '\u03c7': 549, '\u03c8': 686, '\u03c9': 686, '\u03d1': 631, '\u03d2': 620, '\u03d5': 603, '\u03d6': 713, '\u2022': 460, '\u2026': 1000, '\u2032': 247, '\u2033': 411, '\u2044': 167, '\u20ac': 750, '\u2111': 686, '\u2118': 987, '\u211c': 795, '\u2126': 768, '\u2135': 823, '\u2190': 987, '\u2191': 603, '\u2192': 987, '\u2193': 603, '\u2194': 1042, '\u21b5': 658, '\u21d0': 987, '\u21d1': 603, '\u21d2': 987, '\u21d3': 603, '\u21d4': 1042, '\u2200': 713, '\u2202': 494, '\u2203': 549, '\u2205': 823, '\u2206': 612, '\u2207': 713, '\u2208': 713, '\u2209': 713, '\u220b': 439, '\u220f': 823, '\u2211': 713, '\u2212': 549, '\u2217': 500, '\u221a': 549, '\u221d': 713, '\u221e': 713, '\u2220': 768, '\u2227': 603, '\u2228': 603, '\u2229': 768, '\u222a': 768, '\u222b': 274, '\u2234': 863, '\u223c': 549, '\u2245': 549, '\u2248': 549, '\u2260': 549, '\u2261': 549, '\u2264': 549, '\u2265': 549, '\u2282': 713, '\u2283': 713, '\u2284': 713, '\u2286': 713, '\u2287': 713, '\u2295': 768, '\u2297': 768, '\u22a5': 658, '\u22c5': 250, '\u2320': 686, '\u2321': 686, '\u2329': 329, '\u232a': 329, '\u25ca': 494, '\u2660': 753, '\u2663': 753, '\u2665': 753, '\u2666': 753, '\uf6d9': 790, '\uf6da': 790, '\uf6db': 890, '\uf8e5': 500, '\uf8e6': 603, '\uf8e7': 1000, '\uf8e8': 790, '\uf8e9': 790, '\uf8ea': 786, '\uf8eb': 384, '\uf8ec': 384, '\uf8ed': 384, '\uf8ee': 384, '\uf8ef': 384, '\uf8f0': 384, '\uf8f1': 494, '\uf8f2': 494, '\uf8f3': 494, '\uf8f4': 494, '\uf8f5': 686, '\uf8f6': 384, '\uf8f7': 384, '\uf8f8': 384, '\uf8f9': 384, '\uf8fa': 384, '\uf8fb': 384, '\uf8fc': 494, '\uf8fd': 494, '\uf8fe': 494, '\uf8ff': 790}), 'Times-Bold': ({'FontName': 'Times-Bold', 'Descent': -217.0, 'FontBBox': (-168.0, -218.0, 1000.0, 935.0), 'FontWeight': 'Bold', 'CapHeight': 676.0, 'FontFamily': 'Times', 'Flags': 0, 'XHeight': 461.0, 'ItalicAngle': 0.0, 'Ascent': 683.0}, {' ': 250, '!': 333, '"': 555, '#': 500, '$': 500, '%': 1000, '&': 833, u"'": 278, '(': 333, ')': 333, '*': 500, '+': 570, ',': 250, '-': 333, '.': 250, '/': 278, '0': 500, '1': 500, '2': 500, '3': 500, '4': 500, '5': 500, '6': 500, '7': 500, '8': 500, '9': 500, ':': 333, ';': 333, '<': 570, '=': 570, '>': 570, '?': 500, '@': 930, 'A': 722, 'B': 667, 'C': 722, 'D': 722, 'E': 667, 'F': 611, 'G': 778, 'H': 778, 'I': 389, 'J': 500, 'K': 778, 'L': 667, 'M': 944, 'N': 722, 'O': 778, 'P': 611, 'Q': 778, 'R': 722, 'S': 556, 'T': 667, 'U': 722, 'V': 722, 'W': 1000, 'X': 722, 'Y': 722, 'Z': 667, '[': 333, '\\': 278, ']': 333, '^': 581, '_': 500, '`': 333, 'a': 500, 'b': 556, 'c': 444, 'd': 556, 'e': 444, 'f': 333, 'g': 500, 'h': 556, 'i': 278, 'j': 333, 'k': 556, 'l': 278, 'm': 833, 'n': 556, 'o': 500, 'p': 556, 'q': 556, 'r': 444, 's': 389, 't': 333, 'u': 556, 'v': 500, 'w': 722, 'x': 500, 'y': 500, 'z': 444, '{': 394, '|': 220, '}': 394, '~': 520, '\xa1': 333, '\xa2': 500, '\xa3': 500, '\xa4': 500, '\xa5': 500, '\xa6': 220, '\xa7': 500, '\xa8': 333, '\xa9': 747, '\xaa': 300, '\xab': 500, '\xac': 570, '\xae': 747, '\xaf': 333, '\xb0': 400, '\xb1': 570, '\xb2': 300, '\xb3': 300, '\xb4': 333, '\xb5': 556, '\xb6': 540, '\xb7': 250, '\xb8': 333, '\xb9': 300, '\xba': 330, '\xbb': 500, '\xbc': 750, '\xbd': 750, '\xbe': 750, '\xbf': 500, '\xc0': 722, '\xc1': 722, '\xc2': 722, '\xc3': 722, '\xc4': 722, '\xc5': 722, '\xc6': 1000, '\xc7': 722, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 389, '\xcd': 389, '\xce': 389, '\xcf': 389, '\xd0': 722, '\xd1': 722, '\xd2': 778, '\xd3': 778, '\xd4': 778, '\xd5': 778, '\xd6': 778, '\xd7': 570, '\xd8': 778, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 722, '\xde': 611, '\xdf': 556, '\xe0': 500, '\xe1': 500, '\xe2': 500, '\xe3': 500, '\xe4': 500, '\xe5': 500, '\xe6': 722, '\xe7': 444, '\xe8': 444, '\xe9': 444, '\xea': 444, '\xeb': 444, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 500, '\xf1': 556, '\xf2': 500, '\xf3': 500, '\xf4': 500, '\xf5': 500, '\xf6': 500, '\xf7': 570, '\xf8': 500, '\xf9': 556, '\xfa': 556, '\xfb': 556, '\xfc': 556, '\xfd': 500, '\xfe': 556, '\xff': 500, '\u0100': 722, '\u0101': 500, '\u0102': 722, '\u0103': 500, '\u0104': 722, '\u0105': 500, '\u0106': 722, '\u0107': 444, '\u010c': 722, '\u010d': 444, '\u010e': 722, '\u010f': 672, '\u0110': 722, '\u0111': 556, '\u0112': 667, '\u0113': 444, '\u0116': 667, '\u0117': 444, '\u0118': 667, '\u0119': 444, '\u011a': 667, '\u011b': 444, '\u011e': 778, '\u011f': 500, '\u0122': 778, '\u0123': 500, '\u012a': 389, '\u012b': 278, '\u012e': 389, '\u012f': 278, '\u0130': 389, '\u0131': 278, '\u0136': 778, '\u0137': 556, '\u0139': 667, '\u013a': 278, '\u013b': 667, '\u013c': 278, '\u013d': 667, '\u013e': 394, '\u0141': 667, '\u0142': 278, '\u0143': 722, '\u0144': 556, '\u0145': 722, '\u0146': 556, '\u0147': 722, '\u0148': 556, '\u014c': 778, '\u014d': 500, '\u0150': 778, '\u0151': 500, '\u0152': 1000, '\u0153': 722, '\u0154': 722, '\u0155': 444, '\u0156': 722, '\u0157': 444, '\u0158': 722, '\u0159': 444, '\u015a': 556, '\u015b': 389, '\u015e': 556, '\u015f': 389, '\u0160': 556, '\u0161': 389, '\u0162': 667, '\u0163': 333, '\u0164': 667, '\u0165': 416, '\u016a': 722, '\u016b': 556, '\u016e': 722, '\u016f': 556, '\u0170': 722, '\u0171': 556, '\u0172': 722, '\u0173': 556, '\u0178': 722, '\u0179': 667, '\u017a': 444, '\u017b': 667, '\u017c': 444, '\u017d': 667, '\u017e': 444, '\u0192': 500, '\u0218': 556, '\u0219': 389, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 500, '\u2014': 1000, '\u2018': 333, '\u2019': 333, '\u201a': 333, '\u201c': 500, '\u201d': 500, '\u201e': 500, '\u2020': 500, '\u2021': 500, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 494, '\u2206': 612, '\u2211': 600, '\u2212': 570, '\u221a': 549, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 494, '\uf6c3': 250, '\ufb01': 556, '\ufb02': 556}), 'Times-BoldItalic': ({'FontName': 'Times-BoldItalic', 'Descent': -217.0, 'FontBBox': (-200.0, -218.0, 996.0, 921.0), 'FontWeight': 'Bold', 'CapHeight': 669.0, 'FontFamily': 'Times', 'Flags': 0, 'XHeight': 462.0, 'ItalicAngle': -15.0, 'Ascent': 683.0}, {' ': 250, '!': 389, '"': 555, '#': 500, '$': 500, '%': 833, '&': 778, u"'": 278, '(': 333, ')': 333, '*': 500, '+': 570, ',': 250, '-': 333, '.': 250, '/': 278, '0': 500, '1': 500, '2': 500, '3': 500, '4': 500, '5': 500, '6': 500, '7': 500, '8': 500, '9': 500, ':': 333, ';': 333, '<': 570, '=': 570, '>': 570, '?': 500, '@': 832, 'A': 667, 'B': 667, 'C': 667, 'D': 722, 'E': 667, 'F': 667, 'G': 722, 'H': 778, 'I': 389, 'J': 500, 'K': 667, 'L': 611, 'M': 889, 'N': 722, 'O': 722, 'P': 611, 'Q': 722, 'R': 667, 'S': 556, 'T': 611, 'U': 722, 'V': 667, 'W': 889, 'X': 667, 'Y': 611, 'Z': 611, '[': 333, '\\': 278, ']': 333, '^': 570, '_': 500, '`': 333, 'a': 500, 'b': 500, 'c': 444, 'd': 500, 'e': 444, 'f': 333, 'g': 500, 'h': 556, 'i': 278, 'j': 278, 'k': 500, 'l': 278, 'm': 778, 'n': 556, 'o': 500, 'p': 500, 'q': 500, 'r': 389, 's': 389, 't': 278, 'u': 556, 'v': 444, 'w': 667, 'x': 500, 'y': 444, 'z': 389, '{': 348, '|': 220, '}': 348, '~': 570, '\xa1': 389, '\xa2': 500, '\xa3': 500, '\xa4': 500, '\xa5': 500, '\xa6': 220, '\xa7': 500, '\xa8': 333, '\xa9': 747, '\xaa': 266, '\xab': 500, '\xac': 606, '\xae': 747, '\xaf': 333, '\xb0': 400, '\xb1': 570, '\xb2': 300, '\xb3': 300, '\xb4': 333, '\xb5': 576, '\xb6': 500, '\xb7': 250, '\xb8': 333, '\xb9': 300, '\xba': 300, '\xbb': 500, '\xbc': 750, '\xbd': 750, '\xbe': 750, '\xbf': 500, '\xc0': 667, '\xc1': 667, '\xc2': 667, '\xc3': 667, '\xc4': 667, '\xc5': 667, '\xc6': 944, '\xc7': 667, '\xc8': 667, '\xc9': 667, '\xca': 667, '\xcb': 667, '\xcc': 389, '\xcd': 389, '\xce': 389, '\xcf': 389, '\xd0': 722, '\xd1': 722, '\xd2': 722, '\xd3': 722, '\xd4': 722, '\xd5': 722, '\xd6': 722, '\xd7': 570, '\xd8': 722, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 611, '\xde': 611, '\xdf': 500, '\xe0': 500, '\xe1': 500, '\xe2': 500, '\xe3': 500, '\xe4': 500, '\xe5': 500, '\xe6': 722, '\xe7': 444, '\xe8': 444, '\xe9': 444, '\xea': 444, '\xeb': 444, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 500, '\xf1': 556, '\xf2': 500, '\xf3': 500, '\xf4': 500, '\xf5': 500, '\xf6': 500, '\xf7': 570, '\xf8': 500, '\xf9': 556, '\xfa': 556, '\xfb': 556, '\xfc': 556, '\xfd': 444, '\xfe': 500, '\xff': 444, '\u0100': 667, '\u0101': 500, '\u0102': 667, '\u0103': 500, '\u0104': 667, '\u0105': 500, '\u0106': 667, '\u0107': 444, '\u010c': 667, '\u010d': 444, '\u010e': 722, '\u010f': 608, '\u0110': 722, '\u0111': 500, '\u0112': 667, '\u0113': 444, '\u0116': 667, '\u0117': 444, '\u0118': 667, '\u0119': 444, '\u011a': 667, '\u011b': 444, '\u011e': 722, '\u011f': 500, '\u0122': 722, '\u0123': 500, '\u012a': 389, '\u012b': 278, '\u012e': 389, '\u012f': 278, '\u0130': 389, '\u0131': 278, '\u0136': 667, '\u0137': 500, '\u0139': 611, '\u013a': 278, '\u013b': 611, '\u013c': 278, '\u013d': 611, '\u013e': 382, '\u0141': 611, '\u0142': 278, '\u0143': 722, '\u0144': 556, '\u0145': 722, '\u0146': 556, '\u0147': 722, '\u0148': 556, '\u014c': 722, '\u014d': 500, '\u0150': 722, '\u0151': 500, '\u0152': 944, '\u0153': 722, '\u0154': 667, '\u0155': 389, '\u0156': 667, '\u0157': 389, '\u0158': 667, '\u0159': 389, '\u015a': 556, '\u015b': 389, '\u015e': 556, '\u015f': 389, '\u0160': 556, '\u0161': 389, '\u0162': 611, '\u0163': 278, '\u0164': 611, '\u0165': 366, '\u016a': 722, '\u016b': 556, '\u016e': 722, '\u016f': 556, '\u0170': 722, '\u0171': 556, '\u0172': 722, '\u0173': 556, '\u0178': 611, '\u0179': 611, '\u017a': 389, '\u017b': 611, '\u017c': 389, '\u017d': 611, '\u017e': 389, '\u0192': 500, '\u0218': 556, '\u0219': 389, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 500, '\u2014': 1000, '\u2018': 333, '\u2019': 333, '\u201a': 333, '\u201c': 500, '\u201d': 500, '\u201e': 500, '\u2020': 500, '\u2021': 500, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 1000, '\u2202': 494, '\u2206': 612, '\u2211': 600, '\u2212': 606, '\u221a': 549, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 494, '\uf6c3': 250, '\ufb01': 556, '\ufb02': 556}), 'Times-Italic': ({'FontName': 'Times-Italic', 'Descent': -217.0, 'FontBBox': (-169.0, -217.0, 1010.0, 883.0), 'FontWeight': 'Medium', 'CapHeight': 653.0, 'FontFamily': 'Times', 'Flags': 0, 'XHeight': 441.0, 'ItalicAngle': -15.5, 'Ascent': 683.0}, {' ': 250, '!': 333, '"': 420, '#': 500, '$': 500, '%': 833, '&': 778, u"'": 214, '(': 333, ')': 333, '*': 500, '+': 675, ',': 250, '-': 333, '.': 250, '/': 278, '0': 500, '1': 500, '2': 500, '3': 500, '4': 500, '5': 500, '6': 500, '7': 500, '8': 500, '9': 500, ':': 333, ';': 333, '<': 675, '=': 675, '>': 675, '?': 500, '@': 920, 'A': 611, 'B': 611, 'C': 667, 'D': 722, 'E': 611, 'F': 611, 'G': 722, 'H': 722, 'I': 333, 'J': 444, 'K': 667, 'L': 556, 'M': 833, 'N': 667, 'O': 722, 'P': 611, 'Q': 722, 'R': 611, 'S': 500, 'T': 556, 'U': 722, 'V': 611, 'W': 833, 'X': 611, 'Y': 556, 'Z': 556, '[': 389, '\\': 278, ']': 389, '^': 422, '_': 500, '`': 333, 'a': 500, 'b': 500, 'c': 444, 'd': 500, 'e': 444, 'f': 278, 'g': 500, 'h': 500, 'i': 278, 'j': 278, 'k': 444, 'l': 278, 'm': 722, 'n': 500, 'o': 500, 'p': 500, 'q': 500, 'r': 389, 's': 389, 't': 278, 'u': 500, 'v': 444, 'w': 667, 'x': 444, 'y': 444, 'z': 389, '{': 400, '|': 275, '}': 400, '~': 541, '\xa1': 389, '\xa2': 500, '\xa3': 500, '\xa4': 500, '\xa5': 500, '\xa6': 275, '\xa7': 500, '\xa8': 333, '\xa9': 760, '\xaa': 276, '\xab': 500, '\xac': 675, '\xae': 760, '\xaf': 333, '\xb0': 400, '\xb1': 675, '\xb2': 300, '\xb3': 300, '\xb4': 333, '\xb5': 500, '\xb6': 523, '\xb7': 250, '\xb8': 333, '\xb9': 300, '\xba': 310, '\xbb': 500, '\xbc': 750, '\xbd': 750, '\xbe': 750, '\xbf': 500, '\xc0': 611, '\xc1': 611, '\xc2': 611, '\xc3': 611, '\xc4': 611, '\xc5': 611, '\xc6': 889, '\xc7': 667, '\xc8': 611, '\xc9': 611, '\xca': 611, '\xcb': 611, '\xcc': 333, '\xcd': 333, '\xce': 333, '\xcf': 333, '\xd0': 722, '\xd1': 667, '\xd2': 722, '\xd3': 722, '\xd4': 722, '\xd5': 722, '\xd6': 722, '\xd7': 675, '\xd8': 722, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 556, '\xde': 611, '\xdf': 500, '\xe0': 500, '\xe1': 500, '\xe2': 500, '\xe3': 500, '\xe4': 500, '\xe5': 500, '\xe6': 667, '\xe7': 444, '\xe8': 444, '\xe9': 444, '\xea': 444, '\xeb': 444, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 500, '\xf1': 500, '\xf2': 500, '\xf3': 500, '\xf4': 500, '\xf5': 500, '\xf6': 500, '\xf7': 675, '\xf8': 500, '\xf9': 500, '\xfa': 500, '\xfb': 500, '\xfc': 500, '\xfd': 444, '\xfe': 500, '\xff': 444, '\u0100': 611, '\u0101': 500, '\u0102': 611, '\u0103': 500, '\u0104': 611, '\u0105': 500, '\u0106': 667, '\u0107': 444, '\u010c': 667, '\u010d': 444, '\u010e': 722, '\u010f': 544, '\u0110': 722, '\u0111': 500, '\u0112': 611, '\u0113': 444, '\u0116': 611, '\u0117': 444, '\u0118': 611, '\u0119': 444, '\u011a': 611, '\u011b': 444, '\u011e': 722, '\u011f': 500, '\u0122': 722, '\u0123': 500, '\u012a': 333, '\u012b': 278, '\u012e': 333, '\u012f': 278, '\u0130': 333, '\u0131': 278, '\u0136': 667, '\u0137': 444, '\u0139': 556, '\u013a': 278, '\u013b': 556, '\u013c': 278, '\u013d': 611, '\u013e': 300, '\u0141': 556, '\u0142': 278, '\u0143': 667, '\u0144': 500, '\u0145': 667, '\u0146': 500, '\u0147': 667, '\u0148': 500, '\u014c': 722, '\u014d': 500, '\u0150': 722, '\u0151': 500, '\u0152': 944, '\u0153': 667, '\u0154': 611, '\u0155': 389, '\u0156': 611, '\u0157': 389, '\u0158': 611, '\u0159': 389, '\u015a': 500, '\u015b': 389, '\u015e': 500, '\u015f': 389, '\u0160': 500, '\u0161': 389, '\u0162': 556, '\u0163': 278, '\u0164': 556, '\u0165': 300, '\u016a': 722, '\u016b': 500, '\u016e': 722, '\u016f': 500, '\u0170': 722, '\u0171': 500, '\u0172': 722, '\u0173': 500, '\u0178': 556, '\u0179': 556, '\u017a': 389, '\u017b': 556, '\u017c': 389, '\u017d': 556, '\u017e': 389, '\u0192': 500, '\u0218': 500, '\u0219': 389, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 500, '\u2014': 889, '\u2018': 333, '\u2019': 333, '\u201a': 333, '\u201c': 556, '\u201d': 556, '\u201e': 556, '\u2020': 500, '\u2021': 500, '\u2022': 350, '\u2026': 889, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 980, '\u2202': 476, '\u2206': 612, '\u2211': 600, '\u2212': 675, '\u221a': 453, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 471, '\uf6c3': 250, '\ufb01': 500, '\ufb02': 500}), 'Times-Roman': ({'FontName': 'Times-Roman', 'Descent': -217.0, 'FontBBox': (-168.0, -218.0, 1000.0, 898.0), 'FontWeight': 'Roman', 'CapHeight': 662.0, 'FontFamily': 'Times', 'Flags': 0, 'XHeight': 450.0, 'ItalicAngle': 0.0, 'Ascent': 683.0}, {' ': 250, '!': 333, '"': 408, '#': 500, '$': 500, '%': 833, '&': 778, u"'": 180, '(': 333, ')': 333, '*': 500, '+': 564, ',': 250, '-': 333, '.': 250, '/': 278, '0': 500, '1': 500, '2': 500, '3': 500, '4': 500, '5': 500, '6': 500, '7': 500, '8': 500, '9': 500, ':': 278, ';': 278, '<': 564, '=': 564, '>': 564, '?': 444, '@': 921, 'A': 722, 'B': 667, 'C': 667, 'D': 722, 'E': 611, 'F': 556, 'G': 722, 'H': 722, 'I': 333, 'J': 389, 'K': 722, 'L': 611, 'M': 889, 'N': 722, 'O': 722, 'P': 556, 'Q': 722, 'R': 667, 'S': 556, 'T': 611, 'U': 722, 'V': 722, 'W': 944, 'X': 722, 'Y': 722, 'Z': 611, '[': 333, '\\': 278, ']': 333, '^': 469, '_': 500, '`': 333, 'a': 444, 'b': 500, 'c': 444, 'd': 500, 'e': 444, 'f': 333, 'g': 500, 'h': 500, 'i': 278, 'j': 278, 'k': 500, 'l': 278, 'm': 778, 'n': 500, 'o': 500, 'p': 500, 'q': 500, 'r': 333, 's': 389, 't': 278, 'u': 500, 'v': 500, 'w': 722, 'x': 500, 'y': 500, 'z': 444, '{': 480, '|': 200, '}': 480, '~': 541, '\xa1': 333, '\xa2': 500, '\xa3': 500, '\xa4': 500, '\xa5': 500, '\xa6': 200, '\xa7': 500, '\xa8': 333, '\xa9': 760, '\xaa': 276, '\xab': 500, '\xac': 564, '\xae': 760, '\xaf': 333, '\xb0': 400, '\xb1': 564, '\xb2': 300, '\xb3': 300, '\xb4': 333, '\xb5': 500, '\xb6': 453, '\xb7': 250, '\xb8': 333, '\xb9': 300, '\xba': 310, '\xbb': 500, '\xbc': 750, '\xbd': 750, '\xbe': 750, '\xbf': 444, '\xc0': 722, '\xc1': 722, '\xc2': 722, '\xc3': 722, '\xc4': 722, '\xc5': 722, '\xc6': 889, '\xc7': 667, '\xc8': 611, '\xc9': 611, '\xca': 611, '\xcb': 611, '\xcc': 333, '\xcd': 333, '\xce': 333, '\xcf': 333, '\xd0': 722, '\xd1': 722, '\xd2': 722, '\xd3': 722, '\xd4': 722, '\xd5': 722, '\xd6': 722, '\xd7': 564, '\xd8': 722, '\xd9': 722, '\xda': 722, '\xdb': 722, '\xdc': 722, '\xdd': 722, '\xde': 556, '\xdf': 500, '\xe0': 444, '\xe1': 444, '\xe2': 444, '\xe3': 444, '\xe4': 444, '\xe5': 444, '\xe6': 667, '\xe7': 444, '\xe8': 444, '\xe9': 444, '\xea': 444, '\xeb': 444, '\xec': 278, '\xed': 278, '\xee': 278, '\xef': 278, '\xf0': 500, '\xf1': 500, '\xf2': 500, '\xf3': 500, '\xf4': 500, '\xf5': 500, '\xf6': 500, '\xf7': 564, '\xf8': 500, '\xf9': 500, '\xfa': 500, '\xfb': 500, '\xfc': 500, '\xfd': 500, '\xfe': 500, '\xff': 500, '\u0100': 722, '\u0101': 444, '\u0102': 722, '\u0103': 444, '\u0104': 722, '\u0105': 444, '\u0106': 667, '\u0107': 444, '\u010c': 667, '\u010d': 444, '\u010e': 722, '\u010f': 588, '\u0110': 722, '\u0111': 500, '\u0112': 611, '\u0113': 444, '\u0116': 611, '\u0117': 444, '\u0118': 611, '\u0119': 444, '\u011a': 611, '\u011b': 444, '\u011e': 722, '\u011f': 500, '\u0122': 722, '\u0123': 500, '\u012a': 333, '\u012b': 278, '\u012e': 333, '\u012f': 278, '\u0130': 333, '\u0131': 278, '\u0136': 722, '\u0137': 500, '\u0139': 611, '\u013a': 278, '\u013b': 611, '\u013c': 278, '\u013d': 611, '\u013e': 344, '\u0141': 611, '\u0142': 278, '\u0143': 722, '\u0144': 500, '\u0145': 722, '\u0146': 500, '\u0147': 722, '\u0148': 500, '\u014c': 722, '\u014d': 500, '\u0150': 722, '\u0151': 500, '\u0152': 889, '\u0153': 722, '\u0154': 667, '\u0155': 333, '\u0156': 667, '\u0157': 333, '\u0158': 667, '\u0159': 333, '\u015a': 556, '\u015b': 389, '\u015e': 556, '\u015f': 389, '\u0160': 556, '\u0161': 389, '\u0162': 611, '\u0163': 278, '\u0164': 611, '\u0165': 326, '\u016a': 722, '\u016b': 500, '\u016e': 722, '\u016f': 500, '\u0170': 722, '\u0171': 500, '\u0172': 722, '\u0173': 500, '\u0178': 722, '\u0179': 611, '\u017a': 444, '\u017b': 611, '\u017c': 444, '\u017d': 611, '\u017e': 444, '\u0192': 500, '\u0218': 556, '\u0219': 389, '\u02c6': 333, '\u02c7': 333, '\u02d8': 333, '\u02d9': 333, '\u02da': 333, '\u02db': 333, '\u02dc': 333, '\u02dd': 333, '\u2013': 500, '\u2014': 1000, '\u2018': 333, '\u2019': 333, '\u201a': 333, '\u201c': 444, '\u201d': 444, '\u201e': 444, '\u2020': 500, '\u2021': 500, '\u2022': 350, '\u2026': 1000, '\u2030': 1000, '\u2039': 333, '\u203a': 333, '\u2044': 167, '\u2122': 980, '\u2202': 476, '\u2206': 612, '\u2211': 600, '\u2212': 564, '\u221a': 453, '\u2260': 549, '\u2264': 549, '\u2265': 549, '\u25ca': 471, '\uf6c3': 250, '\ufb01': 556, '\ufb02': 556}), 'ZapfDingbats': ({'FontName': 'ZapfDingbats', 'FontBBox': (-1.0, -143.0, 981.0, 820.0), 'FontWeight': 'Medium', 'FontFamily': 'ITC', 'Flags': 0, 'ItalicAngle': 0.0}, {u'\x01': 974, '\x02': 961, '\x03': 980, '\x04': 719, '\x05': 789, '\x06': 494, '\x07': 552, '\x08': 537, '\t': 577, '\n': 692, '\x0b': 960, '\x0c': 939, '\r': 549, '\x0e': 855, '\x0f': 911, '\x10': 933, '\x11': 945, '\x12': 974, '\x13': 755, '\x14': 846, '\x15': 762, '\x16': 761, '\x17': 571, '\x18': 677, '\x19': 763, '\x1a': 760, '\x1b': 759, '\x1c': 754, '\x1d': 786, '\x1e': 788, '\x1f': 788, ' ': 790, '!': 793, '"': 794, '#': 816, '$': 823, '%': 789, '&': 841, u"'": 823, '(': 833, ')': 816, '*': 831, '+': 923, ',': 744, '-': 723, '.': 749, '/': 790, '0': 792, '1': 695, '2': 776, '3': 768, '4': 792, '5': 759, '6': 707, '7': 708, '8': 682, '9': 701, ':': 826, ';': 815, '<': 789, '=': 789, '>': 707, '?': 687, '@': 696, 'A': 689, 'B': 786, 'C': 787, 'D': 713, 'E': 791, 'F': 785, 'G': 791, 'H': 873, 'I': 761, 'J': 762, 'K': 759, 'L': 892, 'M': 892, 'N': 788, 'O': 784, 'Q': 438, 'R': 138, 'S': 277, 'T': 415, 'U': 509, 'V': 410, 'W': 234, 'X': 234, 'Y': 390, 'Z': 390, '[': 276, '\\': 276, ']': 317, '^': 317, '_': 334, '`': 334, 'a': 392, 'b': 392, 'c': 668, 'd': 668, 'e': 732, 'f': 544, 'g': 544, 'h': 910, 'i': 911, 'j': 667, 'k': 760, 'l': 760, 'm': 626, 'n': 694, 'o': 595, 'p': 776, 'u': 690, 'v': 791, 'w': 790, 'x': 788, 'y': 788, 'z': 788, '{': 788, '|': 788, '}': 788, '~': 788, '\x7f': 788, '\x80': 788, '\x81': 788, '\x82': 788, '\x83': 788, '\x84': 788, '\x85': 788, '\x86': 788, '\x87': 788, '\x88': 788, '\x89': 788, '\x8a': 788, '\x8b': 788, '\x8c': 788, '\x8d': 788, '\x8e': 788, '\x8f': 788, '\x90': 788, '\x91': 788, '\x92': 788, '\x93': 788, '\x94': 788, '\x95': 788, '\x96': 788, '\x97': 788, '\x98': 788, '\x99': 788, '\x9a': 788, '\x9b': 788, '\x9c': 788, '\x9d': 788, '\x9e': 788, '\x9f': 788, '\xa0': 894, '\xa1': 838, '\xa2': 924, '\xa3': 1016, '\xa4': 458, '\xa5': 924, '\xa6': 918, '\xa7': 927, '\xa8': 928, '\xa9': 928, '\xaa': 834, '\xab': 873, '\xac': 828, '\xad': 924, '\xae': 917, '\xaf': 930, '\xb0': 931, '\xb1': 463, '\xb2': 883, '\xb3': 836, '\xb4': 867, '\xb5': 696, '\xb6': 874, '\xb7': 760, '\xb8': 946, '\xb9': 865, '\xba': 967, '\xbb': 831, '\xbc': 873, '\xbd': 927, '\xbe': 970, '\xbf': 918, '\xc0': 748, '\xc1': 836, '\xc2': 771, '\xc3': 888, '\xc4': 748, '\xc5': 771, '\xc6': 888, '\xc7': 867, '\xc8': 696, '\xc9': 874, '\xca': 974, '\xcb': 762, '\xcc': 759, '\xcd': 509, '\xce': 410}), }
1,233.659574
4,325
0.48503
8,492
57,982
3.309939
0.096208
0.026469
0.0333
0.035862
0.809058
0.792942
0.786431
0.772876
0.770813
0.764124
0
0.401921
0.152513
57,982
46
4,326
1,260.478261
0.170089
0.01535
0
0
0
0
0.311194
0.000736
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
10
151860f65b23bf1bd7a61586d410023364438705
125
py
Python
basic_input_and_output/comment.py
pysga1996/python-basic-programming
5fe817986fbef2649b4b03955f07b59d2a2035d8
[ "MIT" ]
null
null
null
basic_input_and_output/comment.py
pysga1996/python-basic-programming
5fe817986fbef2649b4b03955f07b59d2a2035d8
[ "MIT" ]
null
null
null
basic_input_and_output/comment.py
pysga1996/python-basic-programming
5fe817986fbef2649b4b03955f07b59d2a2035d8
[ "MIT" ]
null
null
null
# This is a comment # written in # more than just one line """ This is a comment written in more than just one line """
8.928571
25
0.672
22
125
3.818182
0.5
0.142857
0.166667
0.333333
1
1
1
1
1
1
0
0
0.256
125
13
26
9.615385
0.903226
0.848
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
10
12eea1afb82cf7d4b5fa6fe335e49c5687bbc604
1,616
py
Python
python/ccc02j1.py
ThePeeps191/dmoj-solutions
7137e945f3f595c481ad4d29e1dc3a77d8b26e55
[ "MIT" ]
1
2022-01-23T16:02:14.000Z
2022-01-23T16:02:14.000Z
python/ccc02j1.py
ThePeeps191/dmoj-solutions
7137e945f3f595c481ad4d29e1dc3a77d8b26e55
[ "MIT" ]
5
2022-01-23T00:16:49.000Z
2022-01-30T04:37:45.000Z
python/ccc02j1.py
ThePeeps191/dmoj-solutions
7137e945f3f595c481ad4d29e1dc3a77d8b26e55
[ "MIT" ]
1
2022-01-23T00:03:47.000Z
2022-01-23T00:03:47.000Z
n = int(input()) if n == 0: print(" * * *") print("* *") print("* *") print("* *") print() print("* *") print("* *") print("* *") print(" * * *") elif n == 1: print() print(" *") print(" *") print(" *") print() print(" *") print(" *") print(" *") print() elif n == 2: print(" * * *") print(" *") print(" *") print(" *") print(" * * *") print("*") print("*") print("*") print(" * * *") elif n == 3: print(" * * *") print(" *") print(" *") print(" *") print(" * * *") print(" *") print(" *") print(" *") print(" * * *") elif n == 4: print() print("* *") print("* *") print("* *") print(" * * *") print(" *") print(" *") print(" *") print() elif n == 5: print(" * * *") print("*") print("*") print("*") print(" * * *") print(" *") print(" *") print(" *") print(" * * *") elif n == 6: print(" * * *") print("*") print("*") print("*") print(" * * *") print("* *") print("* *") print("* *") print(" * * *") elif n == 7: print(" * * *") print(" *") print(" *") print(" *") print() print(" *") print(" *") print(" *") print() elif n == 8: print(" * * *") print("* *") print("* *") print("* *") print(" * * *") print("* *") print("* *") print("* *") print(" * * *") elif n == 9: print(" * * *") print("* *") print("* *") print("* *") print(" * * *") print(" *") print(" *") print(" *") print(" * * *")
16
17
0.319926
123
1,616
4.203252
0.130081
1.547389
2.030948
2.321083
0.957447
0.957447
0.957447
0.957447
0.957447
0.870406
0
0.009588
0.354579
1,616
101
18
16
0.486098
0
0
0.891089
0
0
0.307978
0
0
0
0
0
0
1
0
false
0
0
0
0
0.891089
0
0
0
null
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
12
4232dcc5194be492ead9d8fc48b3b7cd182ce8b6
6,088
py
Python
dictdata/models.py
szatjp/rabbitplan
bae942e4673863027fe7f1936e58f2d9d4ebc5c7
[ "CC0-1.0" ]
null
null
null
dictdata/models.py
szatjp/rabbitplan
bae942e4673863027fe7f1936e58f2d9d4ebc5c7
[ "CC0-1.0" ]
null
null
null
dictdata/models.py
szatjp/rabbitplan
bae942e4673863027fe7f1936e58f2d9d4ebc5c7
[ "CC0-1.0" ]
null
null
null
# coding:utf-8 from django.db import models from django.template.defaultfilters import default from django.urls import reverse # Create your models here. # 单词最大编号 class MaxNo(models.Model): flanguage = models.CharField(max_length=10) fmaxno = models.CharField(null=True,max_length=8,blank=True) fdate = models.DateTimeField(auto_now=True) # 日语单词表 class JaWord(models.Model): fwordno = models.CharField(primary_key=True,max_length=8) fword = models.CharField(max_length=30, blank=True) fpronunciation = models.CharField(null=True, max_length=30, blank=True) fwordclass = models.CharField(null=True, max_length=12, blank=True) frelaword = models.CharField(null=True, max_length=100, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') class Meta: unique_together = ("fword", "fpronunciation") def get_absolute_url(self): return reverse('jaword-detail', args=[self.fwordno]) # 中文单词表 class CnWord(models.Model): fwordno = models.CharField(primary_key=True,max_length=8) fword = models.CharField(max_length=30, blank=True) fpronunciation = models.CharField(null=True, max_length=30, blank=True) fwordclass = models.CharField(null=True, max_length=12, blank=True) frelaword = models.CharField(null=True, max_length=100, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') class Meta: unique_together = ("fword", "fpronunciation") def get_absolute_url(self): return reverse('cnword-detail', args=[self.fwordno]) # 英语单词表 class EnWord(models.Model): fwordno = models.CharField(primary_key=True,max_length=8) fword = models.CharField(max_length=30, blank=True) fpronunciation = models.CharField(null=True, max_length=30, blank=True) fwordclass = models.CharField(null=True, max_length=12, blank=True) frelaword = models.CharField(null=True, max_length=100, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') class Meta: unique_together = ("fword", "fpronunciation", "fwordclass") def get_absolute_url(self): return reverse('enword-detail', args=[self.fwordno]) # 日语例句表 class JaSentence(models.Model): fsenno = models.CharField(primary_key=True,max_length=8) fsentence = models.CharField(null=True, max_length=150, blank=True) fcntrans = models.CharField(null=True, max_length=150, blank=True) fentrans = models.CharField(null=True, max_length=150, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') # 中文例句表 class CnSentence(models.Model): fsenno = models.CharField(primary_key=True,max_length=8) fsentence = models.CharField(null=True, max_length=150, blank=True) fjptrans = models.CharField(null=True, max_length=150, blank=True) fentrans = models.CharField(null=True, max_length=150, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') # 英文例句表 class EnSentence(models.Model): fsenno = models.CharField(primary_key=True,max_length=8) fsentence = models.CharField(null=True, max_length=150, blank=True) fjptrans = models.CharField(null=True, max_length=150, blank=True) fcntrans = models.CharField(null=True, max_length=150, blank=True) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) favail = models.CharField(max_length=1,default='1') # 日文汉语互译表 class Ja2Cn(models.Model): fid = models.AutoField(primary_key=True) fjaword = models.ForeignKey(JaWord,on_delete=models.CASCADE,) fcnword = models.ForeignKey(CnWord,on_delete=models.CASCADE,) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) class Meta: unique_together = ("fjaword", "fcnword") # 日文英语互译表 class Ja2En(models.Model): fid = models.AutoField(primary_key=True) fjaword = models.ForeignKey(JaWord,on_delete=models.CASCADE) fenword = models.ForeignKey(EnWord,on_delete=models.CASCADE) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) class Meta: unique_together = ("fjaword", "fenword") # 英语汉语互译表 class En2Cn(models.Model): fid = models.AutoField(primary_key=True) fenword = models.ForeignKey(EnWord,on_delete=models.CASCADE) fcnword = models.ForeignKey(CnWord,on_delete=models.CASCADE) fuser = models.CharField(null=True, max_length=30, blank=True) fdate = models.DateTimeField(auto_now=True) class Meta: unique_together = ("fenword", "fcnword") # 日语单词例句 class JaWordSen(models.Model): fid = models.AutoField(primary_key=True) fword = models.ForeignKey(JaWord,on_delete=models.CASCADE) fsentence = models.ForeignKey(JaSentence,on_delete=models.CASCADE) fdate = models.DateTimeField(auto_now=True) # 中文单词例句 class CnWordSen(models.Model): fid = models.AutoField(primary_key=True) fword = models.ForeignKey(CnWord,on_delete=models.CASCADE) fsentence = models.ForeignKey(CnSentence,on_delete=models.CASCADE) fdate = models.DateTimeField(auto_now=True) # 英语单词例句 class EnWordSen(models.Model): fid = models.AutoField(primary_key=True) fword = models.ForeignKey(EnWord,on_delete=models.CASCADE) fsentence = models.ForeignKey(EnSentence,on_delete=models.CASCADE) fdate = models.DateTimeField(auto_now=True)
42.873239
75
0.720762
783
6,088
5.485313
0.122605
0.153667
0.10291
0.149942
0.868917
0.868917
0.861467
0.817229
0.783469
0.783469
0
0.018971
0.160151
6,088
142
76
42.873239
0.821044
0.020532
0
0.678899
0
0
0.025891
0
0
0
0
0
0
1
0.027523
false
0
0.027523
0.027523
0.944954
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
7
4275c641dd26a099e475dafc8e5ec81c29993bf4
321
py
Python
cupyx/scipy/ndimage/__init__.py
weareno1/cupy
ac52cce00b69d97b5d99bd1f91caed720b32b2d3
[ "MIT" ]
1
2019-04-15T00:06:09.000Z
2019-04-15T00:06:09.000Z
cupyx/scipy/ndimage/__init__.py
hephaex/cupy
5cf50a93bbdebe825337ed7996c464e84b1495ba
[ "MIT" ]
1
2019-08-05T09:36:13.000Z
2019-08-06T12:03:01.000Z
cupyx/scipy/ndimage/__init__.py
hephaex/cupy
5cf50a93bbdebe825337ed7996c464e84b1495ba
[ "MIT" ]
1
2022-03-24T13:19:55.000Z
2022-03-24T13:19:55.000Z
from cupyx.scipy.ndimage.interpolation import affine_transform # NOQA from cupyx.scipy.ndimage.interpolation import map_coordinates # NOQA from cupyx.scipy.ndimage.interpolation import rotate # NOQA from cupyx.scipy.ndimage.interpolation import shift # NOQA from cupyx.scipy.ndimage.interpolation import zoom # NOQA
53.5
70
0.82866
42
321
6.285714
0.333333
0.170455
0.265152
0.397727
0.818182
0.818182
0.666667
0
0
0
0
0
0.109034
321
5
71
64.2
0.923077
0.074766
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
8
427af1b8e23a4fd2fe219faa857a0b4675254377
98
py
Python
test/test_module/hello_world.py
bubblegumsoldier/package-obfuscator
eaaf88e5d5fe3433e2bcd23590e06b981a5444f2
[ "MIT" ]
4
2022-02-16T11:26:32.000Z
2022-02-16T13:54:04.000Z
test/test_module/hello_world.py
bubblegumsoldier/package-obfuscator
eaaf88e5d5fe3433e2bcd23590e06b981a5444f2
[ "MIT" ]
null
null
null
test/test_module/hello_world.py
bubblegumsoldier/package-obfuscator
eaaf88e5d5fe3433e2bcd23590e06b981a5444f2
[ "MIT" ]
null
null
null
from .nested import functionality_test def perform(): return functionality_test.something()
16.333333
41
0.785714
11
98
6.818182
0.818182
0.453333
0
0
0
0
0
0
0
0
0
0
0.142857
98
5
42
19.6
0.892857
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
true
0
0.333333
0.333333
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
1
0
0
0
7
4294c0bba9380d7399d69630d92242313447bbd8
2,324
py
Python
data/roen/0_create_bpe_model.py
ErikHumphrey/sustain-seq2seq
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
[ "Apache-2.0" ]
4
2019-05-09T19:47:48.000Z
2020-04-11T13:58:31.000Z
data/roen/0_create_bpe_model.py
ErikHumphrey/sustain-seq2seq
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
[ "Apache-2.0" ]
null
null
null
data/roen/0_create_bpe_model.py
ErikHumphrey/sustain-seq2seq
c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4
[ "Apache-2.0" ]
4
2018-12-05T01:52:22.000Z
2019-11-01T01:01:52.000Z
import sentencepiece as spm import os if not os.path.exists("bpe_models"): os.makedirs("bpe_models") # 1K spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.ro --model_prefix=setimes.1K.bpe.ro --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=1024') spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.en --model_prefix=setimes.1K.bpe.en --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=1024') # 8K spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.ro --model_prefix=setimes.8K.bpe.ro --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=8096') spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.en --model_prefix=setimes.8K.bpe.en --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=8096') #16K spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.ro --model_prefix=setimes.16K.bpe.ro --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=16192') spm.SentencePieceTrainer.Train('--input=raw/SETIMES.en-ro.en --model_prefix=setimes.16K.bpe.en --unk_surface=<UNK> --character_coverage=1.0 --pad_id=0 --pad_piece=<PAD> --unk_id=1 --unk_piece=<UNK> --bos_id=2 --bos_piece=<BOS> --eos_id=3 --eos_piece=<EOS> --model_type=bpe --num_threads=8 --split_by_whitespace=true --shuffle_input_sentence=true --vocab_size=16192')
129.111111
366
0.743546
398
2,324
4.065327
0.130653
0.029666
0.103832
0.122373
0.948084
0.939431
0.939431
0.939431
0.939431
0.939431
0
0.03648
0.056368
2,324
17
367
136.705882
0.701322
0.004303
0
0
0
0.6
0.867532
0.361905
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
10
c40b3dc338a398aef192ab0097660ae87a9f216b
1,430
py
Python
multicrackV2.py
DarkFacebookNet378/H3K3L
367376173df8ef7df29d3d6d1de7d9ffcb2c9d0b
[ "Apache-2.0" ]
2
2021-01-09T07:38:24.000Z
2021-01-11T13:02:48.000Z
multicrackV2.py
DarkFacebookNet378/H3K3L
367376173df8ef7df29d3d6d1de7d9ffcb2c9d0b
[ "Apache-2.0" ]
1
2021-01-09T09:30:05.000Z
2021-01-09T09:30:05.000Z
multicrackV2.py
DarkFacebookNet378/H3K3L
367376173df8ef7df29d3d6d1de7d9ffcb2c9d0b
[ "Apache-2.0" ]
1
2021-01-25T03:10:54.000Z
2021-01-25T03:10:54.000Z
import marshal,zlib,base64 exec(marshal.loads(zlib.decompress(base64.b64decode("eJxFVEnPo0YQxd/MZDvlJ+SQw0gcMDuWkigGsxmz2Cw23MC0MZi92a/54QmWJkmp6ul1v1KV1C29O/ItPq/151pQWyFec4PkCBL8xzdIsPmXfyDBBwIQJPuEgA2SfUbAB5J9QeIP5K/Nt1zbPrsr2F8/rfPSv9cw4M/rEnCcJJcr+gb3z5PCkrR9o9N0nntePY18ortPRwpazRivvAwJfb7zicEvPOQYi36Nl9NpW7Q97pSeNngpQ53RC/WwMWLyhPsgCgR9TiqRe7CZxl0i7D7c0lMs+8mZv9E89fT31lGiMkqAdhuImLfbLeGjH6Vsjw7zssAWvbmnHsOTxC5xVMTvYjsDrltCNWeCyN0rWEoK3ZnBZ/Da2Qvjanjp5ip+nTROAIpISGneddwBkvRSA0Lyb2YyiW3eWdUkcNMUaPP4fIGLP5nHMr9y+ElWYlsUCUcYLjSDttSgEG4hpW0tmA2qekeQV0fdfT1Orqbuovhi8kXKj7Tr5Nc2mnDP2VmCXQ/gYESwdFqZkkZsClEdOB5jM+OeMo7JUKvK7BMMHW/3sa/DeQ5dendrCaLG0sV4Hs/ZeHUc9DWZIsxU0OWilY+g93r55tkMG5xRTmJEJ7yolcnF8vr2KjNq7M05lqkAOPR+nrDUql9VxW9F6NXO9lWmNVVU22DpGEJCD4WgW1bNXqy0apPIlmWVqDO1ixkU6GdVEhvvoYVUHh36we+30WwkMGjY1iiI5pCpREGR+rOJfB5ar8p4Bgcp9vET70YPAfRaR6kmao06CbGi2VYU7eIvV3mkUa+FQ9nPd90ZyFNzBeAhF6LGEuDW12oGSQF7AAg1NYdMpVwaHEReMwsxahc4kKkE3Yt4s2Cm2hN16ooOVpSz55JizcalcCDSweHk/DU18vHVNXFHyuZZXUyOIrzccJoL2kKWfjqjDgDVLhnveHRPQvVOM4kiRsUd4rp7ZsX74arj/I5aHI+yxUfR4PVziwXHcSC8LFrMWKH2o0S6SVIBlkmzE1MGdXX3VBAflejl5hg+bvHBf8r0RF1YXyks7XHYqwYZ+9whWiZ4NRou5f02jnXPMc9BGbOV6YEgzavZBIY/WRZLj+Rp4Awo1PGOaDxs37FWoSZDch1L7tSEJGd2QrprLHPIFoKgp+sxNmTyHmNmGZ8J7GHhCoc6UYHthN0lNB50G2KlklEUdmLacM6G6ondWDKfPFJtmQ7bC/buqOm/f/1u9Yfu+xWKsIXPMO/eTrTkadS9lSiEgKG6LyvNqzCG3U9vewL3qqjb9e+6H989DPW+icHXt5H9D/At2v06t/1FPXQ/rKffiiruc/DH5i1/rPDr5h/T04cA"))))
476.666667
1,402
0.955944
57
1,430
23.982456
0.947368
0
0
0
0
0
0
0
0
0
0
0.15487
0.002098
1,430
2
1,403
715
0.803083
0
0
0
0
0.5
0.93986
0.93986
0
1
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
1
1
1
null
1
0
0
0
0
0
1
0
1
0
0
0
0
10
c40c07e7fb6271ecffe7fe4039c49480727f2071
91,524
py
Python
pyslm/settings.py
leonardojacomussi/PySLM
94283afa022cd113129b4f42f1745e22ad3730f9
[ "MIT" ]
1
2021-07-23T17:13:40.000Z
2021-07-23T17:13:40.000Z
pyslm/settings.py
leonardojacomussi/PySLM
94283afa022cd113129b4f42f1745e22ad3730f9
[ "MIT" ]
null
null
null
pyslm/settings.py
leonardojacomussi/PySLM
94283afa022cd113129b4f42f1745e22ad3730f9
[ "MIT" ]
2
2021-06-14T10:47:44.000Z
2021-12-29T16:29:30.000Z
from PyQt5 import QtCore, QtGui, QtWidgets import sounddevice as sd import threading as thd from time import sleep import numpy as np import pyqtgraph import os, sys import pyslm path_icons = os.path.join(os.path.dirname(os.path.realpath(pyslm.__file__)), 'Icons') if sys.platform == 'win32' or sys.platform == 'win64': import ctypes myappid = u'mycompany.myproduct.subproduct.version' # arbitrary string ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) else: pass class setSetup(QtWidgets.QDialog, pyslm.guiSetup): def __init__(self, parent=None): super(setSetup, self).__init__(parent) self.setupUi(self) self.restore = False self._listNumFreq = [20.0, 25.0, 31.5, 40.0, 50.0, 63.0, 80.0, 100.0, 125.0, 160.0, 200.0, 250.0, 4000.0, 5000.0, 6300.0, 8000.0, 10000.0, 16000.0, 20000.0] self._listStrFreq = ['20 Hz', '25 Hz', '31.5 Hz', '40 Hz', '50 Hz', '63 Hz', '80 Hz', '100 Hz', '125 Hz', '160 Hz', '200 Hz', '250 Hz', '4 kHz', '5 kHz', '6.3 kHz', '8 kHz', '10 kHz', '16 kHz', '20 kHz'] self._str2numFreq = {} self._num2strFreq = {} count = 0 for string in self._listStrFreq: self._str2numFreq[string] = self._listNumFreq[count] count += 1 count = 0 for number in self._listNumFreq: self._num2strFreq[number] = self._listStrFreq[count] count += 1 self.newParams = pyslm.parameters.load() self.currentParams = pyslm.parameters.load() self.plotMic = None self.plotADC = None self._setTabMeasurement() self._setTabCalibration() self._setTabProjects() self._setTabSpectrumCorretion() self._setTabDevice() self.changedParams() self.btnClose.clicked.connect(self.btnClose_Action) self.btnApply.clicked.connect(self.btnApply_Action) self.btnRestore.clicked.connect(self.btnRestore_Action) def _restore(self): self.newParams = self.currentParams.copy() self.compensationView.plotItem.clear() self.plotMic = None self.plotADC = None self._setTabMeasurement() self._setTabCalibration() self._setTabProjects() self._setTabSpectrumCorretion() self._setTabDevice() self.changedParams() return def _setTabMeasurement(self): # Set current template if self.newParams['template'] == 'frequencyAnalyzer': self.inTemplate.setCurrentIndex(0) else: self.inTemplate.setCurrentIndex(1) # Set current bandwidth if self.newParams['b'] == 1: self.inBandwidth.setCurrentIndex(0) else: self.inBandwidth.setCurrentIndex(1) methods = {'sweepExponential': 'Exponential sweep', 'whiteNoise': 'White noise', 'pinkNoise': 'Pink noise', 'impulse': 'Impulse'} self.inMethod.setCurrentText(methods[self.newParams['method']]) self._listParamsTabMeasurement() self._setfrequencyLimits() self._setMethod() # Set frequency weighting self.inFreqWeighting.setCurrentText(self.newParams['fweighting']) # Set time weighting TimeWeighting = {0.035: 'Impulse', 0.125: 'Fast', 1.0: 'Slow'} self.inTimeWeighting.setCurrentText(TimeWeighting[self.newParams['tau']]) # Set duration h, m, s = self.seconds2HMN(self.newParams['duration']) self.inHour.setCurrentText(h) self.inMin.setCurrentText(m) self.inSec.setCurrentText(s) # Set excitation time _, m, s = self.seconds2HMN(self.newParams['excitTime']) self.inMinExcit.setCurrentText(m) self.inSecExcit.setCurrentText(s) # Set escape time _, m, s = self.seconds2HMN(self.newParams['scapeTime']) self.inMinScape.setCurrentText(m) self.inSecScape.setCurrentText(s) # Set decay time _, _, s = self.seconds2HMN(self.newParams['decayTime']) self.inSecDecay.setCurrentText(s) # Set number of decay self.inNumDecays.setCurrentText('%02d'%self.newParams['numDecay']) # Set trigger level self.inTriggerLevel.setCurrentText('%02d dB'%self.newParams['TLevel']) # Set connections self.inTemplate.currentIndexChanged.connect(self._setfrequencyLimits) self.inBandwidth.currentIndexChanged.connect(self._setfrequencyLimits) self.inBottomFreq.currentIndexChanged.connect(self._setBottomFreq) self.inTopFreq.currentIndexChanged.connect(self._setTopFreq) self.inHour.currentTextChanged.connect(self._setDuration) self.inMin.currentTextChanged.connect(self._setDuration) self.inSec.currentTextChanged.connect(self._setDuration) self.inFreqWeighting.currentTextChanged.connect(self._setFreqWeighting) self.inTimeWeighting.currentTextChanged.connect(self._setTimeWeighting) self.inMethod.currentIndexChanged.connect(self._setMethod) self.inMinExcit.currentTextChanged.connect(self._setExcitTime) self.inSecExcit.currentTextChanged.connect(self._setExcitTime) self.inMinScape.currentTextChanged.connect(self._setEscapeTime) self.inSecScape.currentTextChanged.connect(self._setEscapeTime) self.inSecDecay.currentTextChanged.connect(self._setSecDecay) self.inNumDecays.currentTextChanged.connect(self._setNumDecay) self.inTriggerLevel.currentTextChanged.connect(self._setTriggerLevel) def _setTabCalibration(self): self.groupBox_Calibration.setEnabled(False) self.groupBox_Calibration.setTitle('') self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') # Set reference sound pressure self.inPressureRef.setCurrentText('%02d dB'%self.newParams['pCalib']) # Set reference frequency self.inFrequencyRef.setCurrentText('%d Hz'%self.newParams['fCalib']) # Set current correction factor self.val_CurrentCorrFactor.setText('%.2f dB'%self.newParams['corrFactor']) # Set current sensitivity self.val_CurrentSensitivity.setText('%.2f mV/Pa'%self.newParams['sensitivity']) self.inPressureRef.currentTextChanged.connect(self._setPressureRef) self.inFrequencyRef.currentIndexChanged.connect(self._setFrequencyRef) self.btnCalibrate.clicked.connect(self.btnCalibrate_Action) self.btnAccept.clicked.connect(self.btnAccept_Action) self.btnDecline.clicked.connect(self.btnDecline_Action) def _setTabSpectrumCorretion(self): self.groupBox_CompensationViewer.setEnabled(False) if self.currentParams['micCorrFile'] != None: _, file_name = os.path.split(self.currentParams['micCorrFile']) self.disp_CurrentMicFile.setText(file_name) if self.currentParams['applyMicCorr']: self.onMicCorr.setChecked(True) else: self.onMicCorr.setChecked(False) else: self.disp_CurrentMicFile.setText('No microphone calibration files defined') self.onMicCorr.setEnabled(False) self.onMicCorr.setChecked(False) if self.currentParams['adcCorrFile'] != None: _, file_name = os.path.split(self.currentParams['adcCorrFile']) self.disp_CurrentADCFile.setText(file_name) if self.currentParams['applyAdcCorr']: self.onADCCorr.setChecked(True) else: self.onADCCorr.setChecked(False) else: self.disp_CurrentADCFile.setText('No ADC calibration file defined') self.onADCCorr.setEnabled(False) self.onADCCorr.setChecked(False) if self.onMicCorr.isChecked(): if self.plotMic == None: pen=pyqtgraph.mkPen(color=(120, 145, 255)) self.plotMic = pyqtgraph.PlotDataItem(self.currentParams['micCorr'][:, 0], self.currentParams['micCorr'][:, 1], pen=pen, clear=True, name='Microphone response') self.compensationView.addItem(self.plotMic) else: self.compensationView.addItem(self.plotMic) else: if not self.plotMic is None: self.compensationView.removeItem(self.plotMic) else: pass if self.onADCCorr.isChecked(): if self.plotADC == None: pen=pyqtgraph.mkPen(color=(222, 28, 74)) self.plotADC = pyqtgraph.PlotDataItem(self.currentParams['adcCorr'][:, 0], self.currentParams['adcCorr'][:, 1], pen=pen, clear=True, name='ADC response') self.compensationView.addItem(self.plotADC) else: self.compensationView.addItem(self.plotADC) else: if not self.plotADC is None: self.compensationView.removeItem(self.plotADC) else: pass # Set connections self.btnLoadMicFile.clicked.connect(self._openMicFile) self.btnLoadADCFile.clicked.connect(self._openAdcFile) self.onMicCorr.clicked.connect(self._setOnMicCorr) self.onADCCorr.clicked.connect(self._setOnADCCorr) return def _openMicFile(self): try: file = str(QtWidgets.QFileDialog.getOpenFileName(self, "Select microphone calibration file", "", "*.txt")) if file == "('', '')": Exception else: pass if sys.platform == 'win32' or sys.platform == 'win64': file = file.replace('/', '\\') file = file[1:].replace(", '*.txt')", "").replace("'", "") _, file_name = os.path.split(file) # print("Path: {}\nFile: {}\n".format(folder, file_name)) micData = np.loadtxt(fname=file) self.newParams['micCorrFile'] = file self.newParams['micCorr'] = micData self.onMicCorr.setEnabled(True) self.disp_CurrentMicFile.setText(file_name) if self.plotMic != None and self.onMicCorr.isChecked(): self.compensationView.removeItem(self.plotMic) self.plotMic = None self._setPlotMicCompensation() elif self.plotMic != None: self.compensationView.removeItem(self.plotMic) self.plotMic = None self.changedParams() except: if self.plotMic == None: self.newParams['micCorrFile'] = None self.newParams['micCorr'] = None self.newParams['applyMicCorr'] = False self.onMicCorr.setEnabled(False) self.onMicCorr.setChecked(False) self.disp_CurrentMicFile.setText('No microphone calibration files defined') else: pass return def _openAdcFile(self): try: file = str(QtWidgets.QFileDialog.getOpenFileName(self, "Select ADC calibration file", "", "*.txt")) if file == "('', '')": Exception else: pass if sys.platform == 'win32' or sys.platform == 'win64': file = file.replace('/', '\\') file = file[1:].replace(", '*.txt')", "").replace("'", "") _, file_name = os.path.split(file) # print("Path: {}\nFile: {}\n".format(folder, file_name)) micADC = np.loadtxt(fname=file) self.newParams['adcCorrFile'] = file self.newParams['adcCorr'] = micADC self.onADCCorr.setEnabled(True) self.disp_CurrentADCFile.setText(file_name) if self.plotADC != None and self.onADCCorr.isChecked(): self.compensationView.removeItem(self.plotADC) self.plotADC = None self._setPlotADCCompensation() self.changedParams() except: if self.plotADC == None: self.newParams['adcCorrFile'] = None self.newParams['adcCorr'] = None self.newParams['applyAdcCorr'] = False self.onADCCorr.setEnabled(False) self.onADCCorr.setChecked(False) self.disp_CurrentADCFile.setText('No ADC calibration file defined') else: pass return def _setOnMicCorr(self): if self.onMicCorr.isChecked(): self.newParams['applyMicCorr'] = True else: self.newParams['applyMicCorr'] = False self._setPlotMicCompensation() self.changedParams() return def _setOnADCCorr(self): if self.onADCCorr.isChecked(): self.newParams['applyAdcCorr'] = True else: self.newParams['applyAdcCorr'] = False self._setPlotADCCompensation() self.changedParams() return def _setPlotMicCompensation(self): if self.onMicCorr.isChecked(): if self.plotMic == None: pen=pyqtgraph.mkPen(color=(120, 145, 255)) self.plotMic = pyqtgraph.PlotDataItem(self.newParams['micCorr'][:, 0], self.newParams['micCorr'][:, 1], pen=pen, clear=True, name='Microphone response') self.compensationView.addItem(self.plotMic) else: self.compensationView.addItem(self.plotMic) else: if not self.plotMic is None: self.compensationView.removeItem(self.plotMic) else: pass return def _setPlotADCCompensation(self): if self.onADCCorr.isChecked(): if self.plotADC == None: pen=pyqtgraph.mkPen(color=(222, 28, 74)) self.plotADC = pyqtgraph.PlotDataItem(self.newParams['adcCorr'][:, 0], self.newParams['adcCorr'][:, 1], pen=pen, clear=True, name='ADC response') self.compensationView.addItem(self.plotADC) else: self.compensationView.addItem(self.plotADC) else: if not self.plotADC is None: self.compensationView.removeItem(self.plotADC) else: pass return def _setTabDevice(self): self._listParamsTabDevice() self.listInDevices.currentIndexChanged.connect(self._setInputDevice) self.listOutDevices.currentIndexChanged.connect(self._setOutputDevice) self.inChannels.currentIndexChanged.connect(self._setInChannels) self.outChannels.currentTextChanged.connect(self._setOutChannels) self.listSampleRate.currentIndexChanged.connect(self._setSampleRate) return def _setInputDevice(self): self.inChannels.clear() self.listSampleRate.clear() # Query devices inputDevices, outputDevices, _ = self._setDevices() d = [inputDevices[self.listInDevices.currentIndex()]['id'], outputDevices[self.listOutDevices.currentIndex()]['id']] self.newParams['device'], self.newParams['fs'] = \ self._checkParamsDevice(d, self.newParams['fs']) # List and set input channels for inCh in range(len(inputDevices[self.listInDevices.currentIndex()]['listCha'])): self.inChannels.addItem("") self.inChannels.setItemText(inCh, str(inCh+1)) self.inChannels.setCurrentText(str(self.newParams['inCh'][0])) # List sample rate for fs in range(len(inputDevices[self.listInDevices.currentIndex()]['fs_list'])): self.listSampleRate.addItem("") self.listSampleRate.setItemText(fs, '%d Hz'%inputDevices[self.listInDevices.currentIndex()]['fs_list'][fs]) # Set sample rate self.listSampleRate.setCurrentText('%d Hz'%self.newParams['fs']) self.changedParams() return def _setOutputDevice(self): self.outChannels.clear() # Query devices inputDevices, outputDevices, _ = self._setDevices() d = [inputDevices[self.listInDevices.currentIndex()]['id'], outputDevices[self.listOutDevices.currentIndex()]['id']] self.newParams['device'], self.newParams['fs'] = \ self._checkParamsDevice(d, self.newParams['fs']) # List and set output channels for outCh in range(len(outputDevices[self.listOutDevices.currentIndex()]['listCha'])): self.outChannels.addItem("") self.outChannels.setItemText(outCh, str(outCh+1)) if outCh+1 in self.newParams['outCh']: self.outChannels.setItemChecked(outCh, True) else: self.outChannels.setItemChecked(outCh, False) self.changedParams() return def _setInChannels(self): if self.inChannels.count() > 0: self.newParams['inCh'] = [self.inChannels.currentIndex()+1] self.changedParams() else: pass return def _setOutChannels(self): if self.outChannels.count() > 0: outChannels = [] for outCha in range(self.outChannels.count()): if self.outChannels.itemChecked(outCha): outChannels.append(outCha+1) if len(outChannels) > 0: self.outChannels.setCurrentText(str(outChannels[-1])) self.newParams['outCh'] = outChannels self.changedParams() else: pass return def _setSampleRate(self): if self.listSampleRate.count() > 0: if self.listSampleRate.currentText() != '': self.newParams['fs'] = int(self.listSampleRate.currentText().replace(' Hz', '')) self.changedParams() else: pass return def _setPressureRef(self): self.newParams['pCalib'] = int(self.inPressureRef.currentText().replace(' dB', '')) self.changedParams() return def _setFrequencyRef(self): self.newParams['fCalib'] = int(self.inFrequencyRef.currentText().replace(' Hz', '')) self.changedParams() return def _setBottomFreq(self): if self.inBottomFreq.count() > 0: self.newParams['fstart'] = self._str2numFreq[self.inBottomFreq.currentText()] self.changedParams() else: pass return def _setTopFreq(self): if self.inTopFreq.count() > 0: self.newParams['fend'] = self._str2numFreq[self.inTopFreq.currentText()] self.changedParams() else: pass return def _setDuration(self): hour = int(self.inHour.currentText().replace('h', '')) minute = int(self.inMin.currentText().replace('m', '')) second = int(self.inSec.currentText().replace('s', '')) duration = 3600*hour + 60*minute + second if duration < 15: duration = 15 self.inSec.setCurrentText('15s') else: pass self.newParams['duration'] = duration self.changedParams() return def _setExcitTime(self): minute = int(self.inMinExcit.currentText().replace('m', '')) second = int(self.inSecExcit.currentText().replace('s', '')) durationExcit = 60*minute + second self.newParams['excitTime'] = durationExcit self.changedParams() return def _setEscapeTime(self): minute = int(self.inMinScape.currentText().replace('m', '')) second = int(self.inSecScape.currentText().replace('s', '')) scapeTime = 60*minute + second self.newParams['scapeTime'] = scapeTime self.changedParams() return def _setSecDecay(self): decayTime = int(self.inSecDecay.currentText().replace('s', '')) self.newParams['decayTime'] = decayTime self.changedParams() return def _setNumDecay(self): self.newParams['numDecay'] = int(self.inNumDecays.currentText()) self.changedParams() return def _setTriggerLevel(self): self.newParams['TLevel'] = int(self.inTriggerLevel.currentText().replace(' dB', '')) self.changedParams() return def _setFreqWeighting(self): self.newParams['fweighting'] = self.inFreqWeighting.currentText() self.changedParams() return def _setTimeWeighting(self): TimeWeighting = {'Impulse': 0.035, 'Fast': 0.125, 'Slow': 1.0} self.newParams['tau'] = TimeWeighting[self.inTimeWeighting.currentText()] self.changedParams() return def _setMethod(self): methods = {'Exponential sweep': 'sweepExponential', 'White noise': 'whiteNoise', 'Pink noise': 'pinkNoise', 'Impulse': 'impulse'} if self.inMethod.currentIndex() == 3: self.inTriggerLevel.setEnabled(True) self.inMinExcit.setEnabled(False) self.inSecExcit.setEnabled(False) self.inMinScape.setEnabled(False) self.inSecScape.setEnabled(False) self.inNumDecays.setEnabled(False) else: self.inTriggerLevel.setEnabled(False) self.inMinExcit.setEnabled(True) self.inSecExcit.setEnabled(True) self.inMinScape.setEnabled(True) self.inSecScape.setEnabled(True) self.inNumDecays.setEnabled(True) self.newParams['method'] = methods[self.inMethod.currentText()] self.changedParams() return def changedParams(self): changes = [] for key in self.newParams.keys(): if not type(self.newParams[key]) is np.ndarray: if self.newParams[key] == self.currentParams[key]: changes.append(True) else: changes.append(False) elif type(self.newParams[key]) == np.ndarray: if np.array_equal(a1=self.newParams[key], a2=self.currentParams[key]): changes.append(True) else: changes.append(False) else: pass if not False in changes: self.btnApply.setEnabled(False) self.btnApply.setText('Apply') self.btnRestore.setEnabled(False) else: self.btnApply.setEnabled(True) self.btnApply.setText('Apply*') self.btnRestore.setEnabled(True) return def btnCalibrate_Action(self): self.btnCalibrate.setEnabled(False) self.btnAccept.setEnabled(False) self.btnDecline.setEnabled(False) self.groupBox_Calibration.setEnabled(True) self.plotCalib = pyqtgraph.PlotCurveItem() self.CalibrationView.addItem(self.plotCalib) self.stream_calibration = pyslm.StreamManager(version='AdvFreqAnalyzer', path = os.path.join(self.currentParams['pathProject'], self.currentParams['currentProject']), device=self.currentParams['device'], fs=self.currentParams['fs'], inCh=self.currentParams['inCh'], outCh=self.currentParams['outCh'], tau=1.0, fstart=self.currentParams['fstart'], fend=self.currentParams['fend'], b=self.currentParams['b'], fweighting=self.currentParams['fweighting'], duration=10, excitTime=self.currentParams['excitTime'], scapeTime=self.currentParams['scapeTime'], decayTime=self.currentParams['decayTime'], template='calibration', method=self.currentParams['method'], numDecay=self.currentParams['numDecay'], TLevel = self.currentParams['TLevel'], fCalib=self.currentParams['fCalib'], pCalib=self.currentParams['pCalib'], calibFactor=self.currentParams['calibFactor'], micCorr=self.currentParams['micCorr'], applyMicCorr=self.currentParams['applyMicCorr'], adcCorr=self.currentParams['adcCorr'], applyAdcCorr=self.currentParams['applyAdcCorr'], saveRawData=self.currentParams['saveRawData']) self.stream_calibration.play() self.stream_calibration.realtime_data.connect(self.updateCalibrate) self.stream_calibration.fullresults_data.connect(self.fullCalibrate) return @QtCore.pyqtSlot(dict) def updateCalibrate(self, results): SPL = results['SPL'][1:] with np.errstate(divide='ignore'): freqVector = np.log10(results['freqVector'][1:]) framesRead = self.stream_calibration.framesRead countdown = int(self.stream_calibration.duration - framesRead/self.stream_calibration.fs) if countdown > 0: self.groupBox_Calibration.setTitle('Performing calibration, please wait %02ds'%countdown) if freqVector.size == SPL.size: self.plotCalib.setData(x=freqVector, y=SPL, pen=pyqtgraph.mkPen(color=(120, 145, 255))) else: pass else: pass return @QtCore.pyqtSlot(dict) def fullCalibrate(self, results): self.groupBox_Calibration.setTitle('Performing calibration, please wait 00s') SPL = results['SPL'] with np.errstate(divide='ignore'): freqVector = np.log10(results['freqVector'][1:]) self.sensitivity = results['sensitivity'] self.correction = results['correction'] self.FC = results['FC'] if freqVector.size == SPL.size: self.plotCalib.setData(freqVector, SPL) else: pass self.lbl_NewCorrFactor.setText('New correction factor: %.02f dB'%self.correction) self.lbl_NewSensitivity.setText('New sensitivity: %.02f mV/Pa'%self.sensitivity) self.btnAccept.setEnabled(True) self.btnDecline.setEnabled(True) def btnAccept_Action(self): self.currentParams['corrFactor'] = self.correction self.currentParams['sensitivity'] = self.sensitivity self.currentParams['calibFactor'] = self.FC self.newParams['corrFactor'] = self.correction self.newParams['sensitivity'] = self.sensitivity self.newParams['calibFactor'] = self.FC self.val_CurrentCorrFactor.setText('%.2f dB'%self.newParams['corrFactor']) self.val_CurrentSensitivity.setText('%.2f mV/Pa'%self.newParams['sensitivity']) pyslm.parameters.update(self.currentParams) self.changedParams() self.groupBox_Calibration.setEnabled(False) self.groupBox_Calibration.setTitle('') self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') self.btnDecline.setEnabled(False) self.btnAccept.setEnabled(False) self.btnCalibrate.setEnabled(True) self.CalibrationView.removeItem(self.plotCalib) return def btnDecline_Action(self): self.changedParams() self.groupBox_Calibration.setEnabled(False) self.groupBox_Calibration.setTitle('') self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') self.btnDecline.setEnabled(False) self.btnAccept.setEnabled(False) self.btnCalibrate.setEnabled(True) self.CalibrationView.removeItem(self.plotCalib) return def btnClose_Action(self): # os.chdir(path_main) self.close() return def btnApply_Action(self): self.currentParams = self.newParams.copy() self.changedParams() pyslm.parameters.update(self.currentParams) return def btnRestore_Action(self): self.restore = True self._restore() self.restore = False return def findFrequency(self, freq): if self.newParams['b'] == 1: if self.newParams['template'] == 'frequencyAnalyzer': vecfrequency = [31.5, 63.0, 125.0, 250.0, 4000.0, 8000.0, 16000.0] else: vecfrequency = [63.0, 125.0, 250.0, 4000.0, 8000.0] frequency = np.asarray(vecfrequency) else: if self.newParams['template'] == 'frequencyAnalyzer': vecfrequency = self._listNumFreq else: vecfrequency = self._listNumFreq[4:17] frequency = np.asarray(vecfrequency) dist = np.sqrt((frequency - freq)**2) return vecfrequency[np.argmin(dist)] def seconds2HMN(self, seconds): M, S = divmod(seconds, 60) H, M = divmod(M, 60) # return "%02d:%02d:%02d" % (H, M, S) return '%02dh'%H, '%02dm'%M, '%02ds'%S def _setfrequencyLimits(self): self.inBottomFreq.clear() self.inTopFreq.clear() if self.inTemplate.currentIndex() == 0: self.newParams['template'] = 'frequencyAnalyzer' self.inHour.setEnabled(True) self.inMin.setEnabled(True) self.inSec.setEnabled(True) self.inFreqWeighting.setEnabled(True) self.inTimeWeighting.setEnabled(True) self.groupBox_ExcitSignal.setEnabled(False) minoctband_third = ['20 Hz', '25 Hz', '31.5 Hz', '40 Hz', '50 Hz', '63 Hz', '80 Hz', '100 Hz', '125 Hz', '160 Hz', '200 Hz', '250 Hz'] maxoctband_third = ['4 kHz', '5 kHz', '6.3 kHz', '8 kHz', '10 kHz', '16 kHz', '20 kHz'] minoctband_one = ['31.5 Hz', '63 Hz', '125 Hz', '250 Hz'] maxoctband_one = ['4 kHz', '8 kHz', '16 kHz'] else: self.newParams['template'] = 'reverberationTime' self.inHour.setEnabled(False) self.inMin.setEnabled(False) self.inSec.setEnabled(False) self.inFreqWeighting.setEnabled(False) self.inTimeWeighting.setEnabled(False) self.inFreqWeighting.setCurrentIndex(2) self.groupBox_ExcitSignal.setEnabled(True) minoctband_third = ['50 Hz', '63 Hz', '80 Hz', '100 Hz', '125 Hz', '160 Hz', '200 Hz', '250 Hz'] maxoctband_third = ['4 kHz', '5 kHz', '6.3 kHz', '8 kHz', '10 kHz'] minoctband_one = ['63 Hz', '125 Hz', '250 Hz'] maxoctband_one = ['4 kHz', '8 kHz'] if self.inBandwidth.currentIndex() == 0: self.newParams['b'] = 1 self.inBottomFreq.addItems(minoctband_one) self.inTopFreq.addItems(maxoctband_one) else: self.newParams['b'] = 3 self.inBottomFreq.addItems(minoctband_third) self.inTopFreq.addItems(maxoctband_third) if self.restore: self.newParams = self.currentParams.copy() # Set current bottom frequency bottomFreq = self.findFrequency(freq=self.currentParams['fstart']) self.inBottomFreq.setCurrentText(self._num2strFreq[bottomFreq]) # Set current top frequency topFreq = self.findFrequency(freq=self.currentParams['fend']) self.inTopFreq.setCurrentText(self._num2strFreq[topFreq]) self.changedParams() return def _listParamsTabMeasurement(self): # Set items Hours for h in range(24): self.inHour.addItem("") self.inHour.setItemText(h, '%02dh'%h) # Set items Minutes for m in range(60): self.inMin.addItem("") self.inMin.setItemText(m, '%02dm'%m) if m < 6: self.inMinExcit.addItem("") self.inMinExcit.setItemText(m, '%02dm'%m) self.inMinScape.addItem("") self.inMinScape.setItemText(m, '%02dm'%m) # Set items Seconds for s in range(60): self.inSec.addItem("") self.inSec.setItemText(s, '%02ds'%s) if s > 4: self.inSecExcit.addItem("") self.inSecExcit.setItemText(s-5, '%02ds'%s) self.inSecScape.addItem("") self.inSecScape.setItemText(s, '%02ds'%s) # Set items time decay for d in range(21): if d > 2: self.inSecDecay.addItem("") self.inSecDecay.setItemText(d-3, '%02ds'%d) # Set items number of decays for nd in range(101): if nd > 0: self.inNumDecays.addItem("") self.inNumDecays.setItemText(nd-1, '%02d'%nd) # Set items trigger leves for t in range(101): if t > 39: self.inTriggerLevel.addItem("") self.inTriggerLevel.setItemText(t-40, '%02d dB'%t) return def _listParamsTabDevice(self): # Query devices inputDevices, outputDevices, _ = self._setDevices() sd_devices = sd.query_devices() self.newParams['device'], self.newParams['fs'] = \ self._checkParamsDevice(self.newParams['device'], self.newParams['fs']) # List input devices for dev in range(len(inputDevices)): self.listInDevices.addItem("") self.listInDevices.setItemText(dev, inputDevices[dev]['name']) # Set input device self.listInDevices.setCurrentText(sd_devices[self.newParams['device'][0]]['name']) # List and set input channels for inCh in range(len(inputDevices[self.listInDevices.currentIndex()]['listCha'])): self.inChannels.addItem("") self.inChannels.setItemText(inCh, str(inCh+1)) self.inChannels.setCurrentText(str(self.newParams['inCh'][0])) # List output devices for dev in range(len(outputDevices)): self.listOutDevices.addItem("") self.listOutDevices.setItemText(dev, outputDevices[dev]['name']) # Set output device self.listOutDevices.setCurrentText(sd_devices[self.newParams['device'][1]]['name']) # List and set output channels for outCh in range(len(outputDevices[self.listOutDevices.currentIndex()]['listCha'])): self.outChannels.addItem("") self.outChannels.setItemText(outCh, str(outCh+1)) if outCh+1 in self.newParams['outCh']: self.outChannels.setItemChecked(outCh, True) else: self.outChannels.setItemChecked(outCh, False) # List sample rate for fs in range(len(inputDevices[self.listInDevices.currentIndex()]['fs_list'])): self.listSampleRate.addItem("") self.listSampleRate.setItemText(fs, '%d Hz'%inputDevices[self.listInDevices.currentIndex()]['fs_list'][fs]) # Set sample rate self.listSampleRate.setCurrentText('%d Hz'%self.newParams['fs']) return def _checkParamsDevice(self, device, fs): # Check input parameters inputDevice = device[0] outputDevice = device[1] try: sd.check_input_settings(device=inputDevice, samplerate=fs) except: sd_devices = sd.query_devices() inputDevice = sd.default.device[0] fs = int(sd_devices[sd.default.device[0]]['default_samplerate']) else: pass # Check output parameters try: sd.check_output_settings(device=outputDevice, samplerate=fs) except: sd_devices = sd.query_devices() outputDevice = sd.default.device[1] else: pass return [inputDevice, outputDevice], fs def _setDevices(self): sd_devices = sd.query_devices() def supportedFs(device, kind): samplerates = [44100, 48000, 96000, 128000] supported_samplerates = [] for fs in samplerates: try: if kind == 'in': sd.check_input_settings(device=device, samplerate=fs) else: sd.check_output_settings(device=device, samplerate=fs) except: pass else: supported_samplerates.append(fs) return supported_samplerates def supportedCha(device, kind, numCha): supported_channels = [] for ch in range(numCha+1): try: if kind == 'in': sd.check_input_settings(device=device, channels=ch) else: sd.check_output_settings(device=device, channels=ch) except: pass else: supported_channels.append(ch) return supported_channels inputDevices = [] outputDevices = [] for dev in range(len(sd_devices)): if sd_devices[dev]['max_input_channels'] > 0: listFs = supportedFs(dev, 'in') listCha = supportedCha(dev, 'in', sd_devices[dev]['max_input_channels']) inputDevices.append({'name': sd_devices[dev]['name'], 'numCha': sd_devices[dev]['max_input_channels'], 'id': dev, 'fs_default': sd_devices[dev]['default_samplerate'], 'fs_list': listFs, 'listCha': listCha}) if sd_devices[dev]['max_output_channels'] > 0: listFs = supportedFs(dev, 'out') listCha = supportedCha(dev, 'out', sd_devices[dev]['max_output_channels']) outputDevices.append({'name': sd_devices[dev]['name'], 'numCha': sd_devices[dev]['max_output_channels'], 'id': dev, 'fs_default': sd_devices[dev]['default_samplerate'], 'fs_list': listFs, 'listCha': listCha}) defaultDevices = {} for dev in range(len(inputDevices)): if inputDevices[dev]['id'] == sd.default.device[0]: defaultDevices['in'] = inputDevices[dev] for dev in range(len(outputDevices)): if outputDevices[dev]['id'] == sd.default.device[1]: defaultDevices['out'] = outputDevices[dev] return inputDevices, outputDevices, defaultDevices def _setTabProjects(self): if not os.path.isdir(self.newParams['pathProject']): if os.path.isdir(os.path.expanduser("~/Desktop")): self.newParams['pathProject'] = os.path.expanduser("~/Desktop") else: self.newParams['pathProject'] = os.getcwd() self.disp_ProjectsFolder.setText(self.newParams['pathProject']) self.disp_CurrentProject.setText(self.newParams['currentProject']) os.chdir(self.newParams['pathProject']) self.allProjects = os.listdir(".") if self.newParams['saveRawData']: self.onSaveData.setChecked(True) else: self.onSaveData.setChecked(False) self.onSaveData.toggled.connect(self._setSaveData) self.btnChangeProject.clicked.connect(self._setPathProject) self.btnCreate.setEnabled(False) self.minStr = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p",\ "a", "s", "d", "f", "g", "h", "j", "k", "l", "ç",\ "z", "x", "c", "v", "b", "n", "m"] self.maiStr = list(map(str.upper, self.minStr)) self.upper = False self.vk_a.clicked.connect(self.vk_aAction) self.vk_b.clicked.connect(self.vk_bAction) self.vk_c.clicked.connect(self.vk_cAction) self.vk_d.clicked.connect(self.vk_dAction) self.vk_e.clicked.connect(self.vk_eAction) self.vk_f.clicked.connect(self.vk_fAction) self.vk_g.clicked.connect(self.vk_gAction) self.vk_h.clicked.connect(self.vk_hAction) self.vk_i.clicked.connect(self.vk_iAction) self.vk_j.clicked.connect(self.vk_jAction) self.vk_k.clicked.connect(self.vk_kAction) self.vk_l.clicked.connect(self.vk_lAction) self.vk_m.clicked.connect(self.vk_mAction) self.vk_n.clicked.connect(self.vk_nAction) self.vk_o.clicked.connect(self.vk_oAction) self.vk_p.clicked.connect(self.vk_pAction) self.vk_q.clicked.connect(self.vk_qAction) self.vk_r.clicked.connect(self.vk_rAction) self.vk_s.clicked.connect(self.vk_sAction) self.vk_t.clicked.connect(self.vk_tAction) self.vk_u.clicked.connect(self.vk_uAction) self.vk_v.clicked.connect(self.vk_vAction) self.vk_w.clicked.connect(self.vk_wAction) self.vk_x.clicked.connect(self.vk_xAction) self.vk_y.clicked.connect(self.vk_yAction) self.vk_z.clicked.connect(self.vk_zAction) self.vk_0.clicked.connect(self.vk_0Action) self.vk_1.clicked.connect(self.vk_1Action) self.vk_2.clicked.connect(self.vk_2Action) self.vk_3.clicked.connect(self.vk_3Action) self.vk_4.clicked.connect(self.vk_4Action) self.vk_5.clicked.connect(self.vk_5Action) self.vk_6.clicked.connect(self.vk_6Action) self.vk_7.clicked.connect(self.vk_7Action) self.vk_8.clicked.connect(self.vk_8Action) self.vk_9.clicked.connect(self.vk_9Action) self.vk_underscore.clicked.connect(self.vk_underscoreAction) self.delAll.clicked.connect(self.delAllAction) self.capsLock.clicked.connect(self.btncapsLock) self.space.clicked.connect(self.spaceAction) self.backspace.clicked.connect(self.backspaceAction) self.btnCancel.clicked.connect(self.btnCancel_Action) self.btnCreate.clicked.connect(self.btnCreate_Action) self.changedParams() return def btnCancel_Action(self): self.delAllAction() return def btnCreate_Action(self): if not os.path.isdir(os.path.join(self.newParams['pathProject'], self.entryProjectname.toPlainText())): self.newParams['currentProject'] = self.entryProjectname.toPlainText() os.mkdir(os.path.join(self.newParams['pathProject'], self.entryProjectname.toPlainText())) else: pass self.disp_ProjectsFolder.setText(self.newParams['pathProject']) self.disp_CurrentProject.setText(self.newParams['currentProject']) self.delAllAction() return def _checkVirtualKeyboard(self): if self.entryProjectname.toPlainText() == "": self.btnCreate.setEnabled(False) elif self.entryProjectname.toPlainText() in self.allProjects: self.btnCreate.setEnabled(False) else: self.btnCreate.setEnabled(True) return def btncapsLock(self): self.upper = not self.upper if self.upper: self.vk_q.setText(self.maiStr[0]) self.vk_w.setText(self.maiStr[1]) self.vk_e.setText(self.maiStr[2]) self.vk_r.setText(self.maiStr[3]) self.vk_t.setText(self.maiStr[4]) self.vk_y.setText(self.maiStr[5]) self.vk_u.setText(self.maiStr[6]) self.vk_i.setText(self.maiStr[7]) self.vk_o.setText(self.maiStr[8]) self.vk_p.setText(self.maiStr[9]) self.vk_a.setText(self.maiStr[10]) self.vk_s.setText(self.maiStr[11]) self.vk_d.setText(self.maiStr[12]) self.vk_f.setText(self.maiStr[13]) self.vk_g.setText(self.maiStr[14]) self.vk_h.setText(self.maiStr[15]) self.vk_j.setText(self.maiStr[16]) self.vk_k.setText(self.maiStr[17]) self.vk_l.setText(self.maiStr[18]) self.vk_z.setText(self.maiStr[20]) self.vk_x.setText(self.maiStr[21]) self.vk_c.setText(self.maiStr[22]) self.vk_v.setText(self.maiStr[23]) self.vk_b.setText(self.maiStr[24]) self.vk_n.setText(self.maiStr[25]) self.vk_m.setText(self.maiStr[26]) else: self.vk_q.setText(self.minStr[0]) self.vk_w.setText(self.minStr[1]) self.vk_e.setText(self.minStr[2]) self.vk_r.setText(self.minStr[3]) self.vk_t.setText(self.minStr[4]) self.vk_y.setText(self.minStr[5]) self.vk_u.setText(self.minStr[6]) self.vk_i.setText(self.minStr[7]) self.vk_o.setText(self.minStr[8]) self.vk_p.setText(self.minStr[9]) self.vk_a.setText(self.minStr[10]) self.vk_s.setText(self.minStr[11]) self.vk_d.setText(self.minStr[12]) self.vk_f.setText(self.minStr[13]) self.vk_g.setText(self.minStr[14]) self.vk_h.setText(self.minStr[15]) self.vk_j.setText(self.minStr[16]) self.vk_k.setText(self.minStr[17]) self.vk_l.setText(self.minStr[18]) self.vk_z.setText(self.minStr[20]) self.vk_x.setText(self.minStr[21]) self.vk_c.setText(self.minStr[22]) self.vk_v.setText(self.minStr[23]) self.vk_b.setText(self.minStr[24]) self.vk_n.setText(self.minStr[25]) self.vk_m.setText(self.minStr[26]) self._checkVirtualKeyboard() return def vk_aAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_a.text()) self._checkVirtualKeyboard() return def vk_bAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_b.text()) self._checkVirtualKeyboard() return def vk_cAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_c.text()) self._checkVirtualKeyboard() return def vk_dAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_d.text()) self._checkVirtualKeyboard() return def vk_eAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_e.text()) self._checkVirtualKeyboard() return def vk_fAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_f.text()) self._checkVirtualKeyboard() return def vk_gAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_g.text()) self._checkVirtualKeyboard() return def vk_hAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_h.text()) self._checkVirtualKeyboard() return def vk_iAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_i.text()) self._checkVirtualKeyboard() return def vk_jAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_j.text()) self._checkVirtualKeyboard() return def vk_kAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_k.text()) self._checkVirtualKeyboard() return def vk_lAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_l.text()) self._checkVirtualKeyboard() return def vk_mAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_m.text()) self._checkVirtualKeyboard() return def vk_nAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_n.text()) self._checkVirtualKeyboard() return def vk_oAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_o.text()) self._checkVirtualKeyboard() return def vk_pAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_p.text()) self._checkVirtualKeyboard() return def vk_qAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_q.text()) self._checkVirtualKeyboard() return def vk_rAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_r.text()) self._checkVirtualKeyboard() return def vk_sAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_s.text()) self._checkVirtualKeyboard() return def vk_tAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_t.text()) self._checkVirtualKeyboard() return def vk_uAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_u.text()) self._checkVirtualKeyboard() return def vk_vAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_v.text()) self._checkVirtualKeyboard() return def vk_wAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_w.text()) self._checkVirtualKeyboard() return def vk_xAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_x.text()) self._checkVirtualKeyboard() return def vk_yAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_y.text()) self._checkVirtualKeyboard() return def vk_zAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_z.text()) self._checkVirtualKeyboard() return def spaceAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + ' ') self._checkVirtualKeyboard() return def backspaceAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText()[:-1]) self._checkVirtualKeyboard() return def vk_0Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_0.text()) self._checkVirtualKeyboard() return def vk_1Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_1.text()) self._checkVirtualKeyboard() return def vk_2Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_2.text()) self._checkVirtualKeyboard() return def vk_3Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_3.text()) self._checkVirtualKeyboard() return def vk_4Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_4.text()) self._checkVirtualKeyboard() return def vk_5Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_5.text()) self._checkVirtualKeyboard() return def vk_6Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_6.text()) self._checkVirtualKeyboard() return def vk_7Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_7.text()) self._checkVirtualKeyboard() return def vk_8Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_8.text()) self._checkVirtualKeyboard() return def vk_9Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_9.text()) self._checkVirtualKeyboard() return def vk_underscoreAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + '_') self._checkVirtualKeyboard() return def delAllAction(self): self.entryProjectname.setText('') self._checkVirtualKeyboard() return def _setPathProject(self): if os.path.isdir(self.newParams['pathProject']): pathDefault = self.newParams['pathProject'] elif os.path.isdir(os.path.expanduser("~/Desktop")): pathDefault = os.path.expanduser("~/Desktop") else: pathDefault = os.getcwd() path = str(QtWidgets.QFileDialog.getExistingDirectory(self, "Select Directory", pathDefault)) if sys.platform == 'win32' or sys.platform == 'win64': path = path.replace('/', '\\') projectFolder, currentProject = os.path.split(path) self.newParams['pathProject'] = projectFolder self.newParams['currentProject'] = currentProject self.disp_ProjectsFolder.setText(projectFolder) self.disp_CurrentProject.setText(currentProject) self.changedParams() return def _setSaveData(self): if self.onSaveData.isChecked(): self.newParams['saveRawData'] = True else: self.newParams['saveRawData'] = False self.changedParams() return class setSetup2(QtWidgets.QDialog, pyslm.guiSetup2): def __init__(self, parent=None): super(setSetup2, self).__init__(parent) self.setupUi(self) self.restore = False self.newParams = pyslm.parameters.load() self.currentParams = pyslm.parameters.load() self._setTabMeasurement() self._setTabCalibration() self._setTabProjects() self._setTabSpectrumCorretion() self._setTabDevice() self.changedParams() self.btnClose.clicked.connect(self.btnClose_Action) self.btnApply.clicked.connect(self.btnApply_Action) self.btnRestore.clicked.connect(self.btnRestore_Action) def _restore(self): self.newParams = self.currentParams.copy() self._setTabMeasurement() self._setTabCalibration() self._setTabProjects() self._setTabSpectrumCorretion() self._setTabDevice() self.changedParams() return def _setTabMeasurement(self): # Set items Hours for h in range(24): self.inHour.addItem("") self.inHour.setItemText(h, '%02dh'%h) # Set items Minutes and Seconds for m in range(60): self.inMin.addItem("") self.inSec.addItem("") self.inMin.setItemText(m, '%02dm'%m) self.inSec.setItemText(m, '%02ds'%m) # Set frequency weighting self.inFreqWeighting.setCurrentText(self.newParams['fweighting']) # Set time weighting TimeWeighting = {0.035: 'Impulse', 0.125: 'Fast', 1.0: 'Slow'} self.inTimeWeighting.setCurrentText(TimeWeighting[self.newParams['tau']]) # Set duration h, m, s = self.seconds2HMN(self.newParams['duration']) self.inHour.setCurrentText(h) self.inMin.setCurrentText(m) self.inSec.setCurrentText(s) # Set connections self.inHour.currentTextChanged.connect(self._setDuration) self.inMin.currentTextChanged.connect(self._setDuration) self.inSec.currentTextChanged.connect(self._setDuration) self.inFreqWeighting.currentTextChanged.connect(self._setFreqWeighting) self.inTimeWeighting.currentTextChanged.connect(self._setTimeWeighting) def _setTabCalibration(self): self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') self.lbl_pleaseWait.setText('') self.btnAccept.setEnabled(False) self.btnDecline.setEnabled(False) # Set reference sound pressure self.inPressureRef.setCurrentText('%02d dB'%self.newParams['pCalib']) # Set reference frequency self.inFrequencyRef.setCurrentText('%d Hz'%self.newParams['fCalib']) # Set current correction factor self.val_CurrentCorrFactor.setText('%.2f dB'%self.newParams['corrFactor']) # Set current sensitivity self.val_CurrentSensitivity.setText('%.2f mV/Pa'%self.newParams['sensitivity']) self.inPressureRef.currentTextChanged.connect(self._setPressureRef) self.inFrequencyRef.currentIndexChanged.connect(self._setFrequencyRef) self.btnCalibrate.clicked.connect(self.btnCalibrate_Action) self.btnAccept.clicked.connect(self.btnAccept_Action) self.btnDecline.clicked.connect(self.btnDecline_Action) def _setTabSpectrumCorretion(self): if self.currentParams['micCorrFile'] != None: _, file_name = os.path.split(self.currentParams['micCorrFile']) self.disp_CurrentMicFile.setText(file_name) if self.currentParams['applyMicCorr']: self.onMicCorr.setChecked(True) else: self.onMicCorr.setChecked(False) else: self.disp_CurrentMicFile.setText('No microphone calibration files defined') self.onMicCorr.setEnabled(False) self.onMicCorr.setChecked(False) if self.currentParams['adcCorrFile'] != None: _, file_name = os.path.split(self.currentParams['adcCorrFile']) self.disp_CurrentADCFile.setText(file_name) if self.currentParams['applyAdcCorr']: self.onADCCorr.setChecked(True) else: self.onADCCorr.setChecked(False) else: self.disp_CurrentADCFile.setText('No ADC calibration file defined') self.onADCCorr.setEnabled(False) self.onADCCorr.setChecked(False) # Set connections self.btnLoadMicFile.clicked.connect(self._openMicFile) self.btnLoadADCFile.clicked.connect(self._openAdcFile) self.onMicCorr.clicked.connect(self._setOnMicCorr) self.onADCCorr.clicked.connect(self._setOnADCCorr) return def _openMicFile(self): try: file = str(QtWidgets.QFileDialog.getOpenFileName(self, "Select microphone calibration file", "", "*.txt")) if file == "('', '')": Exception else: pass if sys.platform == 'win32' or sys.platform == 'win64': file = file.replace('/', '\\') file = file[1:].replace(", '*.txt')", "").replace("'", "") _, file_name = os.path.split(file) # print("Path: {}\nFile: {}\n".format(folder, file_name)) micData = np.loadtxt(fname=file) self.newParams['micCorrFile'] = file self.newParams['micCorr'] = micData self.onMicCorr.setEnabled(True) self.disp_CurrentMicFile.setText(file_name) self.changedParams() except: self.disp_CurrentMicFile.setText('No microphone calibration files defined') return def _openAdcFile(self): try: file = str(QtWidgets.QFileDialog.getOpenFileName(self, "Select ADC calibration file", "", "*.txt")) if file == "('', '')": Exception else: pass if sys.platform == 'win32' or sys.platform == 'win64': file = file.replace('/', '\\') file = file[1:].replace(", '*.txt')", "").replace("'", "") _, file_name = os.path.split(file) # print("Path: {}\nFile: {}\n".format(folder, file_name)) micADC = np.loadtxt(fname=file) self.newParams['adcCorrFile'] = file self.newParams['adcCorr'] = micADC self.onADCCorr.setEnabled(True) self.disp_CurrentADCFile.setText(file_name) self.changedParams() except: self.disp_CurrentADCFile.setText('No ADC calibration file defined') return def _setOnMicCorr(self): if self.onMicCorr.isChecked(): self.newParams['applyMicCorr'] = True else: self.newParams['applyMicCorr'] = False self.changedParams() return def _setOnADCCorr(self): if self.onADCCorr.isChecked(): self.newParams['applyAdcCorr'] = True else: self.newParams['applyAdcCorr'] = False self.changedParams() return def _setTabDevice(self): self._listParamsTabDevice() self.listInDevices.currentIndexChanged.connect(self._setInputDevice) self.inChannels.currentIndexChanged.connect(self._setInChannels) self.listSampleRate.currentIndexChanged.connect(self._setSampleRate) return def _setInputDevice(self): self.inChannels.clear() self.listSampleRate.clear() # Query devices inputDevices, outputDevices, _ = self._setDevices() d = [inputDevices[self.listInDevices.currentIndex()]['id'], outputDevices[self.listOutDevices.currentIndex()]['id']] self.newParams['device'], self.newParams['fs'] = \ self._checkParamsDevice(d, self.newParams['fs']) # List and set input channels for inCh in range(len(inputDevices[self.listInDevices.currentIndex()]['listCha'])): self.inChannels.addItem("") self.inChannels.setItemText(inCh, str(inCh+1)) self.inChannels.setCurrentText(str(self.newParams['inCh'][0])) # List sample rate for fs in range(len(inputDevices[self.listInDevices.currentIndex()]['fs_list'])): self.listSampleRate.addItem("") self.listSampleRate.setItemText(fs, '%d Hz'%inputDevices[self.listInDevices.currentIndex()]['fs_list'][fs]) # Set sample rate self.listSampleRate.setCurrentText('%d Hz'%self.newParams['fs']) self.changedParams() return def _setInChannels(self): if self.inChannels.count() > 0: self.newParams['inCh'] = [self.inChannels.currentIndex()+1] self.changedParams() else: pass return def _setSampleRate(self): if self.listSampleRate.count() > 0: if self.listSampleRate.currentText() != '': self.newParams['fs'] = int(self.listSampleRate.currentText().replace(' Hz', '')) self.changedParams() else: pass return def _setPressureRef(self): self.newParams['pCalib'] = int(self.inPressureRef.currentText().replace(' dB', '')) self.changedParams() return def _setFrequencyRef(self): self.newParams['fCalib'] = int(self.inFrequencyRef.currentText().replace(' Hz', '')) self.changedParams() return def _setDuration(self): hour = int(self.inHour.currentText().replace('h', '')) minute = int(self.inMin.currentText().replace('m', '')) second = int(self.inSec.currentText().replace('s', '')) duration = 3600*hour + 60*minute + second if duration < 15: duration = 15 self.inSec.setCurrentText('15s') else: pass self.newParams['duration'] = duration self.changedParams() return def _setFreqWeighting(self): self.newParams['fweighting'] = self.inFreqWeighting.currentText() self.changedParams() return def _setTimeWeighting(self): TimeWeighting = {'Impulse': 0.035, 'Fast': 0.125, 'Slow': 1.0} self.newParams['tau'] = TimeWeighting[self.inTimeWeighting.currentText()] self.changedParams() return def changedParams(self): changes = [] for key in self.newParams.keys(): if not type(self.newParams[key]) is np.ndarray: if self.newParams[key] == self.currentParams[key]: changes.append(True) else: changes.append(False) elif type(self.newParams[key]) == np.ndarray: if np.array_equal(a1=self.newParams[key], a2=self.currentParams[key]): changes.append(True) else: changes.append(False) else: pass if not False in changes: self.btnApply.setEnabled(False) self.btnApply.setText('Apply') self.btnRestore.setEnabled(False) else: self.btnApply.setEnabled(True) self.btnApply.setText('Apply*') self.btnRestore.setEnabled(True) return def btnCalibrate_Action(self): self.btnCalibrate.setEnabled(False) self.btnAccept.setEnabled(False) self.btnDecline.setEnabled(False) self.stream_calibration = pyslm.StreamManager(version = 'DataLogger', path = os.path.join(self.currentParams['pathProject'], self.currentParams['currentProject']), device=self.currentParams['device'], fs=self.currentParams['fs'], inCh=self.currentParams['inCh'], tau=1.0, fweighting=self.currentParams['fweighting'], duration=10, template='calibration', fCalib=self.currentParams['fCalib'], pCalib=self.currentParams['pCalib'], calibFactor=self.currentParams['calibFactor'], micCorr=self.currentParams['micCorr'], applyMicCorr=self.currentParams['applyMicCorr'], adcCorr=self.currentParams['adcCorr'], applyAdcCorr=self.currentParams['applyAdcCorr'], saveRawData=self.currentParams['saveRawData']) self.stream_calibration.play() self.stream_calibration.realtime_data.connect(self.updateCalibrate) self.stream_calibration.fullresults_data.connect(self.fullCalibrate) return @QtCore.pyqtSlot(dict) def updateCalibrate(self, results): SPLmax = results['SPLmax'] freqmax = results['freqmax'] framesRead = self.stream_calibration.framesRead countdown = int(self.stream_calibration.duration - framesRead/self.stream_calibration.fs) if countdown > 0: self.lbl_pleaseWait.setText('Performing calibration, please wait %02ds'%countdown) self.lbl_NewCorrFactor.setText('%.02f dB'%SPLmax) self.lbl_NewSensitivity.setText('at %.01f Hz'%freqmax) else: pass return @QtCore.pyqtSlot(dict) def fullCalibrate(self, results): self.lbl_pleaseWait.setText('Performing calibration, please wait 00s') self.sensitivity = results['sensitivity'] self.correction = results['correction'] self.FC = results['FC'] self.lbl_NewCorrFactor.setText('New correction factor: %.02f dB'%self.correction) self.lbl_NewSensitivity.setText('New sensitivity: %.02f mV/Pa'%self.sensitivity) self.btnAccept.setEnabled(True) self.btnDecline.setEnabled(True) def btnAccept_Action(self): self.currentParams['corrFactor'] = self.correction self.currentParams['sensitivity'] = self.sensitivity self.currentParams['calibFactor'] = self.FC self.newParams['corrFactor'] = self.correction self.newParams['sensitivity'] = self.sensitivity self.newParams['calibFactor'] = self.FC self.val_CurrentCorrFactor.setText('%.2f dB'%self.newParams['corrFactor']) self.val_CurrentSensitivity.setText('%.2f mV/Pa'%self.newParams['sensitivity']) pyslm.parameters.update(self.currentParams) self.changedParams() self.lbl_pleaseWait.setText('') self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') self.btnDecline.setEnabled(False) self.btnAccept.setEnabled(False) self.btnCalibrate.setEnabled(True) return def btnDecline_Action(self): self.changedParams() self.lbl_pleaseWait.setText('') self.lbl_NewCorrFactor.setText('') self.lbl_NewSensitivity.setText('') self.btnDecline.setEnabled(False) self.btnAccept.setEnabled(False) self.btnCalibrate.setEnabled(True) return def btnClose_Action(self): # os.chdir(path_main) self.close() return def btnApply_Action(self): self.currentParams = self.newParams.copy() self.changedParams() pyslm.parameters.update(self.currentParams) return def btnRestore_Action(self): self.restore = True self._restore() self.restore = False return def seconds2HMN(self, seconds): M, S = divmod(seconds, 60) H, M = divmod(M, 60) # return "%02d:%02d:%02d" % (H, M, S) return '%02dh'%H, '%02dm'%M, '%02ds'%S def _listParamsTabDevice(self): # Query devices inputDevices, _, _ = self._setDevices() sd_devices = sd.query_devices() self.newParams['device'], self.newParams['fs'] = \ self._checkParamsDevice(self.newParams['device'], self.newParams['fs']) # List input devices for dev in range(len(inputDevices)): self.listInDevices.addItem("") self.listInDevices.setItemText(dev, inputDevices[dev]['name']) # Set input device self.listInDevices.setCurrentText(sd_devices[self.newParams['device'][0]]['name']) # List and set input channels for inCh in range(len(inputDevices[self.listInDevices.currentIndex()]['listCha'])): self.inChannels.addItem("") self.inChannels.setItemText(inCh, str(inCh+1)) self.inChannels.setCurrentText(str(self.newParams['inCh'][0])) # List sample rate for fs in range(len(inputDevices[self.listInDevices.currentIndex()]['fs_list'])): self.listSampleRate.addItem("") self.listSampleRate.setItemText(fs, '%d Hz'%inputDevices[self.listInDevices.currentIndex()]['fs_list'][fs]) # Set sample rate self.listSampleRate.setCurrentText('%d Hz'%self.newParams['fs']) return def _checkParamsDevice(self, device, fs): # Check input parameters inputDevice = device[0] outputDevice = device[1] try: sd.check_input_settings(device=inputDevice, samplerate=fs) except: sd_devices = sd.query_devices() inputDevice = sd.default.device[0] fs = int(sd_devices[sd.default.device[0]]['default_samplerate']) else: pass return [inputDevice, outputDevice], fs def _setDevices(self): sd_devices = sd.query_devices() def supportedFs(device, kind): samplerates = [44100, 48000, 96000, 128000] supported_samplerates = [] for fs in samplerates: try: if kind == 'in': sd.check_input_settings(device=device, samplerate=fs) else: sd.check_output_settings(device=device, samplerate=fs) except: pass else: supported_samplerates.append(fs) return supported_samplerates def supportedCha(device, kind, numCha): supported_channels = [] for ch in range(numCha+1): try: if kind == 'in': sd.check_input_settings(device=device, channels=ch) else: sd.check_output_settings(device=device, channels=ch) except: pass else: supported_channels.append(ch) return supported_channels inputDevices = [] outputDevices = [] for dev in range(len(sd_devices)): if sd_devices[dev]['max_input_channels'] > 0: listFs = supportedFs(dev, 'in') listCha = supportedCha(dev, 'in', sd_devices[dev]['max_input_channels']) inputDevices.append({'name': sd_devices[dev]['name'], 'numCha': sd_devices[dev]['max_input_channels'], 'id': dev, 'fs_default': sd_devices[dev]['default_samplerate'], 'fs_list': listFs, 'listCha': listCha}) if sd_devices[dev]['max_output_channels'] > 0: listFs = supportedFs(dev, 'out') listCha = supportedCha(dev, 'out', sd_devices[dev]['max_output_channels']) outputDevices.append({'name': sd_devices[dev]['name'], 'numCha': sd_devices[dev]['max_output_channels'], 'id': dev, 'fs_default': sd_devices[dev]['default_samplerate'], 'fs_list': listFs, 'listCha': listCha}) defaultDevices = {} for dev in range(len(inputDevices)): if inputDevices[dev]['id'] == sd.default.device[0]: defaultDevices['in'] = inputDevices[dev] for dev in range(len(outputDevices)): if outputDevices[dev]['id'] == sd.default.device[1]: defaultDevices['out'] = outputDevices[dev] return inputDevices, outputDevices, defaultDevices def _setPathProject(self): if os.path.isdir(self.newParams['pathProject']): pathDefault = self.newParams['pathProject'] elif os.path.isdir(os.path.expanduser("~/Desktop")): pathDefault = os.path.expanduser("~/Desktop") else: pathDefault = os.getcwd() path = str(QtWidgets.QFileDialog.getExistingDirectory(self, "Select Directory", pathDefault)) if sys.platform == 'win32' or sys.platform == 'win64': path = path.replace('/', '\\') projectFolder, currentProject = os.path.split(path) self.newParams['pathProject'] = projectFolder self.newParams['currentProject'] = currentProject self.disp_ProjectsFolder.setText(projectFolder) self.disp_CurrentProject.setText(currentProject) self.changedParams() return def _setSaveData(self): if self.onSaveData.isChecked(): self.newParams['saveRawData'] = True else: self.newParams['saveRawData'] = False self.changedParams() return def _setTabProjects(self): if not os.path.isdir(self.newParams['pathProject']): if os.path.isdir(os.path.expanduser("~/Desktop")): self.newParams['pathProject'] = os.path.expanduser("~/Desktop") else: self.newParams['pathProject'] = os.getcwd() self.disp_ProjectsFolder.setText(self.newParams['pathProject']) self.disp_CurrentProject.setText(self.newParams['currentProject']) os.chdir(self.newParams['pathProject']) self.allProjects = os.listdir(".") if self.newParams['saveRawData']: self.onSaveData.setChecked(True) else: self.onSaveData.setChecked(False) self.onSaveData.toggled.connect(self._setSaveData) self.btnChangeProject.clicked.connect(self._setPathProject) self.btnNewProject.clicked.connect(self.btnNewProject_Action) return def btnNewProject_Action(self): self.btnNewProject.setEnabled(False) dlgNewProject = VirtualKeyBoard(self.newParams['pathProject'], self.newParams['currentProject'], self.allProjects) dlgNewProject.exec_() if not dlgNewProject.isActiveWindow(): self.newParams['currentProject'] = dlgNewProject.currentProject self.newParams['pathProject'] = dlgNewProject.pathProject self.disp_ProjectsFolder.setText(self.newParams['pathProject']) self.disp_CurrentProject.setText(self.newParams['currentProject']) self.btnNewProject.setEnabled(True) self.changedParams() return class VirtualKeyBoard(QtWidgets.QDialog, pyslm.guiKeyboard): def __init__(self, pathProject: str, currentProject: str, allProjects: list, parent=None): super(VirtualKeyBoard, self).__init__(parent) self.setupUi(self) self.pathProject = pathProject self.currentProject = currentProject self.allProjects = allProjects self.btnCreate.setEnabled(False) self.minStr = ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p",\ "a", "s", "d", "f", "g", "h", "j", "k", "l", "ç",\ "z", "x", "c", "v", "b", "n", "m"] self.maiStr = list(map(str.upper, self.minStr)) self.upper = False self.vk_a.clicked.connect(self.vk_aAction) self.vk_b.clicked.connect(self.vk_bAction) self.vk_c.clicked.connect(self.vk_cAction) self.vk_d.clicked.connect(self.vk_dAction) self.vk_e.clicked.connect(self.vk_eAction) self.vk_f.clicked.connect(self.vk_fAction) self.vk_g.clicked.connect(self.vk_gAction) self.vk_h.clicked.connect(self.vk_hAction) self.vk_i.clicked.connect(self.vk_iAction) self.vk_j.clicked.connect(self.vk_jAction) self.vk_k.clicked.connect(self.vk_kAction) self.vk_l.clicked.connect(self.vk_lAction) self.vk_m.clicked.connect(self.vk_mAction) self.vk_n.clicked.connect(self.vk_nAction) self.vk_o.clicked.connect(self.vk_oAction) self.vk_p.clicked.connect(self.vk_pAction) self.vk_q.clicked.connect(self.vk_qAction) self.vk_r.clicked.connect(self.vk_rAction) self.vk_s.clicked.connect(self.vk_sAction) self.vk_t.clicked.connect(self.vk_tAction) self.vk_u.clicked.connect(self.vk_uAction) self.vk_v.clicked.connect(self.vk_vAction) self.vk_w.clicked.connect(self.vk_wAction) self.vk_x.clicked.connect(self.vk_xAction) self.vk_y.clicked.connect(self.vk_yAction) self.vk_z.clicked.connect(self.vk_zAction) self.vk_0.clicked.connect(self.vk_0Action) self.vk_1.clicked.connect(self.vk_1Action) self.vk_2.clicked.connect(self.vk_2Action) self.vk_3.clicked.connect(self.vk_3Action) self.vk_4.clicked.connect(self.vk_4Action) self.vk_5.clicked.connect(self.vk_5Action) self.vk_6.clicked.connect(self.vk_6Action) self.vk_7.clicked.connect(self.vk_7Action) self.vk_8.clicked.connect(self.vk_8Action) self.vk_9.clicked.connect(self.vk_9Action) self.vk_underscore.clicked.connect(self.vk_underscoreAction) self.delAll.clicked.connect(self.delAllAction) self.capsLock.clicked.connect(self.btncapsLock) self.space.clicked.connect(self.spaceAction) self.backspace.clicked.connect(self.backspaceAction) self.btnCancel.clicked.connect(self.btnCancel_Action) self.btnCreate.clicked.connect(self.btnCreate_Action) return def btnCancel_Action(self): self.delAllAction() return def btnCreate_Action(self): if not os.path.isdir(os.path.join(self.pathProject, self.entryProjectname.toPlainText())): self.currentProject = self.entryProjectname.toPlainText() os.mkdir(os.path.join(self.pathProject, self.entryProjectname.toPlainText())) else: pass self.delAllAction() self.close() return def _checkVirtualKeyboard(self): if self.entryProjectname.toPlainText() == "": self.btnCreate.setEnabled(False) elif self.entryProjectname.toPlainText() in self.allProjects: self.btnCreate.setEnabled(False) else: self.btnCreate.setEnabled(True) return def btncapsLock(self): self.upper = not self.upper if self.upper: self.vk_q.setText(self.maiStr[0]) self.vk_w.setText(self.maiStr[1]) self.vk_e.setText(self.maiStr[2]) self.vk_r.setText(self.maiStr[3]) self.vk_t.setText(self.maiStr[4]) self.vk_y.setText(self.maiStr[5]) self.vk_u.setText(self.maiStr[6]) self.vk_i.setText(self.maiStr[7]) self.vk_o.setText(self.maiStr[8]) self.vk_p.setText(self.maiStr[9]) self.vk_a.setText(self.maiStr[10]) self.vk_s.setText(self.maiStr[11]) self.vk_d.setText(self.maiStr[12]) self.vk_f.setText(self.maiStr[13]) self.vk_g.setText(self.maiStr[14]) self.vk_h.setText(self.maiStr[15]) self.vk_j.setText(self.maiStr[16]) self.vk_k.setText(self.maiStr[17]) self.vk_l.setText(self.maiStr[18]) self.vk_z.setText(self.maiStr[20]) self.vk_x.setText(self.maiStr[21]) self.vk_c.setText(self.maiStr[22]) self.vk_v.setText(self.maiStr[23]) self.vk_b.setText(self.maiStr[24]) self.vk_n.setText(self.maiStr[25]) self.vk_m.setText(self.maiStr[26]) else: self.vk_q.setText(self.minStr[0]) self.vk_w.setText(self.minStr[1]) self.vk_e.setText(self.minStr[2]) self.vk_r.setText(self.minStr[3]) self.vk_t.setText(self.minStr[4]) self.vk_y.setText(self.minStr[5]) self.vk_u.setText(self.minStr[6]) self.vk_i.setText(self.minStr[7]) self.vk_o.setText(self.minStr[8]) self.vk_p.setText(self.minStr[9]) self.vk_a.setText(self.minStr[10]) self.vk_s.setText(self.minStr[11]) self.vk_d.setText(self.minStr[12]) self.vk_f.setText(self.minStr[13]) self.vk_g.setText(self.minStr[14]) self.vk_h.setText(self.minStr[15]) self.vk_j.setText(self.minStr[16]) self.vk_k.setText(self.minStr[17]) self.vk_l.setText(self.minStr[18]) self.vk_z.setText(self.minStr[20]) self.vk_x.setText(self.minStr[21]) self.vk_c.setText(self.minStr[22]) self.vk_v.setText(self.minStr[23]) self.vk_b.setText(self.minStr[24]) self.vk_n.setText(self.minStr[25]) self.vk_m.setText(self.minStr[26]) self._checkVirtualKeyboard() return def vk_aAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_a.text()) self._checkVirtualKeyboard() return def vk_bAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_b.text()) self._checkVirtualKeyboard() return def vk_cAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_c.text()) self._checkVirtualKeyboard() return def vk_dAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_d.text()) self._checkVirtualKeyboard() return def vk_eAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_e.text()) self._checkVirtualKeyboard() return def vk_fAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_f.text()) self._checkVirtualKeyboard() return def vk_gAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_g.text()) self._checkVirtualKeyboard() return def vk_hAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_h.text()) self._checkVirtualKeyboard() return def vk_iAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_i.text()) self._checkVirtualKeyboard() return def vk_jAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_j.text()) self._checkVirtualKeyboard() return def vk_kAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_k.text()) self._checkVirtualKeyboard() return def vk_lAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_l.text()) self._checkVirtualKeyboard() return def vk_mAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_m.text()) self._checkVirtualKeyboard() return def vk_nAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_n.text()) self._checkVirtualKeyboard() return def vk_oAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_o.text()) self._checkVirtualKeyboard() return def vk_pAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_p.text()) self._checkVirtualKeyboard() return def vk_qAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_q.text()) self._checkVirtualKeyboard() return def vk_rAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_r.text()) self._checkVirtualKeyboard() return def vk_sAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_s.text()) self._checkVirtualKeyboard() return def vk_tAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_t.text()) self._checkVirtualKeyboard() return def vk_uAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_u.text()) self._checkVirtualKeyboard() return def vk_vAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_v.text()) self._checkVirtualKeyboard() return def vk_wAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_w.text()) self._checkVirtualKeyboard() return def vk_xAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_x.text()) self._checkVirtualKeyboard() return def vk_yAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_y.text()) self._checkVirtualKeyboard() return def vk_zAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_z.text()) self._checkVirtualKeyboard() return def spaceAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + ' ') self._checkVirtualKeyboard() return def backspaceAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText()[:-1]) self._checkVirtualKeyboard() return def vk_0Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_0.text()) self._checkVirtualKeyboard() return def vk_1Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_1.text()) self._checkVirtualKeyboard() return def vk_2Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_2.text()) self._checkVirtualKeyboard() return def vk_3Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_3.text()) self._checkVirtualKeyboard() return def vk_4Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_4.text()) self._checkVirtualKeyboard() return def vk_5Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_5.text()) self._checkVirtualKeyboard() return def vk_6Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_6.text()) self._checkVirtualKeyboard() return def vk_7Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_7.text()) self._checkVirtualKeyboard() return def vk_8Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_8.text()) self._checkVirtualKeyboard() return def vk_9Action(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + self.vk_9.text()) self._checkVirtualKeyboard() return def vk_underscoreAction(self): self.entryProjectname.setText(self.entryProjectname.toPlainText() + '_') self._checkVirtualKeyboard() return def delAllAction(self): self.entryProjectname.setText('') self._checkVirtualKeyboard() return #%% if __name__ == '__main__': import sys app = QtWidgets.QApplication(sys.argv) dlgSetup = setSetup() # dlgSetup.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False) # dlgSetup.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False) dlgSetup.exec_() app.exec_() app.quit()
42.215867
141
0.603896
9,063
91,524
5.989849
0.063555
0.03581
0.036142
0.049239
0.86094
0.842022
0.830269
0.822496
0.809012
0.798198
0
0.014204
0.279249
91,524
2,168
142
42.215867
0.808735
0.019525
0
0.858268
0
0
0.052798
0.000424
0
0
0
0
0
1
0.092913
false
0.018373
0.005249
0
0.188451
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c418cb23b7ba58f968d556c752dbc71cd9aa9865
7,949
py
Python
RVOS/decoder.py
yubin1219/Video_Object_Segmentation
eb6f817d8775353ff9eb5e288eabba485c8f95e0
[ "MIT" ]
null
null
null
RVOS/decoder.py
yubin1219/Video_Object_Segmentation
eb6f817d8775353ff9eb5e288eabba485c8f95e0
[ "MIT" ]
null
null
null
RVOS/decoder.py
yubin1219/Video_Object_Segmentation
eb6f817d8775353ff9eb5e288eabba485c8f95e0
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from .clstm import ConvLSTMCell, ConvLSTMCellMask import torch.nn.functional as f from torch.autograd import Variable class RSIS(nn.Module): """ The recurrent decoder """ def __init__(self, args): super(RSIS,self).__init__() self.hidden_size = args.hidden_size self.kernel_size = args.kernel_size padding = 0 if self.kernel_size == 1 else 1 self.dropout = args.dropout self.skip_mode = args.skip_mode # convlstms have decreasing dimension as width and height increase skip_dims_out = [self.hidden_size, int(self.hidden_size/2), int(self.hidden_size/4),int(self.hidden_size/8)] # initialize layers for each deconv stage self.clstm_list = nn.ModuleList() # 4 is the number of deconv steps that we need to reach image size in the output for i in range(len(skip_dims_out)): if i == 0: clstm_in_dim = self.hidden_size else: clstm_in_dim = skip_dims_out[i-1] if self.skip_mode == 'concat': clstm_in_dim *= 2 clstm_i = ConvLSTMCell(args, clstm_in_dim, skip_dims_out[i],self.kernel_size, padding = padding) self.clstm_list.append(clstm_i) self.conv_out = nn.Conv2d(skip_dims_out[-1], 1,self.kernel_size, padding = padding) # calculate the dimensionality of classification vector # side class activations are taken from the output of the convlstm # therefore we need to compute the sum of the dimensionality of outputs # from all convlstm layers fc_dim = 0 for sk in skip_dims_out: fc_dim += sk def forward(self, skip_feats, prev_state_spatial, prev_hidden_temporal): clstm_in = skip_feats[0] skip_feats = skip_feats[1:] hidden_list = [] for i in range(len(skip_feats)+1): # hidden states will be initialized the first time forward is called if prev_state_spatial is None: if prev_hidden_temporal is None: state = self.clstm_list[i](clstm_in,None, None) else: state = self.clstm_list[i](clstm_in,None, prev_hidden_temporal[i]) else: # else we take the ones from the previous step for the forward pass if prev_hidden_temporal is None: state = self.clstm_list[i](clstm_in, prev_state_spatial[i], None) else: state = self.clstm_list[i](clstm_in, prev_state_spatial[i], prev_hidden_temporal[i]) hidden_list.append(state) hidden = state[0] if self.dropout > 0: hidden = nn.Dropout2d(self.dropout)(hidden) # apply skip connection if i < len(skip_feats): skip_vec = skip_feats[i] upsample = nn.UpsamplingBilinear2d(size = (skip_vec.size()[-2],skip_vec.size()[-1])) hidden = upsample(hidden) if self.skip_mode == 'concat': clstm_in = torch.cat([hidden,skip_vec],1) elif self.skip_mode == 'sum': clstm_in = hidden + skip_vec elif self.skip_mode == 'mul': clstm_in = hidden*skip_vec elif self.skip_mode == 'none': clstm_in = hidden else: raise Exception('Skip connection mode not supported !') else: self.upsample = nn.UpsamplingBilinear2d(size = (hidden.size()[-2]*2,hidden.size()[-1]*2)) hidden = self.upsample(hidden) clstm_in = hidden out_mask = self.conv_out(clstm_in) # classification branch return out_mask, hidden_list class RSISMask(nn.Module): """ The recurrent decoder """ def __init__(self, args): super(RSISMask,self).__init__() self.hidden_size = args.hidden_size self.kernel_size = args.kernel_size padding = 0 if self.kernel_size == 1 else 1 self.dropout = args.dropout self.skip_mode = args.skip_mode # convlstms have decreasing dimension as width and height increase skip_dims_out = [self.hidden_size, int(self.hidden_size/2), int(self.hidden_size/4),int(self.hidden_size/8)] # initialize layers for each deconv stage self.clstm_list = nn.ModuleList() # 4 is the number of deconv steps that we need to reach image size in the output for i in range(len(skip_dims_out)): if i == 0: clstm_in_dim = self.hidden_size else: clstm_in_dim = skip_dims_out[i-1] if self.skip_mode == 'concat': clstm_in_dim*=2 clstm_i = ConvLSTMCellMask(args, clstm_in_dim, skip_dims_out[i],self.kernel_size, padding = padding) self.clstm_list.append(clstm_i) del clstm_i self.conv_out = nn.Conv2d(skip_dims_out[-1], 1,self.kernel_size, padding = padding) # calculate the dimensionality of classification vector # side class activations are taken from the output of the convlstm # therefore we need to compute the sum of the dimensionality of outputs # from all convlstm layers fc_dim = 0 for sk in skip_dims_out: fc_dim+=sk def forward(self, skip_feats, prev_mask, prev_state_spatial, prev_hidden_temporal): clstm_in = skip_feats[0] skip_feats = skip_feats[1:] hidden_list = [] for i in range(len(skip_feats)+1): # hidden states will be initialized the first time forward is called if prev_state_spatial is None: if prev_hidden_temporal is None: state = self.clstm_list[i](clstm_in, prev_mask[i], None, None) else: state = self.clstm_list[i](clstm_in, prev_mask[i], None, prev_hidden_temporal[i]) else: # else we take the ones from the previous step for the forward pass if prev_hidden_temporal is None: state = self.clstm_list[i](clstm_in, prev_mask[i], prev_state_spatial[i], None) else: state = self.clstm_list[i](clstm_in, prev_mask[i], prev_state_spatial[i], prev_hidden_temporal[i]) #print(prev_hidden_temporal[i].shape) hidden_list.append(state) hidden = state[0] if self.dropout > 0: hidden = nn.Dropout2d(self.dropout)(hidden) # apply skip connection if i < len(skip_feats): skip_vec = skip_feats[i] upsample = nn.UpsamplingBilinear2d(size = (skip_vec.size()[-2],skip_vec.size()[-1])) hidden = upsample(hidden) if self.skip_mode == 'concat': clstm_in = torch.cat([hidden,skip_vec],1) elif self.skip_mode == 'sum': clstm_in = hidden + skip_vec elif self.skip_mode == 'mul': clstm_in = hidden*skip_vec elif self.skip_mode == 'none': clstm_in = hidden else: raise Exception('Skip connection mode not supported !') else: self.upsample = nn.UpsamplingBilinear2d(size = (hidden.size()[-2]*2,hidden.size()[-1]*2)) hidden = self.upsample(hidden) clstm_in = hidden del hidden out_mask = self.conv_out(clstm_in) del clstm_in, skip_feats return out_mask, hidden_list
38.965686
118
0.570386
999
7,949
4.316316
0.131131
0.050325
0.038961
0.033395
0.937848
0.92718
0.92718
0.92718
0.90538
0.90538
0
0.011169
0.34671
7,949
203
119
39.157635
0.81918
0.151969
0
0.820896
0
0
0.017342
0
0
0
0
0
0
1
0.029851
false
0
0.037313
0
0.097015
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c4872336091c7016dba34204ebfd205023178cec
23,211
py
Python
mpf/tests/test_Diverter.py
pmansukhani/mpf
0979965d24bcaba9423b43581c6a18b847b1b900
[ "MIT" ]
null
null
null
mpf/tests/test_Diverter.py
pmansukhani/mpf
0979965d24bcaba9423b43581c6a18b847b1b900
[ "MIT" ]
null
null
null
mpf/tests/test_Diverter.py
pmansukhani/mpf
0979965d24bcaba9423b43581c6a18b847b1b900
[ "MIT" ]
null
null
null
from mpf.tests.MpfTestCase import MpfTestCase, test_config from unittest.mock import MagicMock class TestDiverter(MpfTestCase): def getMachinePath(self): return 'tests/machine_files/diverter/' def get_platform(self): return "smart_virtual" def start_game(self): # shots only work in games so we have to do this a lot self.machine.events.post('game_start') self.advance_time_and_run() self.machine.game.balls_in_play = 1 self.assertIsNotNone(self.machine.game) def _block_device(self, queue, **kwargs): del kwargs self.queue = queue queue.wait() @test_config("only_events_no_coils.yaml") def test_diverter_with_servo_and_stepper(self): self.queue = None diverter = self.machine.diverters["d_test_with_events"] self.advance_time_and_run(.1) self.assertEqual(.2, self.machine.servos["s_diverter"].hw_servo.current_position) self.assertEqual(400, self.machine.steppers["s_diverter"].hw_stepper._current_position) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.assertEqual(.7, self.machine.servos["s_diverter"].hw_servo.current_position) self.assertEqual(20, self.machine.steppers["s_diverter"].hw_stepper._current_position) self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.assertEqual(.2, self.machine.servos["s_diverter"].hw_servo.current_position) self.assertEqual(400, self.machine.steppers["s_diverter"].hw_stepper._current_position) self.hit_switch_and_run("s_ball_switch1", 1) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.assertEqual(.2, self.machine.servos["s_diverter"].hw_servo.current_position) self.assertEqual(400, self.machine.steppers["s_diverter"].hw_stepper._current_position) self.advance_time_and_run(4) self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_delayed_eject.yaml") def test_delayed_eject(self): self.queue = None diverter = self.machine.diverters["d_test_delayed_eject"] self.machine.coils["c_diverter"].enable = MagicMock() self.machine.coils["c_diverter"].disable = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.events.add_handler("balldevice_test_trough_ball_eject_attempt", self._block_device) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(20) self.queue.clear() self.advance_time_and_run(1) self.machine.events.remove_handler_by_event("balldevice_test_trough_ball_eject_attempt", self._block_device) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.machine.coils["c_diverter"].enable.assert_called_once_with() self.machine.coils["c_diverter"].enable = MagicMock() assert not self.machine.coils["c_diverter"].disable.called self.advance_time_and_run(4) self.machine.coils["c_diverter"].disable.assert_called_once_with() assert not self.machine.coils["c_diverter"].enable.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.hit_switch_and_run("s_ball_switch1", 1) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].enable.called self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_hold_activation_time.yaml") def test_hold_activation_time(self): diverter = self.machine.diverters["d_test_hold_activation_time"] self.machine.coils["c_diverter"].enable = MagicMock() self.machine.coils["c_diverter"].disable = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.machine.coils["c_diverter"].enable.assert_called_once_with() self.machine.coils["c_diverter"].enable = MagicMock() assert not self.machine.coils["c_diverter"].disable.called self.advance_time_and_run(4) self.machine.coils["c_diverter"].disable.assert_called_once_with() assert not self.machine.coils["c_diverter"].enable.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.hit_switch_and_run("s_ball_switch1", 1) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].enable.called @test_config("test_hold_no_activation_time.yaml") def test_hold_no_activation_time(self): diverter = self.machine.diverters["d_test_hold"] self.assertEqual("idle", self.machine.ball_devices["test_trough"]._state) self.assertEqual("idle", self.machine.ball_devices["test_target"]._state) self.machine.coils["c_diverter"].enable = MagicMock() self.machine.coils["c_diverter"].disable = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # test active side self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.machine.coils["c_diverter"].enable.assert_called_once_with() self.machine.coils["c_diverter"].enable = MagicMock() assert not self.machine.coils["c_diverter"].disable.called self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].disable.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.machine.coils["c_diverter"].disable.assert_called_once_with() self.hit_switch_and_run("s_ball_switch1", 1) # test inactive side self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].enable.called self.hit_switch_and_run("s_ball_switch1", 1) @test_config("test_missing_ball_at_source.yaml") def test_missing_ball_at_source(self): diverter = self.machine.diverters["d_test"] trough1 = self.machine.ball_devices["test_trough"] target = self.machine.ball_devices["test_target"] self.machine.default_platform.actions[trough1].set_result("missing") trough1.eject(1, target) self.advance_time_and_run(1) self.assertEqual(1, diverter.diverting_ejects_count) self.advance_time_and_run(100) self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_eject_to_oposide_sides2.yaml") def test_eject_to_oposide_sides2(self): diverter = self.machine.diverters["d_test_hold"] trough1 = self.machine.ball_devices["test_trough"] trough2 = self.machine.ball_devices["test_trough2"] playfield = self.machine.playfield target = self.machine.ball_devices["test_target"] self.assertEqual(3, trough1.balls) self.assertEqual(3, trough2.balls) trough1.eject(1, playfield) trough2.eject(1, target) trough1.eject(1, playfield) trough2.eject(1, playfield) trough1.eject(1, target) trough2.eject(1, target) self.advance_time_and_run(100) self.assertEqual("idle", trough1._state) self.assertEqual("idle", trough2._state) self.assertEqual(0, diverter.diverting_ejects_count) self.assertEqual(3, playfield.balls) self.assertEqual(3, target.balls) self.assertEqual(0, trough1.balls) self.assertEqual(0, trough2.balls) @test_config("test_eject_to_oposide_sides.yaml") def test_eject_to_oposide_sides(self): diverter = self.machine.diverters["d_test_hold"] trough1 = self.machine.ball_devices["test_trough"] trough2 = self.machine.ball_devices["test_trough2"] playfield = self.machine.playfield target = self.machine.ball_devices["test_target"] pulse1 = self.machine.coils["eject_coil1"].pulse pulse3 = self.machine.coils["eject_coil3"].pulse self.machine.coils["eject_coil1"].pulse = MagicMock(wraps=pulse1) self.machine.coils["eject_coil3"].pulse = MagicMock(wraps=pulse3) # this goes to the active side of the diverter trough1.eject(1, playfield) # this goes to the inactive side of the diverter trough2.eject(1, target) self.advance_time_and_run(5) self.assertEqual("ball_left", trough1._state) self.assertEqual("waiting_for_target_ready", trough2._state) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) # only trough1 ejects. trought2 waits because of diverter self.assertTrue(self.machine.coils["eject_coil1"].pulse.called) assert not self.machine.coils["eject_coil3"].pulse.called self.assertEqual(1, diverter.diverting_ejects_count) self.hit_and_release_switch("s_playfield") self.advance_time_and_run(3) # wait for cooldown self.assertFalse(self.machine.coils["eject_coil3"].pulse.called) self.assertEqual(1, diverter.diverting_ejects_count) self.advance_time_and_run(3) self.assertTrue(self.machine.coils["eject_coil3"].pulse.called) self.assertEqual(1, diverter.diverting_ejects_count) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.coils["eject_coil1"].pulse = MagicMock(wraps=pulse1) self.machine.coils["eject_coil3"].pulse = MagicMock(wraps=pulse3) self.machine.ball_devices["test_target"].eject() self.advance_time_and_run(20) self.assertEqual("idle", trough1._state) self.assertEqual("idle", trough2._state) self.assertEqual(2, trough1.balls) self.assertEqual(1, trough2.balls) self.assertEqual("idle", target._state) self.assertEqual(0, diverter.diverting_ejects_count) self.machine.log.info("START") # same scenario but change order trough2.eject(1, target) trough1.eject(1, playfield) self.advance_time_and_run(0.05) self.assertEqual("waiting_for_target_ready", trough1._state) self.assertEqual("ball_left", trough2._state) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.assertTrue(self.machine.coils["eject_coil3"].pulse.called) assert not self.machine.coils["eject_coil1"].pulse.called self.hit_and_release_switch("s_playfield") self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # wait for cooldown self.advance_time_and_run(3) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.assertTrue(self.machine.coils["eject_coil1"].pulse.called) self.advance_time_and_run(20) self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_pulsed_activation_time.yaml") def test_pulsed_activation_time(self): diverter = self.machine.diverters["d_test_pulse"] self.machine.coils["c_diverter"].pulse = MagicMock() self.machine.coils["c_diverter_disable"].pulse = MagicMock() self.post_event("machine_reset_phase_3") self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.assertTrue(self.machine.coils["c_diverter_disable"].pulse.called) assert not self.machine.coils["c_diverter"].pulse.called self.assertEqual("idle", self.machine.ball_devices["test_trough"]._state) self.assertEqual("idle", self.machine.ball_devices["test_target"]._state) self.machine.coils["c_diverter"].pulse = MagicMock() self.machine.coils["c_diverter_disable"].pulse = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.assertTrue(self.machine.coils["c_diverter"].pulse.called) self.machine.coils["c_diverter"].pulse = MagicMock() assert not self.machine.coils["c_diverter_disable"].pulse.called self.advance_time_and_run(4) assert not self.machine.coils["c_diverter_disable"].pulse.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.assertTrue(self.machine.coils["c_diverter_disable"].pulse.called) self.hit_switch_and_run("s_ball_switch1", 1) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].pulse.called self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_diverter_with_switch.yaml") def test_diverter_with_switch(self): diverter = self.machine.diverters["d_test"] self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # it should not activate self.hit_and_release_switch("s_activate") self.advance_time_and_run(1) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # nothing should happen self.hit_and_release_switch("s_deactivate") self.hit_and_release_switch("s_disable") self.advance_time_and_run(1) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # enable diverter diverter.enable() self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_activate") self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.hit_and_release_switch("s_deactivate") self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_activate") self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.hit_and_release_switch("s_disable") self.advance_time_and_run(1) self.assertFalse(diverter.enabled) self.assertTrue(diverter.active) self.hit_and_release_switch("s_deactivate") self.advance_time_and_run(1) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) @test_config("test_diverter_auto_disable.yaml") def test_diverter_auto_disable(self): diverter = self.machine.diverters["d_test"] # enable diverter diverter.enable() self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_activate") self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.hit_and_release_switch("s_disable") self.advance_time_and_run(1) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) @test_config("test_activation_switch_and_eject_confirm_switch.yaml") def test_activation_switch_and_eject_confirm_switch(self): diverter = self.machine.diverters["d_test_hold_activation_time"] self.machine.coils["c_diverter"].enable = MagicMock() self.machine.coils["c_diverter"].disable = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough2"] self.machine.playfield.add_ball() self.advance_time_and_run(.01) self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) # smart virtual automatically triggers the diverter self.advance_time_and_run(3) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.machine.coils["c_diverter"].enable.assert_called_once_with() self.machine.coils["c_diverter"].enable = MagicMock() assert not self.machine.coils["c_diverter"].disable.called self.advance_time_and_run(4) self.machine.coils["c_diverter"].disable.assert_called_once_with() assert not self.machine.coils["c_diverter"].enable.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.hit_switch_and_run("s_ball_switch1", 1) self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.ball_devices["test_trough2"].eject(1, self.machine.ball_devices["test_target"]) self.advance_time_and_run(.01) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # smart virtual htis diverter switch for us self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_diverter"].enable.called self.assertEqual(0, diverter.diverting_ejects_count) @test_config("test_diverter_dual_wound_coil.yaml") def test_diverter_dual_wound_coil(self): diverter = self.machine.diverters["d_test_dual_wound"] self.assertEqual("idle", self.machine.ball_devices["test_trough"]._state) self.assertEqual("idle", self.machine.ball_devices["test_target"]._state) self.machine.coils["c_hold"].enable = MagicMock() self.machine.coils["c_hold"].disable = MagicMock() self.machine.coils["c_power"].pulse = MagicMock() self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) # test active side self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_trough"] self.machine.playfield.add_ball() self.advance_time_and_run(1) self.assertTrue(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertTrue(diverter.enabled) self.assertTrue(diverter.active) self.machine.coils["c_hold"].enable.assert_called_once_with() self.machine.coils["c_hold"].enable = MagicMock() self.assertTrue(self.machine.coils["c_power"].pulse.called) self.machine.coils["c_power"].pulse = MagicMock() assert not self.machine.coils["c_hold"].disable.called self.advance_time_and_run(4) assert not self.machine.coils["c_hold"].disable.called self.hit_and_release_switch("s_playfield") self.machine_run() self.assertFalse(diverter.active) self.machine.coils["c_hold"].disable.assert_called_once_with() self.hit_switch_and_run("s_ball_switch1", 1) # test inactive side self.machine.playfield.config['default_source_device'] = self.machine.ball_devices["test_target"] self.machine.playfield.add_ball() self.advance_time_and_run(3) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.hit_and_release_switch("s_diverter") self.advance_time_and_run(0.5) self.assertFalse(diverter.enabled) self.assertFalse(diverter.active) self.advance_time_and_run(4) assert not self.machine.coils["c_hold"].enable.called assert not self.machine.coils["c_power"].pulse.called self.hit_switch_and_run("s_ball_switch1", 1)
38.556478
116
0.699108
2,875
23,211
5.368696
0.06087
0.116165
0.111759
0.071137
0.904891
0.890314
0.863427
0.834402
0.78471
0.759767
0
0.010922
0.191375
23,211
601
117
38.620632
0.811444
0.021886
0
0.806897
0
0
0.11814
0.040335
0
0
0
0
0.441379
1
0.036782
false
0
0.004598
0.004598
0.048276
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
8
6724463b230387fa964bad37b3b2eeefcb12a1ab
103
py
Python
src/galaxies_datasets/datasets/galaxy_zoo_challenge/__init__.py
autogalmorph/galaxies_datasets-1
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
[ "MIT" ]
null
null
null
src/galaxies_datasets/datasets/galaxy_zoo_challenge/__init__.py
autogalmorph/galaxies_datasets-1
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
[ "MIT" ]
16
2021-09-21T21:25:05.000Z
2022-03-01T14:10:08.000Z
src/galaxies_datasets/datasets/galaxy_zoo_challenge/__init__.py
autogalmorph/galaxies_datasets-1
30cc9eae195fee8d393c543a27c4b5e637a1e1ba
[ "MIT" ]
2
2022-03-05T14:56:55.000Z
2022-03-09T23:58:56.000Z
"""galaxy_zoo_challenge dataset.""" from .galaxy_zoo_challenge import GalaxyZooChallenge # noqa: F401
34.333333
66
0.805825
12
103
6.583333
0.75
0.227848
0.455696
0
0
0
0
0
0
0
0
0.032258
0.097087
103
2
67
51.5
0.817204
0.398058
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
674ee065cbfe688b67ae443f1e86b0ef2c8865d7
181,796
py
Python
contest/weekly/235/abs_sum_diff.py
phunc20/leetcode
4581f39be565593ad0f5718dd4b0e1c34c209bf3
[ "MIT" ]
null
null
null
contest/weekly/235/abs_sum_diff.py
phunc20/leetcode
4581f39be565593ad0f5718dd4b0e1c34c209bf3
[ "MIT" ]
null
null
null
contest/weekly/235/abs_sum_diff.py
phunc20/leetcode
4581f39be565593ad0f5718dd4b0e1c34c209bf3
[ "MIT" ]
null
null
null
#class Solution: # def minAbsoluteSumDiff(self, nums1: List[int], nums2: List[int]) -> int: def minAbsoluteSumDiff(nums1, nums2): modulo = 10**9 + 7 abs_diff = [abs(nums1[i] - nums2[i]) for i in range(len(nums1))] ans = sum(abs_diff) #if len(set(abs_diff)) == 1: if ans == 0: # i.e. all diff are 0 return ans improvements = [0 for i in range(len(nums1))] for i, diff in enumerate(abs_diff): if diff == 0: pass else: min_diff = diff for j in range(len(nums1)): new_diff = abs(nums1[j] - nums2[i]) #improvements[i] = max(diff - new_diff, 0) #if new_diff < abs_diff[i]: if new_diff < min_diff: #improvements[i] = min_diff - new_diff min_diff = new_diff improvements[i] = diff - min_diff ans -= max(improvements) return ans % modulo def test(nums1, nums2, expected): ans = minAbsoluteSumDiff(nums1, nums2) if ans == expected: print("Congratulations!") else: print("Almost there.") print(f"ans = {ans}") print(f"expected = {expected}") print() if __name__ == "__main__": k = 1 print(f"Example {k}") nums1 = [1,7,5] nums2 = [2,3,5] expected = 3 test(nums1, nums2, expected) k += 1 print(f"Example {k}") nums1 = [2,4,6,8,10] nums2 = [2,4,6,8,10] expected = 0 test(nums1, nums2, expected) k += 1 print(f"Example {k}") nums1 = [1,10,4,4,2,7] nums2 = [9,3,5,1,7,4] expected = 20 test(nums1, nums2, expected) # time limit exceeded k += 1 print(f"Example {k}") nums1 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] nums2 =[100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000,100000] expected = 20 test(nums1, nums2, expected)
2,673.470588
140,012
0.775309
40,246
181,796
3.501565
0.001491
0.283827
0.425719
0.567597
0.995175
0.99509
0.994366
0.994366
0.994054
0.994054
0
0.773071
0.003267
181,796
67
140,013
2,713.373134
0.004647
0.001441
0
0.283019
0
0
0.000623
0
0
0
0
0
0
1
0.037736
false
0.018868
0
0
0.075472
0.169811
0
0
0
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
13
67601eb4c5375d9e742574d10715381b74594324
79
py
Python
sftp/modules/span_typing/__init__.py
hiaoxui/span-finder
c5f9886eae12921796b33bdb84ffcb6bfa905cb4
[ "Apache-2.0" ]
3
2021-05-08T15:35:21.000Z
2022-01-24T02:52:55.000Z
sftp/modules/span_typing/__init__.py
hiaoxui/span-finder
c5f9886eae12921796b33bdb84ffcb6bfa905cb4
[ "Apache-2.0" ]
null
null
null
sftp/modules/span_typing/__init__.py
hiaoxui/span-finder
c5f9886eae12921796b33bdb84ffcb6bfa905cb4
[ "Apache-2.0" ]
1
2021-09-07T22:31:40.000Z
2021-09-07T22:31:40.000Z
from .mlp_span_typing import MLPSpanTyping from .span_typing import SpanTyping
26.333333
42
0.873418
11
79
6
0.636364
0.30303
0.484848
0
0
0
0
0
0
0
0
0
0.101266
79
2
43
39.5
0.929577
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
67c1f9ea20b21a3a4f8b5f6bcb07e48930e6397a
86,712
py
Python
post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta3pt6/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta3pt6/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta3pt6/Output/Histos/MadAnalysis5job_0/selection_9.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
def selection_9(): # Library import import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # Library version matplotlib_version = matplotlib.__version__ numpy_version = numpy.__version__ # Histo binning xBinning = numpy.linspace(500.0,4000.0,401,endpoint=True) # Creating data sequence: middle of each bin xData = numpy.array([504.375,513.125,521.875,530.625,539.375,548.125,556.875,565.625,574.375,583.125,591.875,600.625,609.375,618.125,626.875,635.625,644.375,653.125,661.875,670.625,679.375,688.125,696.875,705.625,714.375,723.125,731.875,740.625,749.375,758.125,766.875,775.625,784.375,793.125,801.875,810.625,819.375,828.125,836.875,845.625,854.375,863.125,871.875,880.625,889.375,898.125,906.875,915.625,924.375,933.125,941.875,950.625,959.375,968.125,976.875,985.625,994.375,1003.125,1011.875,1020.625,1029.375,1038.125,1046.875,1055.625,1064.375,1073.125,1081.875,1090.625,1099.375,1108.125,1116.875,1125.625,1134.375,1143.125,1151.875,1160.625,1169.375,1178.125,1186.875,1195.625,1204.375,1213.125,1221.875,1230.625,1239.375,1248.125,1256.875,1265.625,1274.375,1283.125,1291.875,1300.625,1309.375,1318.125,1326.875,1335.625,1344.375,1353.125,1361.875,1370.625,1379.375,1388.125,1396.875,1405.625,1414.375,1423.125,1431.875,1440.625,1449.375,1458.125,1466.875,1475.625,1484.375,1493.125,1501.875,1510.625,1519.375,1528.125,1536.875,1545.625,1554.375,1563.125,1571.875,1580.625,1589.375,1598.125,1606.875,1615.625,1624.375,1633.125,1641.875,1650.625,1659.375,1668.125,1676.875,1685.625,1694.375,1703.125,1711.875,1720.625,1729.375,1738.125,1746.875,1755.625,1764.375,1773.125,1781.875,1790.625,1799.375,1808.125,1816.875,1825.625,1834.375,1843.125,1851.875,1860.625,1869.375,1878.125,1886.875,1895.625,1904.375,1913.125,1921.875,1930.625,1939.375,1948.125,1956.875,1965.625,1974.375,1983.125,1991.875,2000.625,2009.375,2018.125,2026.875,2035.625,2044.375,2053.125,2061.875,2070.625,2079.375,2088.125,2096.875,2105.625,2114.375,2123.125,2131.875,2140.625,2149.375,2158.125,2166.875,2175.625,2184.375,2193.125,2201.875,2210.625,2219.375,2228.125,2236.875,2245.625,2254.375,2263.125,2271.875,2280.625,2289.375,2298.125,2306.875,2315.625,2324.375,2333.125,2341.875,2350.625,2359.375,2368.125,2376.875,2385.625,2394.375,2403.125,2411.875,2420.625,2429.375,2438.125,2446.875,2455.625,2464.375,2473.125,2481.875,2490.625,2499.375,2508.125,2516.875,2525.625,2534.375,2543.125,2551.875,2560.625,2569.375,2578.125,2586.875,2595.625,2604.375,2613.125,2621.875,2630.625,2639.375,2648.125,2656.875,2665.625,2674.375,2683.125,2691.875,2700.625,2709.375,2718.125,2726.875,2735.625,2744.375,2753.125,2761.875,2770.625,2779.375,2788.125,2796.875,2805.625,2814.375,2823.125,2831.875,2840.625,2849.375,2858.125,2866.875,2875.625,2884.375,2893.125,2901.875,2910.625,2919.375,2928.125,2936.875,2945.625,2954.375,2963.125,2971.875,2980.625,2989.375,2998.125,3006.875,3015.625,3024.375,3033.125,3041.875,3050.625,3059.375,3068.125,3076.875,3085.625,3094.375,3103.125,3111.875,3120.625,3129.375,3138.125,3146.875,3155.625,3164.375,3173.125,3181.875,3190.625,3199.375,3208.125,3216.875,3225.625,3234.375,3243.125,3251.875,3260.625,3269.375,3278.125,3286.875,3295.625,3304.375,3313.125,3321.875,3330.625,3339.375,3348.125,3356.875,3365.625,3374.375,3383.125,3391.875,3400.625,3409.375,3418.125,3426.875,3435.625,3444.375,3453.125,3461.875,3470.625,3479.375,3488.125,3496.875,3505.625,3514.375,3523.125,3531.875,3540.625,3549.375,3558.125,3566.875,3575.625,3584.375,3593.125,3601.875,3610.625,3619.375,3628.125,3636.875,3645.625,3654.375,3663.125,3671.875,3680.625,3689.375,3698.125,3706.875,3715.625,3724.375,3733.125,3741.875,3750.625,3759.375,3768.125,3776.875,3785.625,3794.375,3803.125,3811.875,3820.625,3829.375,3838.125,3846.875,3855.625,3864.375,3873.125,3881.875,3890.625,3899.375,3908.125,3916.875,3925.625,3934.375,3943.125,3951.875,3960.625,3969.375,3978.125,3986.875,3995.625]) # Creating weights for histo: y10_M_0 y10_M_0_weights = numpy.array([0.205207383239,0.224666701649,0.221128661938,0.251202139482,0.231742821071,0.249433099626,0.224666701649,0.254740219193,0.247664099771,0.242357020204,0.272430497748,0.27950661717,0.267123418182,0.31488721428,0.346729731679,0.313118174425,0.302503975292,0.325501373413,0.355574850957,0.316656214136,0.298965935581,0.304273015147,0.283044656881,0.309580094714,0.323732333558,0.297196895725,0.283044656881,0.298965935581,0.309580094714,0.321963333702,0.318425253991,0.288351776448,0.334346532691,0.290120776303,0.320194293847,0.327270413269,0.29542789587,0.27950661717,0.307811094858,0.332577492835,0.281275657026,0.360881970523,0.302503975292,0.309580094714,0.275968537459,0.348498771535,0.261816338615,0.26004729876,0.258278258904,0.304273015147,0.254740219193,0.290120776303,0.293658856014,0.290120776303,0.281275657026,0.281275657026,0.316656214136,0.251202139482,0.235280900782,0.251202139482,0.267123418182,0.290120776303,0.275968537459,0.275968537459,0.318425253991,0.245895059915,0.221128661938,0.267123418182,0.268892458037,0.252971179337,0.245895059915,0.212283502661,0.237049900638,0.222897661794,0.281275657026,0.263585338471,0.242357020204,0.251202139482,0.251202139482,0.275968537459,0.261816338615,0.217590582227,0.252971179337,0.235280900782,0.247664099771,0.235280900782,0.20874546295,0.258278258904,0.231742821071,0.235280900782,0.212283502661,0.256509219048,0.201669343528,0.270661457893,0.22820478136,0.247664099771,0.201669343528,0.222897661794,0.199900303672,0.212283502661,0.17336486584,0.199900303672,0.210514462805,0.222897661794,0.19282418425,0.196362223961,0.19282418425,0.176902905551,0.226435741505,0.171595825984,0.164519706562,0.166288746418,0.169826786129,0.19282418425,0.150367467718,0.182210025117,0.178671945406,0.199900303672,0.17336486584,0.17336486584,0.185748064828,0.171595825984,0.127370109596,0.17336486584,0.189286144539,0.180440985262,0.155674587285,0.145060388152,0.145060388152,0.150367467718,0.145060388152,0.17336486584,0.139753308585,0.150367467718,0.162750706707,0.123832029885,0.153905547429,0.139753308585,0.182210025117,0.143291348296,0.130908149308,0.166288746418,0.136215228874,0.130908149308,0.141522348441,0.146829428007,0.132677189163,0.116755910463,0.114986910608,0.160981666851,0.136215228874,0.118524950319,0.10614175133,0.129139149452,0.132677189163,0.10614175133,0.107910791186,0.109679791041,0.125601069741,0.118524950319,0.111448830897,0.12206303003,0.129139149452,0.145060388152,0.114986910608,0.116755910463,0.132677189163,0.129139149452,0.139753308585,0.102603711619,0.0937585523419,0.109679791041,0.107910791186,0.0919895124864,0.136215228874,0.0990656319084,0.111448830897,0.0937585523419,0.0919895124864,0.100834671764,0.0849133930643,0.0902204726309,0.107910791186,0.0689921543648,0.0884514727753,0.0796063134978,0.0866824329198,0.0689921543648,0.10614175133,0.0866824329198,0.0725301940758,0.0849133930643,0.0955275921974,0.0919895124864,0.0760682737868,0.0689921543648,0.0689921543648,0.0689921543648,0.0902204726309,0.0866824329198,0.0796063134978,0.0884514727753,0.100834671764,0.0601469950872,0.0831443532088,0.0796063134978,0.0902204726309,0.0919895124864,0.0778372736423,0.0672231145093,0.0919895124864,0.0760682737868,0.0530708756652,0.0919895124864,0.0619160349427,0.0707611542203,0.0654540746538,0.0707611542203,0.0513018358097,0.0566089153762,0.0796063134978,0.0778372736423,0.0866824329198,0.0689921543648,0.0742992339313,0.0583779552317,0.0530708756652,0.0513018358097,0.0495328359542,0.0672231145093,0.0566089153762,0.0601469950872,0.0583779552317,0.0424567165322,0.0636850347982,0.0707611542203,0.0406876766767,0.0548399155207,0.0442257163877,0.0424567165322,0.0566089153762,0.0353805851101,0.0707611542203,0.0477637960987,0.0424567165322,0.0442257163877,0.0424567165322,0.0636850347982,0.0442257163877,0.0300734975436,0.0601469950872,0.0442257163877,0.0583779552317,0.0406876766767,0.0601469950872,0.0389186408212,0.0442257163877,0.0442257163877,0.0442257163877,0.0442257163877,0.0371496129656,0.0318425253991,0.0548399155207,0.0406876766767,0.0601469950872,0.0406876766767,0.0318425253991,0.0513018358097,0.0318425253991,0.0283044656881,0.0424567165322,0.0442257163877,0.0389186408212,0.0566089153762,0.0371496129656,0.0336115532546,0.0371496129656,0.0353805851101,0.0459947562432,0.0283044656881,0.0406876766767,0.0442257163877,0.0229973781216,0.0371496129656,0.0459947562432,0.0353805851101,0.0424567165322,0.0406876766767,0.0283044656881,0.0318425253991,0.0194593224106,0.0318425253991,0.0371496129656,0.0336115532546,0.0247664099771,0.0406876766767,0.0212283502661,0.0265354378326,0.0212283502661,0.0283044656881,0.0389186408212,0.0247664099771,0.0194593224106,0.0336115532546,0.0300734975436,0.0247664099771,0.0265354378326,0.0176902905551,0.0229973781216,0.0176902905551,0.0300734975436,0.0300734975436,0.0141522348441,0.0283044656881,0.0247664099771,0.0247664099771,0.0336115532546,0.0212283502661,0.0300734975436,0.0176902905551,0.0229973781216,0.0212283502661,0.0229973781216,0.0477637960987,0.010614175133,0.0212283502661,0.0247664099771,0.0247664099771,0.010614175133,0.0176902905551,0.0283044656881,0.0247664099771,0.0141522348441,0.0212283502661,0.0123832029885,0.0212283502661,0.0141522348441,0.0123832029885,0.0194593224106,0.0176902905551,0.0159212626996,0.0229973781216,0.0159212626996,0.0194593224106,0.0229973781216,0.0194593224106,0.0212283502661,0.0229973781216,0.0176902905551,0.0212283502661,0.0212283502661,0.00353805851101,0.0176902905551,0.0176902905551,0.010614175133,0.0176902905551,0.0159212626996,0.0159212626996,0.00707611542203,0.0176902905551,0.0123832029885,0.0123832029885,0.00884514727753,0.0229973781216,0.0123832029885,0.010614175133,0.00884514727753,0.0123832029885,0.0141522348441,0.010614175133,0.010614175133,0.010614175133,0.0123832029885,0.0141522348441,0.00884514727753,0.010614175133,0.00353805851101,0.010614175133,0.00884514727753,0.0123832029885,0.010614175133,0.0123832029885,0.010614175133,0.010614175133,0.0141522348441,0.010614175133,0.010614175133,0.0176902905551,0.0141522348441,0.0123832029885,0.0176902905551,0.0194593224106,0.0159212626996,0.00884514727753,0.00707611542203,0.00707611542203,0.00884514727753,0.0123832029885,0.0123832029885,0.00353805851101]) # Creating weights for histo: y10_M_1 y10_M_1_weights = numpy.array([0.134652320926,0.125040484512,0.157102787723,0.147460055878,0.156017530748,0.146387908478,0.176317627576,0.176291528331,0.169905086997,0.151729940353,0.161363199731,0.184856557194,0.178479028773,0.211581664685,0.172003937936,0.205177037813,0.224398872103,0.207298031143,0.190192793678,0.196620202434,0.201964872211,0.180605497749,0.234016423973,0.196616805135,0.194474988364,0.220133344164,0.210522906637,0.219037895294,0.182716299184,0.196603415783,0.180584554404,0.21476685174,0.199794558102,0.194474228968,0.209447401907,0.164565253374,0.192353035797,0.207290597055,0.215885122462,0.208399195468,0.193410914544,0.194493733458,0.210481499565,0.159208872909,0.187008485924,0.226534653674,0.193402681091,0.200883971772,0.191267099362,0.157058742749,0.175249317125,0.170969760341,0.189136034042,0.199821416744,0.200889927036,0.182728889172,0.180608015746,0.172022483188,0.169886341904,0.178425871045,0.160278022693,0.194483981213,0.18058127701,0.20410920698,0.184858115955,0.184880138442,0.1517474864,0.145338143278,0.197669847728,0.135704404282,0.167762630735,0.146403576018,0.16455682008,0.175247358682,0.156027602739,0.148556264144,0.148542115395,0.177378224162,0.157095433571,0.158178412358,0.137819921966,0.163484153093,0.151738733361,0.166703233196,0.165627088974,0.173080881522,0.127177904779,0.13891417179,0.139951946524,0.154931394472,0.167743445991,0.13252137551,0.122894950697,0.128238421428,0.128219796239,0.132503070067,0.126086612603,0.130376920837,0.139992834009,0.105795428687,0.125023298179,0.133574098357,0.125024816971,0.119675990499,0.138924563526,0.100453077066,0.127156441847,0.113279597079,0.113259652939,0.110068870334,0.145335545344,0.109005276132,0.138934435676,0.12290853989,0.104739988001,0.139982642114,0.112193141058,0.12075349364,0.114349506259,0.103666641555,0.118619550607,0.119679507702,0.125012107078,0.122886837149,0.090828930441,0.120741862889,0.0918954822908,0.107927812959,0.115400390568,0.103654731026,0.0919026765697,0.0940130383544,0.0769384964801,0.111134742724,0.10898425285,0.104701618514,0.109014628694,0.0854813030152,0.105780840288,0.0897570628183,0.091874618882,0.0983089421385,0.0972404718143,0.0929831373589,0.101517310759,0.0951133233788,0.0961813940209,0.0876167648397,0.079079034268,0.100451518306,0.083345521445,0.100458992362,0.097249464663,0.0822837258129,0.0726559820484,0.071599861903,0.0651714939106,0.0737075857854,0.0790630070133,0.089763098019,0.0822766114704,0.0747959203131,0.0790712404659,0.0887099355216,0.0737330455392,0.0865475351193,0.0833496781395,0.0801341152398,0.0790918240972,0.07052755463,0.0758696664419,0.0641234873131,0.0844137119917,0.0662570706314,0.072663855787,0.0705309519284,0.0726533441462,0.0513052806888,0.0779990930657,0.0641156935109,0.0587725824936,0.0630569754314,0.0577111865436,0.0609334641036,0.0598451295759,0.0673187863271,0.0651777289524,0.0459453830207,0.0523639987683,0.0587669869433,0.0480953932758,0.0502200237137,0.0534205585641,0.0651643395999,0.064116812621,0.0630427067782,0.0577082288956,0.0534238359578,0.0395408760534,0.0673187863271,0.0502352516041,0.0470055399559,0.053425714464,0.0566379999699,0.0427436091556,0.0555765240835,0.0352617469296,0.0523812250695,0.0438203529006,0.0437986501592,0.0384656910688,0.0544920265045,0.0384682210569,0.0491649827101,0.0406078275854,0.0405988347367,0.0331379078624,0.042745167916,0.0438012480933,0.0502289765942,0.047017930103,0.0416676647749,0.0406025917491,0.0480856410311,0.0448869846869,0.0406153016418,0.0384712826223,0.0309905075317,0.0491388035285,0.0352718309106,0.0427443685517,0.0267079811096,0.0309942325695,0.0395314555448,0.0299216814904,0.0405966364849,0.0309953316954,0.0341965500023,0.03525582364,0.0277794370596,0.0427443685517,0.0299220132266,0.0309822860697,0.0277806361061,0.0331278238815,0.045957653263,0.0299167534093,0.0384626295034,0.0341970815796,0.0331337471711,0.0213679156704,0.0234970145548,0.0363257448105,0.0267057868545,0.0299209141006,0.0256459456682,0.0331326480452,0.0320653567833,0.0320548371488,0.032051875504,0.0363339662725,0.027791819213,0.0341985124417,0.0256346626407,0.0256507738287,0.0320529746299,0.0277741772423,0.0277775745407,0.0299148908904,0.0245852451652,0.0309875458869,0.0309942325695,0.0245811843944,0.0309889767491,0.0320537380228,0.021370545579,0.0235153199979,0.0256507738287,0.0181666014398,0.0181621090123,0.0181666014398,0.0224382724944,0.0224457305636,0.0213772362584,0.0235108275704,0.0235115909633,0.0213746063498,0.023513457479,0.0202919712897,0.0149641840865,0.0203001887549,0.0202983262361,0.0117580416954,0.0299175207991,0.0181684639587,0.0203028186636,0.0224457305636,0.0149604590487,0.0224356425858,0.0267068859805,0.0224378408377,0.018162540669,0.0256444148855,0.0192295001947,0.0138983236868,0.0170936147071,0.0203020552706,0.0138871405799,0.0160364074262,0.0213663848877,0.0235130218254,0.0181647349241,0.0181681322225,0.0192354274812,0.0203001887549,0.0117554117868,0.0203012878809,0.0181647349241,0.0192391525189,0.0149612224417,0.0192313667104,0.0160292810933,0.0213780036481,0.0128276351265,0.0128178828818,0.0138927321333,0.0128257686108,0.0160382699451,0.0149604590487,0.0160258877917,0.00854926939568,0.0138964571711,0.0181673648327,0.0160281859641,0.0117572783025,0.0160240252728,0.0096169963111,0.0106884522611,0.0128239060919,0.01069031478,0.0202956963274,0.0149612224417,0.0138908656176,0.0128242378281,0.0128231387022,0.00854477696818,0.0053434587408,0.00427463669625,0.01176177073,0.0117561791765,0.0128239060919,0.00854477696818,0.0160255560555,0.00641118565622,0.0138908656176,0.0117490568404,0.00855036852163,0.00640822401139,0.0096125038836,0.0117490568404,0.011751686749,0.0138856097972,0.0128234744352,0.0106914139059,0.00534236361167,0.00534422613055,0.0117561791765,0.00213468803982,0.00747967996139,0.00961360300955,0.00641381556484,0.00533786718735,0.0106869214784,0.00213731754876,0.00747628665983,0.008547738613,0.0117554117868,0.00855113591138,0.00854926939568,0.00533896631329,0.0128239060919,0.0032069081821,0.0117527818781,0.0032069081821,0.00854477696818,0.00641381556484,0.00641305217191,0.00854028454068,0.00748154248026,0.00641009052709,0.00534608864942,0.0117554117868,0.00320877229971,0.0106884522611,0.00641195304597,0.00854926939568,0.00534236361167,0.00534236361167,0.0,0.00213468803982]) # Creating weights for histo: y10_M_2 y10_M_2_weights = numpy.array([0.0923635016937,0.087502260552,0.107641665282,0.106252744956,0.0916690215306,0.120836468381,0.119447548055,0.127086629849,0.0944469021831,0.114586306913,0.112502906424,0.114586306913,0.129864470502,0.146531554416,0.12500322936,0.127781070012,0.122919828871,0.120141988218,0.142364793438,0.13403123148,0.13403123148,0.129169990339,0.143059273601,0.143753713764,0.147226034579,0.129864470502,0.142364793438,0.133336791317,0.138892472622,0.13611463197,0.129169990339,0.142364793438,0.142364793438,0.131253390828,0.139586952785,0.136809112133,0.128475550175,0.13611463197,0.145837114253,0.139586952785,0.129864470502,0.111808466261,0.119447548055,0.143753713764,0.146531554416,0.137503552296,0.136809112133,0.128475550175,0.120141988218,0.140975873111,0.124308789197,0.147920474743,0.128475550175,0.126392149686,0.125697709523,0.119447548055,0.116669667403,0.127086629849,0.134725711643,0.12500322936,0.129864470502,0.11389182675,0.129169990339,0.130558950665,0.111113986098,0.110419505935,0.113197386587,0.127086629849,0.115975227239,0.101391503814,0.118058627729,0.110419505935,0.103474904304,0.114586306913,0.0993081433248,0.100697063651,0.121530908544,0.118058627729,0.116669667403,0.117364147566,0.104169344467,0.101391503814,0.122919828871,0.107641665282,0.0986136631617,0.107641665282,0.0895856610413,0.0972247428355,0.104169344467,0.0868077803888,0.105558304793,0.106252744956,0.0993081433248,0.109030585608,0.0965302626724,0.0881967407151,0.0902801012044,0.09375242202,0.0819465792471,0.09375242202,0.0944469021831,0.0972247428355,0.0965302626724,0.0826410194102,0.0743074574528,0.087502260552,0.0819465792471,0.0902801012044,0.0763908579422,0.081252099084,0.0708351766373,0.0791686985946,0.0826410194102,0.0854188600626,0.0770853381053,0.0833354995733,0.075001937616,0.0784742584315,0.0701406964742,0.0694462563111,0.0847244198995,0.0541680527226,0.0777797782684,0.0673628558217,0.0694462563111,0.075001937616,0.0680572959848,0.0666683756586,0.0597237740275,0.0659739354955,0.0597237740275,0.0645850151693,0.06250161468,0.06250161468,0.0576403735382,0.0652794553324,0.06250161468,0.0604182141906,0.0576403735382,0.0638905350062,0.0666683756586,0.0694462563111,0.0604182141906,0.06250161468,0.0638905350062,0.0555569730489,0.0541680527226,0.0743074574528,0.050001291744,0.0611126943537,0.0583348537013,0.0576403735382,0.0645850151693,0.0652794553324,0.056251453212,0.0479178912546,0.056251453212,0.0534736125595,0.0555569730489,0.0479178912546,0.0472234510915,0.0458345307653,0.0520846922333,0.0423622099498,0.056251453212,0.0444456104391,0.0458345307653,0.0513902120702,0.0458345307653,0.0451400506022,0.0513902120702,0.0444456104391,0.0534736125595,0.0479178912546,0.0354175843186,0.0458345307653,0.0430566501129,0.0388898931342,0.0444456104391,0.0465289709284,0.0548625328857,0.0472234510915,0.0472234510915,0.0388898931342,0.0465289709284,0.0423622099498,0.0416677297866,0.0277784945244,0.0555569730489,0.03125080734,0.0354175843186,0.0430566501129,0.0395843572973,0.0347231201555,0.0354175843186,0.0402788094604,0.0333341958293,0.0430566501129,0.043751130276,0.0402788094604,0.0305563471769,0.0368065086449,0.0319452715031,0.0354175843186,0.0326397316662,0.0340286559924,0.0395843572973,0.0361120444818,0.037500968808,0.0326397316662,0.0388898931342,0.0284729586875,0.0305563471769,0.0229172573827,0.0347231201555,0.0361120444818,0.0270840343613,0.0270840343613,0.018750484404,0.03125080734,0.0333341958293,0.025000645872,0.0333341958293,0.0354175843186,0.0298618830138,0.0298618830138,0.0319452715031,0.025000645872,0.0277784945244,0.0284729586875,0.0229172573827,0.0270840343613,0.0326397316662,0.0270840343613,0.018750484404,0.0243061857089,0.0222227972195,0.0263895701982,0.0229172573827,0.0270840343613,0.0277784945244,0.0201394087302,0.025000645872,0.0236117215458,0.0263895701982,0.0222227972195,0.0256951100351,0.0208338728933,0.0208338728933,0.0222227972195,0.0208338728933,0.0201394087302,0.0201394087302,0.018750484404,0.0229172573827,0.0243061857089,0.0180560242409,0.0194449485671,0.0159726357515,0.0215283330564,0.0222227972195,0.0152781715884,0.018750484404,0.0208338728933,0.0194449485671,0.0208338728933,0.0159726357515,0.0180560242409,0.0138892472622,0.0194449485671,0.0201394087302,0.0145837114253,0.0180560242409,0.0159726357515,0.0152781715884,0.0145837114253,0.0166670959147,0.0118058627729,0.0131947870991,0.0152781715884,0.0118058627729,0.0180560242409,0.0159726357515,0.0145837114253,0.0159726357515,0.0118058627729,0.0131947870991,0.0194449485671,0.0180560242409,0.0118058627729,0.0104169344467,0.0152781715884,0.0145837114253,0.0131947870991,0.00763908579422,0.0166670959147,0.0145837114253,0.0208338728933,0.00833354995733,0.0201394087302,0.0118058627729,0.0118058627729,0.00833354995733,0.012500322936,0.0111113986098,0.0152781715884,0.00902801012044,0.0111113986098,0.0138892472622,0.0118058627729,0.012500322936,0.0118058627729,0.0159726357515,0.012500322936,0.006250161468,0.00972247428355,0.00763908579422,0.0145837114253,0.00763908579422,0.0118058627729,0.00972247428355,0.00694462563111,0.0111113986098,0.00972247428355,0.0111113986098,0.00902801012044,0.00972247428355,0.00555569730489,0.00833354995733,0.00763908579422,0.00902801012044,0.0118058627729,0.006250161468,0.0111113986098,0.0118058627729,0.00416677297866,0.00833354995733,0.0104169344467,0.00833354995733,0.00763908579422,0.00763908579422,0.00902801012044,0.006250161468,0.006250161468,0.00486123714178,0.006250161468,0.00833354995733,0.00763908579422,0.00902801012044,0.00763908579422,0.00208338728933,0.00902801012044,0.00763908579422,0.00486123714178,0.00763908579422,0.00486123714178,0.0111113986098,0.00833354995733,0.00555569730489,0.00347231201555,0.00555569730489,0.00416677297866,0.00972247428355,0.00763908579422,0.00486123714178,0.00694462563111,0.006250161468,0.00347231201555,0.00555569730489,0.006250161468,0.00833354995733,0.00694462563111,0.00486123714178,0.00347231201555,0.00277784945244,0.00694462563111,0.00555569730489,0.00486123714178,0.00833354995733,0.006250161468,0.00486123714178,0.00555569730489,0.00763908579422,0.00486123714178,0.00486123714178,0.00277784945244,0.00416677297866,0.00486123714178,0.00416677297866,0.00416677297866,0.00347231201555,0.00694462563111,0.00555569730489,0.00486123714178,0.00486123714178,0.00416677297866,0.00555569730489,0.00416677297866,0.00486123714178,0.00486123714178]) # Creating weights for histo: y10_M_3 y10_M_3_weights = numpy.array([0.0583211378848,0.0720716621015,0.0687525810837,0.0692267012291,0.077287383701,0.0810806248642,0.0839255457366,0.0763390634101,0.0858221463182,0.0782356639918,0.0768132235555,0.0829772254458,0.0858221463182,0.0967277496625,0.0905637077723,0.0881929470453,0.0953052692263,0.0891412673361,0.0848738660274,0.0896154274815,0.0815547450096,0.104788392134,0.102417591407,0.105736712425,0.084399705882,0.0981502300988,0.0986243502442,0.10526255228,0.0862963064636,0.0839255457366,0.104788392134,0.0853480261728,0.0839255457366,0.0915120280631,0.104788392134,0.0967277496625,0.0801323045734,0.0915120280631,0.084399705882,0.0924603483539,0.102891751553,0.0891412673361,0.0986243502442,0.0938828287901,0.0858221463182,0.0910378679177,0.0924603483539,0.0791839842826,0.0919861882085,0.0900895476269,0.0886671071907,0.0896154274815,0.103365911698,0.0862963064636,0.0872446267544,0.082028905155,0.0749165829739,0.0881929470453,0.103365911698,0.079658144428,0.0905637077723,0.0791839842826,0.0806064647188,0.0739682626831,0.0782356639918,0.0815547450096,0.079658144428,0.0706491816653,0.084399705882,0.082028905155,0.0787098241372,0.0673301006475,0.0711233418107,0.0730199823923,0.0972019098079,0.0810806248642,0.0744424228285,0.0862963064636,0.0787098241372,0.0711233418107,0.0701750215199,0.066855940502,0.0706491816653,0.0706491816653,0.0692267012291,0.0782356639918,0.0711233418107,0.0744424228285,0.0734941025377,0.062114379048,0.0701750215199,0.064485179775,0.0687525810837,0.0630626993388,0.084399705882,0.0706491816653,0.0640110196296,0.0583211378848,0.0701750215199,0.0602177784664,0.0550020568669,0.0611660587572,0.0578469777394,0.0654334600658,0.0625885391934,0.0606918986118,0.0606918986118,0.0701750215199,0.0625885391934,0.0649592999204,0.0535795764307,0.0578469777394,0.0531054162853,0.0554762170123,0.0521571359945,0.0602177784664,0.059743618321,0.0602177784664,0.0616402189026,0.0535795764307,0.0564244973031,0.0497863352675,0.0521571359945,0.0554762170123,0.0540537365761,0.0459930941042,0.0663817803566,0.0550020568669,0.0431481732318,0.0497863352675,0.0450447738134,0.0502604954129,0.0450447738134,0.0526312561399,0.0417256927956,0.0531054162853,0.0450447738134,0.037458291487,0.0440964535226,0.0393549160686,0.0507346555583,0.0431481732318,0.039829072214,0.0450447738134,0.0417256927956,0.0355616709053,0.044570613668,0.037458291487,0.044570613668,0.0393549160686,0.0440964535226,0.0459930941042,0.0426740130864,0.039829072214,0.044570613668,0.0417256927956,0.0327167380329,0.0322425818875,0.0407773725048,0.0350875147599,0.0403032123594,0.0365099831962,0.0312942695967,0.0346133586145,0.0355616709053,0.037458291487,0.039829072214,0.0303459573059,0.0350875147599,0.039829072214,0.0303459573059,0.0365099831962,0.0369841353416,0.0312942695967,0.0317684257421,0.0388807599232,0.0289234928697,0.0279751805789,0.0403032123594,0.0336650463237,0.0289234928697,0.0331908941783,0.0331908941783,0.0293976490151,0.0331908941783,0.0303459573059,0.0350875147599,0.0260785599973,0.0279751805789,0.0360358270507,0.0270268682881,0.0279751805789,0.0227594709794,0.0293976490151,0.0275010244335,0.0256044038518,0.0213370025432,0.0275010244335,0.0203886902524,0.0289234928697,0.0260785599973,0.024656091561,0.0256044038518,0.0284493367243,0.0227594709794,0.0241819354156,0.0284493367243,0.0194403779616,0.0256044038518,0.0227594709794,0.01754375738,0.0227594709794,0.0189662258162,0.019914534107,0.01754375738,0.0203886902524,0.0218111586886,0.0237077792702,0.0232336231248,0.0251302477064,0.019914534107,0.0180179135254,0.0213370025432,0.0260785599973,0.0184920696708,0.0146988245075,0.0189662258162,0.0184920696708,0.0189662258162,0.0184920696708,0.0194403779616,0.0194403779616,0.0170696012346,0.0113797354897,0.0161212889438,0.0218111586886,0.0132763560713,0.0170696012346,0.0184920696708,0.0165954450892,0.0218111586886,0.0137505122167,0.0146988245075,0.0165954450892,0.0123280437805,0.019914534107,0.0113797354897,0.0156471367984,0.0161212889438,0.0137505122167,0.0184920696708,0.0128021999259,0.0128021999259,0.0194403779616,0.0203886902524,0.0170696012346,0.0189662258162,0.0137505122167,0.0113797354897,0.00758649032647,0.00900895476269,0.0118538916351,0.0099572670535,0.0180179135254,0.0142246683621,0.0137505122167,0.0137505122167,0.0156471367984,0.0123280437805,0.0137505122167,0.0128021999259,0.00948311090809,0.0099572670535,0.0142246683621,0.00663817803566,0.0165954450892,0.00806064647188,0.00948311090809,0.0109055793443,0.0118538916351,0.00806064647188,0.0132763560713,0.00853480261728,0.00948311090809,0.0113797354897,0.00853480261728,0.00900895476269,0.0099572670535,0.0142246683621,0.0104314231989,0.0109055793443,0.0137505122167,0.00806064647188,0.00853480261728,0.00711233418107,0.00663817803566,0.00711233418107,0.0118538916351,0.00948311090809,0.0099572670535,0.00663817803566,0.00663817803566,0.00521571359945,0.00806064647188,0.00663817803566,0.00806064647188,0.00948311090809,0.0123280437805,0.00616402189026,0.00568986574485,0.00568986574485,0.00711233418107,0.0118538916351,0.00616402189026,0.00900895476269,0.00806064647188,0.0099572670535,0.00521571359945,0.0142246683621,0.0104314231989,0.00616402189026,0.0137505122167,0.0104314231989,0.00853480261728,0.00853480261728,0.00663817803566,0.00331908941783,0.00568986574485,0.00758649032647,0.00616402189026,0.00521571359945,0.00568986574485,0.00616402189026,0.00711233418107,0.00568986574485,0.00711233418107,0.0099572670535,0.00521571359945,0.00474155745405,0.00711233418107,0.00474155745405,0.00426740130864,0.00521571359945,0.00521571359945,0.00379324476324,0.00616402189026,0.00284493367243,0.00521571359945,0.00426740130864,0.00474155745405,0.00663817803566,0.00379324476324,0.00521571359945,0.00474155745405,0.00379324476324,0.00521571359945,0.00758649032647,0.00379324476324,0.00426740130864,0.00284493367243,0.00521571359945,0.00426740130864,0.00568986574485,0.00189662258162,0.00521571359945,0.00568986574485,0.00379324476324,0.00379324476324,0.00331908941783,0.00331908941783,0.00189662258162,0.00806064647188,0.00189662258162,0.00189662258162,0.00142246683621,0.00426740130864,0.00426740130864,0.00521571359945,0.00379324476324,0.00426740130864,0.000474155745405,0.00142246683621,0.00521571359945,0.00284493367243,0.00284493367243,0.00379324476324,0.00331908941783,0.00237077792702,0.00189662258162,0.00474155745405,0.00284493367243,0.00142246683621,0.00379324476324,0.00237077792702,0.00331908941783,0.00331908941783,0.00284493367243,0.00284493367243,0.00142246683621,0.00237077792702]) # Creating weights for histo: y10_M_4 y10_M_4_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_5 y10_M_5_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0521138287,0.0,0.0,0.0,0.0,0.0,1.05462838872,0.0,0.0,0.0,1.0529581672,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_6 y10_M_6_weights = numpy.array([0.461303760033,1.15081967027,0.230569108273,0.921614182285,0.46091142043,0.460625523598,0.230186260137,0.690756333584,0.691148288917,0.460551743771,0.230522534757,0.460787301241,0.45949922842,1.15139645944,0.229952470308,0.691912217547,0.460788454051,0.0,0.0,0.921384773134,0.691887624271,0.0,0.461233054365,0.0,0.230186260137,0.921700258751,0.230020178671,0.460627829218,0.230020178671,0.230764048411,0.0,0.0,0.230360180709,0.690554591868,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230360180709,0.0,0.0,0.0,0.460541752753,0.0,0.230465316963,0.0,0.0,0.230673168571,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230752251324,0.0,0.0,0.0,0.0,0.0,0.230186260137,0.0,0.229982520217,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230428273342,0.0,0.0,0.230551278148,0.0,0.0,0.0,0.229703309683,0.0,0.460081013101,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230673168571,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230619678196,0.0,0.0,0.0,0.0,0.230128542792,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230020178671,0.0,0.0,0.0,0.230569108273,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.230020178671,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_7 y10_M_7_weights = numpy.array([0.331986889589,0.470803586655,0.41534568781,0.415458397734,0.47073896117,0.277029068906,0.526422664539,0.249129477428,0.5262049382,0.359979649476,0.193697159504,0.221507929407,0.415286063106,0.193815101015,0.221531009938,0.276861773527,0.332257124135,0.277037839508,0.221469231051,0.0553450350508,0.193770594059,0.249263998453,0.221607175689,0.110764774085,0.166144045257,0.110815243512,0.221420223391,0.0830655216122,0.221455344265,0.277078692047,0.110720959545,0.0830448645373,0.0553610760195,0.166105770043,0.0553107604629,0.0554236627249,0.0831165680523,0.0554017362209,0.138448716474,0.0830516348263,0.0276381506154,0.0830120517164,0.0,0.0552624836864,0.138459218115,0.110910912312,0.0276896817466,0.0831109902574,0.110845402072,0.0554480896198,0.0553459967395,0.0,0.0554746322299,0.110529968155,0.0553792327036,0.0276870736467,0.0554895961072,0.055452782661,0.0830422102763,0.0,0.0553457659342,0.055432818002,0.110930838503,0.110861366106,0.0553453812587,0.0276929399482,0.0,0.0554876727297,0.083025361489,0.110931377049,0.0276234290836,0.0,0.0554092758609,0.0830222456174,0.0,0.0276929399482,0.0,0.0,0.0276622120685,0.0,0.0,0.0277219329413,0.027640512523,0.0,0.0553960045558,0.0276038183262,0.0277244641062,0.0,0.0,0.0,0.0,0.0277263951772,0.0,0.0,0.0277179130823,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0554893653019,0.0,0.0553453812587,0.0552930269219,0.0,0.0277631932365,0.0,0.0276234290836,0.0276831153357,0.0,0.0,0.0277307073897,0.0,0.0276586845941,0.0,0.0276381506154,0.0,0.0,0.0,0.0276873275325,0.0,0.0,0.0276038183262,0.0276873275325,0.0,0.0,0.0,0.027640512523,0.0,0.0553551520167,0.0277261682187,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0276953710974,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0277373238085,0.0,0.0,0.0,0.0,0.0,0.027669617072,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0276381506154,0.0276831153357,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0276038183262,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0277058611985,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0277263951772,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0276929399482,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_8 y10_M_8_weights = numpy.array([0.171425176725,0.110913048464,0.100895664997,0.121051809151,0.0705639221694,0.0907136333304,0.0907521099096,0.120861550357,0.0805460455527,0.0705653180074,0.100792130228,0.100822838665,0.0403013036689,0.0705123975389,0.0907691027206,0.0907965339726,0.0705733895926,0.0605082988096,0.110944606541,0.0907265600045,0.060498103123,0.0706434242494,0.0403831786737,0.0503637605663,0.0604676010273,0.030269409556,0.0,0.0605221054686,0.0504180647352,0.030218036647,0.0100733687095,0.0201455115091,0.0907402149419,0.0201586809377,0.0605298736107,0.0100921882477,0.0403226478533,0.0301995084141,0.0201924238052,0.0,0.030229919477,0.0100853122281,0.0201592210663,0.0201563383573,0.0100975167078,0.0201501177747,0.0,0.0504232293359,0.0,0.040263512871,0.0302264905705,0.0,0.0201586809377,0.0,0.0,0.0100921882477,0.0,0.0201839213309,0.0201593970633,0.0,0.0,0.020185007657,0.0101000474228,0.0,0.020150761074,0.0100733687095,0.0,0.0201405168365,0.0302352843502,0.0100829696478,0.0101033488832,0.0,0.02012472566,0.0100975167078,0.0,0.0,0.0201806684213,0.0100921882477,0.0100953561932,0.0201565507674,0.0101000474228,0.0201950516221,0.0302184371918,0.0503978614966,0.0100921882477,0.0,0.0,0.0100953561932,0.0,0.0100712385393,0.0302327111531,0.0,0.0,0.0101033488832,0.0100829696478,0.0101000474228,0.0,0.0,0.0,0.0100533232614,0.0,0.0100975167078,0.0100975167078,0.0,0.0,0.0,0.0,0.0,0.0,0.0100996954289,0.0100996954289,0.0,0.0,0.0,0.0,0.0100829696478,0.0,0.0,0.0,0.0,0.0302571990075,0.0100953561932,0.0,0.0100450210595,0.0,0.0,0.0,0.0,0.0,0.0,0.0100996954289,0.0,0.0,0.0,0.0101033488832,0.0100235251535,0.0,0.0,0.0,0.0100805663788,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100592768141,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100996954289,0.0,0.0100429576467,0.0,0.0,0.0,0.0,0.0,0.0100996954289,0.0100733687095,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100235251535,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100975167078,0.0100847538929,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100853122281,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0101000474228,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100975167078,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_9 y10_M_9_weights = numpy.array([0.0395887882306,0.0395919431357,0.0480965285236,0.0537768197651,0.0424228548879,0.0311108771808,0.0509138972684,0.045275273859,0.0339429931833,0.0282836243491,0.0311243393918,0.0197972219876,0.0424551734281,0.0311284677005,0.0254733541408,0.0311415836415,0.0254701299817,0.00566695984371,0.0254795292905,0.0141389227432,0.0226267602018,0.0367860782523,0.0254759896408,0.0226008438104,0.0141400500446,0.0311050367589,0.0113113852005,0.0113171025042,0.02831115282,0.00848730266371,0.00849171183599,0.00849386255789,0.019793786219,0.0311368243517,0.0113139937684,0.0113128933991,0.00848397462356,0.00848956111408,0.0113252013765,0.0311024012589,0.0113216617268,0.00848061965129,0.0226472863222,0.0113129010939,0.00565948041012,0.00283041389272,0.0113231352983,0.00849757534257,0.00566743307948,0.0198128580051,0.0141470331578,0.0141538431359,0.00565845698968,0.00848606763378,0.0,0.00282190565226,0.0113168024034,0.00565715270573,0.0084836129637,0.00283250420974,0.002823576213,0.00848566365203,0.00848342828633,0.0056534437685,0.00565649864004,0.00849022672211,0.005667256097,0.00565920339406,0.00848799135641,0.00283012148688,0.00564696082322,0.00566166960647,0.00283012148688,0.005660507678,0.00282930967593,0.00565389391959,0.00565641784369,0.00566634809992,0.00282800539199,0.00282142779956,0.00282747713775,0.0,0.00564943473053,0.00565392085171,0.00566011523859,0.00283622815201,0.00283012148688,0.0,0.00283097831295,0.00566200818166,0.00283201519944,0.0,0.00283201519944,0.0,0.00282708392885,0.00282586044125,0.00849040755204,0.00565806070281,0.00283016919521,0.00283041389272,0.00282879027082,0.00283014110886,0.0,0.00283201519944,0.00282544030023,0.005667256097,0.00282879027082,0.0,0.0,0.00282544030023,0.00282513596731,0.00564891917286,0.00282747713775,0.00283041389272,0.00282347964212,0.0,0.00283102948397,0.0,0.0,0.0,0.0,0.0,0.00283012148688,0.0,0.0,0.0,0.0,0.00282513596731,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00565288588893,0.0,0.0,0.0,0.0,0.00282586044125,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00282747713775,0.0,0.00282800539199,0.0,0.00566232751961,0.0,0.00283102948397,0.0,0.00283201519944,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00282586044125,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00282347964212,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00283441369682,0.0,0.00283016919521,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00283014110886,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00282142779956,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_10 y10_M_10_weights = numpy.array([0.00456495541109,0.00455821388808,0.0015209497587,0.00305728659455,0.0,0.00303012549001,0.0015209497587,0.00153333600715,0.0,0.00304044815164,0.0,0.0,0.00303278593326,0.00455975744156,0.00456632877184,0.00307259093912,0.00304287812557,0.0,0.00151265404516,0.0,0.0015209497587,0.00304183214944,0.0,0.0,0.00154541023559,0.00152495992482,0.00152325208808,0.00152192836688,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00305783262954,0.0,0.00151448716266,0.0,0.00458922678495,0.0015084961423,0.0,0.0,0.0,0.00308362510091,0.0,0.001522606774,0.0,0.0,0.00152162934771,0.0,0.0,0.00152192836688,0.0,0.00151881880393,0.00305649117993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00459552982531,0.0,0.0,0.0,0.0,0.00151727406856,0.00302944708289,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0015244966224,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00152644438361,0.0,0.0,0.0,0.0,0.0,0.00151727406856,0.0,0.00153153125511,0.0,0.0,0.0,0.00304671100761,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00151265404516,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00151265404516,0.0,0.0,0.0,0.00151265404516,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0015244966224,0.0,0.0,0.0,0.00151115658554,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0015209497587,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00153333600715,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_11 y10_M_11_weights = numpy.array([0.0,0.000361210164043,0.000180766967933,0.0,0.0,0.000180402041284,0.000180612781708,0.000180970239661,0.000180003620999,0.0,0.000180626140664,0.000180503369161,0.000361314071314,0.0,0.000361042811353,0.000361412165322,0.000180533821421,0.00072191107081,0.000180533821421,0.0,0.000180003620999,0.0,0.000542350143295,0.0,0.0,0.0,0.0,0.0,0.000180640770069,0.0,0.000360707643993,0.0,0.000180755033419,0.000180686044226,0.0,0.000180766967933,0.000180503369161,0.0,0.0,0.000180970239661,0.0,0.0,0.000180626140664,0.0,0.000180402041284,0.0,0.0,0.0,0.000181168429595,0.000180547141879,0.0,0.0,0.0,0.000180503369161,0.000361129509825,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000179998693199,0.0,0.0,0.0,0.0,0.0,0.000361173244045,0.0,0.000180734321262,0.000180657131903,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180203004384,0.0,0.0,0.0,0.0,0.0,0.0,0.000180003620999,0.0,0.0,0.0,0.000181168429595,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180734321262,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180003620999,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180154573355,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180755033419,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180766967933,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000180343716158,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_12 y10_M_12_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.012170493784,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0121240822392,0.0,0.0,0.0,0.0,0.0,0.0121753353338,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0121313846429,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_13 y10_M_13_weights = numpy.array([0.0200670126467,0.0200880860334,0.0300606820052,0.0100299569039,0.0,0.0301341868043,0.030113266303,0.0200658432804,0.0100369731021,0.0200736734897,0.0100367003877,0.0501881711396,0.0200979574689,0.0100696699077,0.0301172991707,0.0100407291233,0.030109873901,0.0200786525938,0.0100546540867,0.0200734007753,0.0100609843668,0.0200665333305,0.0100602901846,0.0100457330197,0.0100187053682,0.0,0.0401615363932,0.0100309733849,0.0100696699077,0.0501817664829,0.0200368322513,0.0100407291233,0.0200939039409,0.020058128768,0.0200873422668,0.0201058537908,0.0201005978402,0.0301433227373,0.0100702897132,0.0,0.0100367003877,0.0,0.0100407291233,0.0100299569039,0.0,0.0,0.0100187053682,0.0201025894819,0.0,0.0100309733849,0.0,0.0,0.0,0.0200725371797,0.0200759006575,0.0200719504305,0.0,0.0100355640776,0.0,0.0100367003877,0.0200795285856,0.0100153625506,0.0,0.0100459437535,0.0,0.0100153625506,0.0,0.0100271595151,0.0,0.0,0.0,0.0,0.0100262835234,0.0,0.0,0.0100340930726,0.0,0.0,0.0,0.0,0.0100184161257,0.0,0.0,0.0,0.0,0.0,0.01003244439,0.0100407291233,0.01003244439,0.0100584803526,0.0,0.0,0.0,0.0100546540867,0.0,0.0200884372565,0.0100702897132,0.020117840829,0.0100568564622,0.0100369731021,0.0,0.0,0.0,0.0,0.0100568564622,0.01003244439,0.0100696699077,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0100262835234,0.0,0.0,0.0,0.0,0.0100340930726,0.0,0.0,0.0,0.0,0.0,0.0,0.0100568564622,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_14 y10_M_14_weights = numpy.array([0.137484358887,0.214444563398,0.203555150017,0.153959531642,0.165111509392,0.181573803777,0.175908011631,0.10452917891,0.0990238179407,0.121082759406,0.115635533918,0.093439317966,0.137603351775,0.148474117927,0.120959257057,0.0934716967069,0.0714910004796,0.0769705640832,0.104500293986,0.11544032708,0.137547653841,0.0989505696724,0.12106772787,0.0440423596197,0.0549469670399,0.0660144838089,0.11550423142,0.099006958245,0.0825242290964,0.115505490819,0.0659674391641,0.0440307812744,0.093501719153,0.0769642264627,0.0550339468194,0.0550127807918,0.0275091407607,0.060472031509,0.0385578234215,0.0494848318928,0.0880161835607,0.0605261450384,0.0605041664953,0.0604967726047,0.0494321402655,0.0329698296303,0.0495841619072,0.0495105886327,0.0439973056377,0.0384924484279,0.0440022213562,0.044054100468,0.0164796050267,0.0274510865314,0.038490189635,0.0274794676963,0.0329860149382,0.0495038447544,0.0219937817887,0.0329924744361,0.0330067706455,0.0330086150556,0.016481303184,0.0715331700317,0.0220172147344,0.0275065325861,0.00547921015942,0.0274784601771,0.044045162798,0.0164694892092,0.0274902132132,0.0165057192734,0.0,0.0165153313312,0.0219986528188,0.0165167126075,0.0110035027389,0.00549979523847,0.0110016583288,0.0220129246528,0.00550231403638,0.0274985658721,0.0109983838915,0.0109964135415,0.0165292050326,0.0165115246963,0.00549598047841,0.00551630148994,0.00550886291095,0.00550243185112,0.0275025187597,0.0165107365563,0.0165157497767,0.0274848302983,0.0109989607775,0.0164812463079,0.0109923753397,0.00549598047841,0.00550243185112,0.0,0.00550886291095,0.0,0.0165145960047,0.0,0.0165120284559,0.0109879877562,0.011012919793,0.0109884508901,0.0,0.00550231403638,0.00549598047841,0.0110140126263,0.0054880625153,0.0110067243626,0.00549598047841,0.0,0.0110169011187,0.0,0.0164843054286,0.00549979523847,0.0,0.0110137932471,0.0,0.0,0.00549598047841,0.0,0.0,0.0,0.0,0.0,0.00550877759683,0.00549795082839,0.00550877759683,0.0,0.00550803820777,0.00549442857389,0.00549979523847,0.0,0.00549598047841,0.00549901928621,0.0,0.0,0.0,0.0054880625153,0.0,0.0110110916332,0.0,0.0,0.00549598047841,0.00549237290979,0.0,0.00549710581232,0.0,0.00548474338967,0.0,0.0,0.0,0.00550370750039,0.0,0.0,0.00549795082839,0.00550803820777,0.0,0.0,0.0,0.0,0.0,0.00549237290979,0.0,0.00551630148994,0.0,0.0,0.0,0.0,0.0,0.0,0.00549392481431,0.0,0.0,0.0,0.0,0.0054880625153,0.00550803820777,0.0,0.00550493033615,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0109996879788,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00547487945204,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00550972823991,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00549710581232,0.00549710581232,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00549392481431,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0055142173878,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00549598047841,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_15 y10_M_15_weights = numpy.array([0.171738081197,0.156911819898,0.146062783658,0.171725775749,0.148012656072,0.128249545171,0.121394488641,0.124316852205,0.114487564847,0.119413271405,0.0917862576392,0.109541616429,0.115471840368,0.0947389238706,0.0799307399561,0.0858578775128,0.0986886921488,0.0888086999311,0.081916165896,0.0740052858809,0.0858781594566,0.080927761837,0.0631565302218,0.0690734065578,0.0582300220064,0.0572389323936,0.0493256073219,0.05919798379,0.045400089194,0.0453972833915,0.0463642431027,0.0463807171717,0.0355327631705,0.0424396067984,0.0453811299856,0.0384800061865,0.0305761967937,0.031587383969,0.0335534899546,0.0404611151989,0.0394825715316,0.0365159885197,0.0286302525033,0.0286245727574,0.0246780071023,0.0305851392871,0.0384927244885,0.0286133014478,0.0207281105588,0.0296105357682,0.0226914307833,0.0236928417411,0.0226906050757,0.0236800192236,0.0246659501681,0.021709091266,0.0217055880212,0.0197187671965,0.0197435263995,0.0217113278914,0.0128316323271,0.0148141442407,0.0148037387217,0.00986753846284,0.022708967049,0.0187429010664,0.00789183262442,0.0138138596123,0.0138216677598,0.0118344020151,0.0118415888778,0.0138172987245,0.00887640876712,0.00690421018184,0.0187466808833,0.00888321083407,0.0128188298511,0.00986465650283,0.00789943234093,0.00987156278529,0.0098675504877,0.00789752038693,0.00986233570332,0.0118470802341,0.00986960273183,0.0118376888123,0.00789728790616,0.00887895002254,0.00888601262829,0.0108487757006,0.00887637269252,0.00494040495436,0.00493162680079,0.00394604618078,0.0118410758167,0.000986794330005,0.00789850241781,0.00689994937031,0.00493692976753,0.00395231915354,0.00394512948502,0.00296125960289,0.00690833070324,0.0029604783873,0.00197674518784,0.000987783575805,0.0039457110878,0.00394813930945,0.00592262021466,0.00394953780159,0.00691033484789,0.00197417747771,0.00197379709105,0.0,0.00395059518831,0.0,0.00197502843753,0.00592739408722,0.00295981541625,0.00493513004564,0.00197140374151,0.00296065354954,0.00197618242402,0.00394603135011,0.0,0.00394863553567,0.00197177330579,0.00296188128856,0.00197234729281,0.000988009643322,0.00395129944474,0.0,0.00197572828484,0.00690603395347,0.00197349807267,0.000986315339434,0.00197393577786,0.0,0.00197502843753,0.00394307964587,0.00394403281706,0.000987659318837,0.0,0.000987944709035,0.000984736875107,0.000987944709035,0.0009888946736,0.0,0.00296328298733,0.0,0.00296173538683,0.00197415262632,0.000986137772218,0.0,0.0,0.00197493905268,0.00197384438887,0.000988009643322,0.0,0.000986201904847,0.000987733873018,0.00098629048804,0.0,0.0,0.00197453862458,0.00197431135457,0.0,0.0,0.0,0.000983908762537,0.0,0.0009888946736,0.0,0.0,0.000984219404958,0.0,0.0,0.0,0.000986455629559,0.0,0.0,0.0,0.0,0.000986137772218,0.0,0.000987862138276,0.0,0.0,0.0,0.0,0.0,0.0,0.000988172780696,0.000986315339434,0.0,0.0,0.0,0.0,0.0,0.000986201904847,0.0,0.000986201904847,0.0,0.0,0.0,0.0,0.0,0.000984219404958,0.0,0.0,0.0,0.0,0.0,0.000988572807969,0.0,0.0,0.0,0.000983908762537,0.000988172780696,0.000984219404958,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000988572807969,0.0,0.0,0.0,0.000987862138276,0.00197733280305,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000986201904847,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000988009643322,0.0,0.0,0.0,0.0,0.0,0.0,0.000987862138276,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00098542870584,0.000984736875107,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000987733873018,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00197423479625,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000986455629559,0.0,0.0,0.0,0.000986794330005,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000985767807115,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_16 y10_M_16_weights = numpy.array([0.0579738251312,0.0524401125933,0.0557049885866,0.047141025882,0.0489022400081,0.0536928640651,0.0398258815458,0.0438615457914,0.0378088396447,0.0436039935325,0.0410906883999,0.0342798695571,0.0307457740316,0.0325187434558,0.0284896930657,0.0312548688632,0.0310005535125,0.0277303240172,0.0289885450236,0.0304943394892,0.0254625357668,0.0236979767022,0.0247066356915,0.0264713307942,0.020918412868,0.026716247508,0.0209236063251,0.0206708834212,0.0231883937337,0.0201655856549,0.0168901026857,0.0206731080453,0.0163820521471,0.018900034592,0.0216771217313,0.0153808352458,0.0143694995055,0.0153788586912,0.0131036323539,0.0123537939793,0.0161325381435,0.013612775199,0.0118477840132,0.00983200646685,0.0120968258844,0.00983117023224,0.0100861457682,0.0133574355609,0.00983115422775,0.00932573242665,0.00983225453645,0.00730921067149,0.010080132081,0.00983395901466,0.0108372925098,0.00730954676579,0.00680728185039,0.00680594547545,0.0063013479056,0.00882362355503,0.00655538717884,0.00730796232125,0.00832048639492,0.00680847018378,0.00378152134329,0.00630092378661,0.00479010791225,0.00554646011435,0.00529225679509,0.00453600462105,0.00655315055133,0.00554567589433,0.00428743888347,0.00403551620406,0.00453540845379,0.00579891094193,0.00428544632444,0.00353282396878,0.00352949823571,0.00504123036714,0.00504261475554,0.00328053198576,0.00428740687449,0.00327783522916,0.00327776080828,0.00252208839689,0.00478931568998,0.00302545442122,0.00277190408516,0.00302551723885,0.00176495917679,0.00327611154556,0.00151202581383,0.00403480400425,0.00201646613956,0.00352800181587,0.00277298558859,0.00151137083006,0.0015117833458,0.00226871331,0.0020173879982,0.0,0.00176508961338,0.00201801577432,0.0030246113847,0.00277238221931,0.00100844532933,0.00100958564926,0.00151376790259,0.000755759635856,0.000756258175726,0.00151353463714,0.00277197450492,0.00176496757915,0.00176478632829,0.000252186593448,0.00277326446683,0.00075814630546,0.00151327616463,0.000504275879596,0.00201614124841,0.000755868066277,0.00126026197899,0.00176480393323,0.0017639508939,0.0012615911519,0.00100844292866,0.00201611564122,0.000252125056183,0.000503813349828,0.000503602890782,0.000757409698797,0.00100762709977,0.00125993628761,0.00151250114719,0.000755988099954,0.000756714303697,0.00050462077636,0.000755467954022,0.00100841252013,0.00100844132821,0.000252324632176,0.000756199359224,0.00126092656544,0.000503385629827,0.000252086205283,0.00126248660313,0.0,0.00100901829008,0.00126069810135,0.000756703100554,0.000755848060664,0.0,0.000251770956837,0.000252186593448,0.000252089806293,0.000504636380738,0.000252186593448,0.00025161467299,0.000504535952562,0.00126039441614,0.00100813724289,0.000251550334939,0.0,0.00125998550142,0.0,0.0,0.0,0.000252220482956,0.000252449667256,0.0,0.000504361103506,0.00025164472142,0.000755339117875,0.000504220664104,0.0,0.000504199458155,0.0,0.000504131038959,0.000252089806293,0.000756244972022,0.000252186593448,0.000504135040082,0.0,0.0,0.0,0.000251958169361,0.0,0.000252082364206,0.0,0.000252449667256,0.000251550334939,0.0,0.0,0.0,0.000252305666855,0.000252324632176,0.000252358441662,0.0,0.000252186593448,0.0,0.0,0.0,0.000252186593448,0.0,0.000252358441662,0.0,0.0,0.000252048674754,0.00025201786611,0.0,0.0,0.0,0.0,0.000504233467697,0.0,0.0,0.0,0.000252147782559,0.0,0.000252147782559,0.0,0.0,0.0,0.0,0.000252082364206,0.000252086205283,0.000251938723906,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000251958169361,0.0,0.000252086205283,0.0,0.0,0.0,0.0,0.000251550334939,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00025164472142,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000252086205283,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000251958169361,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_17 y10_M_17_weights = numpy.array([0.0183245975829,0.0197573929883,0.0183171997235,0.0134567261532,0.01690471844,0.016883924457,0.0157320877532,0.0166074544565,0.0148904412925,0.012317065926,0.0123264232184,0.0154487797314,0.0146004252118,0.0137320964719,0.0128861512552,0.0117382134232,0.0102988499183,0.0100325369788,0.00801447692591,0.0120235208664,0.0140204130444,0.00915378825406,0.0108819811831,0.0102913320937,0.006300566864,0.00715156061991,0.00773896664773,0.00802672338226,0.00572244714909,0.00887261661406,0.00572153541291,0.0103157050411,0.0068698091477,0.00772748896892,0.00773180971867,0.00659075689443,0.00515373471208,0.0065848336084,0.00401117332436,0.00458455740958,0.00686360594266,0.00486498426509,0.00602059287745,0.00286499498325,0.00401044653466,0.00485900899409,0.00516236521475,0.00487481642005,0.0028644311464,0.00315261175827,0.00286279861879,0.0037204214565,0.00458089946804,0.00257605559093,0.00286442114929,0.00401287783114,0.00257502288975,0.00257636850039,0.00400715348754,0.00143458588732,0.00401077543949,0.00314911876901,0.00314800009271,0.00229807102872,0.00200662936046,0.00171773395542,0.00171850173326,0.00371889089939,0.00228885869441,0.00286379233125,0.00200857079869,0.00314983456189,0.00200309338364,0.00343923781998,0.00343848403809,0.00257066215158,0.00143366615346,0.0020008150429,0.00143226056018,0.000859453607962,0.00143576954482,0.00200299341256,0.000859006737269,0.00114064794139,0.000858312538143,0.000861499415986,0.00143017616332,0.00172170280699,0.00171206959446,0.000571036164615,0.000861228294438,0.00171773895397,0.000859073517945,0.00114537857253,0.00171616041074,0.0014330823224,0.000572765464224,0.00143236652952,0.000572889728267,0.00229121601229,0.000286183789678,0.0,0.000286315251638,0.00143259246414,0.00057085571683,0.00114449082941,0.0,0.000858161581824,0.000858431403748,0.00114296627056,0.000573262620367,0.000284774897356,0.000570390551431,0.000857390105059,0.00143584852197,0.000855988110741,0.00114741898212,0.000286315251638,0.000573138356324,0.000573006994335,0.0,0.0,0.000857664625623,0.00143159875168,0.000861216697794,0.0,0.000570257489933,0.000860979166526,0.000573273417243,0.000571981191162,0.000284909558391,0.000286823104686,0.000571903713581,0.0008584688929,0.000287128716254,0.000575049103429,0.0,0.000287772729901,0.0,0.000284468985875,0.000572313195093,0.0,0.000287128716254,0.0,0.000286450312557,0.0,0.000571619095938,0.000286315251638,0.0,0.000287128716254,0.000283567346774,0.000573460163206,0.00057408798154,0.0,0.0,0.000287128716254,0.0,0.0,0.000286450312557,0.0,0.0,0.0,0.00028643941571,0.0,0.000283567346774,0.000286315251638,0.000287131815357,0.0,0.0,0.0,0.000287276373527,0.0,0.0,0.0,0.0,0.000287772729901,0.000284540465192,0.0,0.000572765464224,0.000287128716254,0.0,0.000287276373527,0.000284909558391,0.0,0.0,0.000286315251638,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.000284909558391,0.0,0.00028395763384,0.0,0.0,0.0,0.000286450312557,0.000287276373527,0.000286183789678,0.0,0.00028643941571,0.0,0.0,0.000284468985875,0.0,0.000283567346774,0.0,0.0,0.0,0.0,0.000284468985875,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.00028643941571,0.0,0.0,0.0,0.0,0.0,0.00028395763384,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_18 y10_M_18_weights = numpy.array([0.00164151478952,0.00181289759307,0.00157685087401,0.00142433323368,0.00125269017185,0.00120972115213,0.00118784436891,0.00144583660284,0.00133891403441,0.00107993524976,0.00103641009035,0.00114332427687,0.00127450744351,0.00107952327892,0.00118815156588,0.000993640560067,0.00105868417607,0.000820743145516,0.000907341260324,0.000885826994683,0.000799209601483,0.000907328268365,0.000840861404167,0.000950319919246,0.000475196001833,0.000367572621971,0.000710815243517,0.000518339365272,0.000756132455127,0.000626546042201,0.000367378119766,0.000604778223805,0.00077737682329,0.000496791571994,0.000669716646846,0.00053989093041,0.000496649917727,0.000540121432915,0.000602761117337,0.000259030375304,0.000367284200473,0.000367036976058,0.000648211182209,0.000324148967485,0.000259253627458,0.00021590683508,0.000388786521893,0.000367299329819,0.000345796547393,0.000323894073624,0.000280649372902,0.000302366690295,0.000259149649873,0.00034559362137,0.000451869986501,0.000323903209905,0.000259173119219,0.000280740651894,0.000302476660945,0.000345612145389,0.000322548148542,0.000302260365776,0.000259346666651,0.000215998197891,0.000345740095234,0.000259159079521,0.000280719110387,0.000237603155791,0.000172751192144,0.000237574699209,0.000216138133867,0.00032381218237,0.000171237586966,0.000194366124515,0.000215887933875,0.000194487536471,0.000172721101089,8.64686562196e-05,0.000214293862368,0.000216087549044,0.000259332333586,0.000107866203774,0.000129464498056,0.000172686274256,0.000151284871024,0.000129656443778,6.4752554203e-05,0.000108008025679,0.000172827551337,0.000107987196634,0.000172853241889,0.000129592447901,0.00017282633596,0.00025934578655,6.48493233457e-05,6.48335234467e-05,0.000129618515639,0.000108059448692,8.65591808398e-05,6.48711582193e-05,6.47415739019e-05,6.47861237497e-05,6.48378820395e-05,0.000129600787901,0.000107990214122,0.0,0.000129626604181,0.00010795153161,6.48155023417e-05,4.32340556977e-05,0.0,0.000151264712532,6.48255606329e-05,0.000107884560155,8.63938476793e-05,0.000108009366784,0.000194459750442,4.33305314735e-05,8.64548260693e-05,6.4705070687e-05,2.16093751657e-05,4.32496879586e-05,8.63901596392e-05,4.31353168064e-05,6.47695275693e-05,6.48655004306e-05,4.32362769037e-05,6.48877543997e-05,4.32011147943e-05,2.16179959594e-05,2.15556597001e-05,0.000107804387193,8.63847113982e-05,6.48861618369e-05,2.16093751657e-05,6.48234651555e-05,6.48794563095e-05,0.000151358841373,0.0,0.0,0.0,2.1559456705e-05,4.32023720807e-05,0.0,2.16403295567e-05,2.16179959594e-05,4.31768072574e-05,2.15937470959e-05,6.47352455604e-05,2.1559456705e-05,2.16751857264e-05,0.0,4.31850215285e-05,2.15912660507e-05,4.31172118824e-05,8.63752817502e-05,2.16093751657e-05,4.31242945957e-05,0.0,2.16292025721e-05,4.31688444436e-05,0.0,2.15827542218e-05,0.0,2.16751857264e-05,0.0,2.15977871761e-05,0.0,2.16257659893e-05,2.15556597001e-05,0.0,0.0,0.0,6.48019236487e-05,4.31541341928e-05,0.0,0.0,2.16179959594e-05,2.16553289833e-05,2.15983655279e-05,0.0,0.0,0.0,0.0,4.32204350952e-05,2.15933950557e-05,2.16751857264e-05,2.16403295567e-05,0.0,0.0,0.0,0.0,0.0,2.16751857264e-05,0.0,0.0,0.0,0.0,0.0,2.15940320808e-05,0.0,0.0,0.0,0.0,2.15933950557e-05,0.0,0.0,2.15789823627e-05,0.0,0.0,2.16086166029e-05,2.16751857264e-05,0.0,0.0,0.0,2.16093751657e-05,0.0,0.0,0.0,0.0,0.0,2.16142031454e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,6.46766560145e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.16292025721e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.32315830345e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.15259500227e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.15789823627e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.15827542218e-05,0.0,0.0,2.15827542218e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.15789823627e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating weights for histo: y10_M_19 y10_M_19_weights = numpy.array([0.000198600128315,5.59145952508e-05,0.000170155435845,0.000141986005013,5.68463094188e-05,0.000113420460538,8.52347705897e-05,0.000113597543842,0.000141884589705,2.84292648704e-05,8.47386225498e-05,8.4767547443e-05,8.52254902723e-05,0.000142025799014,8.52862800633e-05,0.00011367298911,5.68266796915e-05,5.68781743166e-05,2.83684899279e-05,0.0,2.81091458905e-05,0.00016967983814,0.000113345475574,0.000140514428798,8.51264507252e-05,5.67791347695e-05,0.000142092973663,2.84489094462e-05,2.6750626214e-05,2.84292648704e-05,0.000141837208116,8.51662447262e-05,0.000113662506064,0.000142071799691,5.66865988688e-05,2.84292648704e-05,2.83498698991e-05,0.000113526404641,5.65598965517e-05,8.51054549352e-05,2.83973999726e-05,5.66138114835e-05,0.0,8.52544151655e-05,5.68266796915e-05,2.84080908982e-05,0.0,0.0,2.84080908982e-05,5.67765808261e-05,5.67658899005e-05,0.0,8.36089035301e-05,8.51872256677e-05,0.0,8.51343798284e-05,2.83973999726e-05,8.52147993467e-05,5.68266796915e-05,5.67791347695e-05,2.75171952782e-05,2.83973999726e-05,2.83684899279e-05,2.83973999726e-05,0.0,0.0,2.84489094462e-05,0.0,0.0,0.0,0.0,5.68266796915e-05,5.67472698717e-05,2.84292648704e-05,2.84292648704e-05,0.0,5.67977547983e-05,5.68373706171e-05,2.84292648704e-05,2.84489094462e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.84489094462e-05,2.83498698991e-05,0.0,5.67948147937e-05,2.84489094462e-05,0.0,0.0,5.68570003444e-05,0.0,0.0,8.51313804298e-05,0.0,0.0,0.0,2.83684899279e-05,5.67472698717e-05,2.84292648704e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.66287936279e-05,0.0,2.84292648704e-05,0.0,0.0,2.84489094462e-05,2.83498698991e-05,2.84080908982e-05,0.0,0.0,2.84489094462e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.68173993741e-05,0.0,0.0,0.0,0.0,0.0,0.0,2.84489094462e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.79727326493e-05,0.0,5.68266796915e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.83684899279e-05,0.0,0.0,2.83498698991e-05,0.0,2.81624965791e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.84292648704e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.83498698991e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.83684899279e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]) # Creating a new Canvas fig = plt.figure(figsize=(12,6),dpi=80) frame = gridspec.GridSpec(1,1,right=0.7) pad = fig.add_subplot(frame[0]) # Creating a new Stack pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights+y10_M_17_weights+y10_M_18_weights+y10_M_19_weights,\ label="$bg\_vbf\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights+y10_M_17_weights+y10_M_18_weights,\ label="$bg\_vbf\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#c1bfa8", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights+y10_M_17_weights,\ label="$bg\_vbf\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#bab5a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights,\ label="$bg\_vbf\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b2a596", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights,\ label="$bg\_vbf\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b7a39b", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights,\ label="$bg\_vbf\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ad998c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights,\ label="$bg\_vbf\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#9b8e82", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights,\ label="$bg\_vbf\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#876656", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights,\ label="$bg\_dip\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#afcec6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights,\ label="$bg\_dip\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#84c1a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights,\ label="$bg\_dip\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#89a8a0", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights,\ label="$bg\_dip\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#829e8c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights,\ label="$bg\_dip\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#adbcc6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights,\ label="$bg\_dip\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7a8e99", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights,\ label="$bg\_dip\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#758991", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights,\ label="$bg\_dip\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#688296", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights,\ label="$signal\_2pt4TeVL$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#6d7a84", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights+y10_M_2_weights,\ label="$signal\_2pt2TeVL$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7c99d1", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights+y10_M_1_weights,\ label="$signal\_2TeVL$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7f7f9b", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y10_M_0_weights,\ label="$signal\_1pt8TeVL$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#aaa5bf", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") # Axis plt.rc('text',usetex=False) plt.xlabel(r"M [ a_{1} , a_{2} ] ( GeV ) ",\ fontsize=16,color="black") plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 40.0\ \mathrm{fb}^{-1})$ ",\ fontsize=16,color="black") # Boundary of y-axis ymax=(y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights+y10_M_17_weights+y10_M_18_weights+y10_M_19_weights).max()*1.1 ymin=0 # linear scale #ymin=min([x for x in (y10_M_0_weights+y10_M_1_weights+y10_M_2_weights+y10_M_3_weights+y10_M_4_weights+y10_M_5_weights+y10_M_6_weights+y10_M_7_weights+y10_M_8_weights+y10_M_9_weights+y10_M_10_weights+y10_M_11_weights+y10_M_12_weights+y10_M_13_weights+y10_M_14_weights+y10_M_15_weights+y10_M_16_weights+y10_M_17_weights+y10_M_18_weights+y10_M_19_weights) if x])/100. # log scale plt.gca().set_ylim(ymin,ymax) # Log/Linear scale for X-axis plt.gca().set_xscale("linear") #plt.gca().set_xscale("log",nonposx="clip") # Log/Linear scale for Y-axis plt.gca().set_yscale("linear") #plt.gca().set_yscale("log",nonposy="clip") # Legend plt.legend(bbox_to_anchor=(1.05,1), loc=2, borderaxespad=0.) # Saving the image plt.savefig('../../HTML/MadAnalysis5job_0/selection_9.png') plt.savefig('../../PDF/MadAnalysis5job_0/selection_9.png') plt.savefig('../../DVI/MadAnalysis5job_0/selection_9.eps') # Running! if __name__ == '__main__': selection_9()
397.761468
6,505
0.763009
19,136
86,712
3.408393
0.140364
0.298238
0.429787
0.550603
0.366634
0.29439
0.291278
0.271576
0.268847
0.260062
0
0.679501
0.021773
86,712
217
6,506
399.59447
0.08942
0.016664
0
0.171875
0
0.007813
0.013904
0.002347
0
0
0
0
0
1
0.007813
false
0
0.03125
0
0.039063
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
67d3f3d6518861c5c5eb453be69a462917aa1fab
2,924
py
Python
simple_rest_client/request.py
cfytrok/python-simple-rest-client
4896e8226ffe194625c63773ea6f49531293b308
[ "MIT" ]
null
null
null
simple_rest_client/request.py
cfytrok/python-simple-rest-client
4896e8226ffe194625c63773ea6f49531293b308
[ "MIT" ]
null
null
null
simple_rest_client/request.py
cfytrok/python-simple-rest-client
4896e8226ffe194625c63773ea6f49531293b308
[ "MIT" ]
null
null
null
import logging from .decorators import handle_async_request_error, handle_request_error from .models import Response logger = logging.getLogger(__name__) @handle_request_error def make_request(client, request): logger.debug("operation=request_started, request=%r", request) method = request.method client_method = getattr(client, method.lower()) client_options = { "params": request.params, "headers": request.headers, "timeout": request.timeout, "verify": request.ssl_verify, **request.kwargs, } if method.lower() in ("post", "put", "patch"): if request.headers.get("Content-Type") == "application/json": client_options["json"] = request.body else: client_options["data"] = request.body client_response = client_method(request.url, **client_options) content_type = client_response.headers.get("Content-Type", "") if "text" in content_type: body = client_response.text elif "json" in content_type: body = client_response.text if body: body = client_response.json() else: body = client_response.content response = Response( url=str(client_response.url), method=method, body=body, headers=client_response.headers, status_code=client_response.status_code, client_response=client_response, ) logger.debug("operation=request_finished, request=%r, response=%r", request, response) return response @handle_async_request_error async def make_async_request(client, request): logger.debug("operation=request_started, request=%r", request) method = request.method client_method = getattr(client, method.lower()) client_options = { "params": request.params, "headers": request.headers, "timeout": request.timeout, "verify": request.ssl_verify, **request.kwargs, } if method.lower() in ("post", "put", "patch"): if request.headers.get("Content-Type") == "application/json": client_options["json"] = request.body else: client_options["data"] = request.body client_response = await client_method(request.url, **client_options) content_type = client_response.headers.get("Content-Type", "") if "text" in content_type: body = client_response.text elif "json" in content_type: body = client_response.text if body: body = client_response.json() else: body = client_response.content response = Response( url=str(client_response.url), method=method, body=body, headers=client_response.headers, status_code=client_response.status_code, client_response=client_response, ) logger.debug("operation=request_finished, request=%r, response=%r", request, response) return response
33.609195
90
0.657661
326
2,924
5.693252
0.159509
0.165948
0.096983
0.05819
0.895474
0.895474
0.895474
0.895474
0.895474
0.895474
0
0
0.229822
2,924
86
91
34
0.824156
0
0
0.820513
0
0
0.124487
0.036252
0
0
0
0
0
1
0.012821
false
0
0.038462
0
0.076923
0
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
67de1d750ff785993f607f50c13fa0377406a71d
1,350
py
Python
MascotasPasto/mascotas/models.py
FabianBedoya/Frameworks-7a-2020B
0828dd00cd05626216b856ca6060da70bb773986
[ "MIT" ]
null
null
null
MascotasPasto/mascotas/models.py
FabianBedoya/Frameworks-7a-2020B
0828dd00cd05626216b856ca6060da70bb773986
[ "MIT" ]
null
null
null
MascotasPasto/mascotas/models.py
FabianBedoya/Frameworks-7a-2020B
0828dd00cd05626216b856ca6060da70bb773986
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class Tipos(models.Model) : codigo = models.CharField(max_length=20) nombre = models.CharField(max_length=20) abreviatura = models.CharField(max_length=5) estado = models.BooleanField(default=True) fecha_creacion = models.DateTimeField('Date creatio') fecha_modificacion = models.DateTimeField('Date update') class Razas(models.Model) : codigo = models.CharField(max_length=20) nombre = models.CharField(max_length=20) abreviatura = models.CharField(max_length=5) id_tipo = models.ForeignKey(Tipos, null = True, blank = True, on_delete = models.CASCADE) estado = models.BooleanField(default=True) fecha_creacion = models.DateTimeField('Date creatio') fecha_modificacion = models.DateTimeField('Date update') class Mascotas(models.Model) : codigo = models.CharField(max_length=20) id_tipo = models.ForeignKey(Tipos, null = True, blank = True, on_delete = models.CASCADE) id_raza = models.ForeignKey(Razas, null = True, blank = True, on_delete = models.CASCADE) nombre = models.CharField(max_length=25) tiene_vacunas = models.BooleanField(default=True) estado = models.BooleanField(default=True) fecha_creacion = models.DateTimeField('Date creatio') fecha_modificacion = models.DateTimeField('Date update')
46.551724
93
0.742963
165
1,350
5.951515
0.266667
0.1222
0.14664
0.195519
0.860489
0.829939
0.829939
0.829939
0.747454
0.747454
0
0.012206
0.15037
1,350
29
94
46.551724
0.843941
0.017778
0
0.72
0
0
0.052075
0
0
0
0
0
0
1
0
false
0
0.04
0
1
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
9
67e67a298cf11f047dba57c0c695cecc10ac1fa0
7,562
gyp
Python
chrome/browser/resources/md_extensions/compiled_resources2.gyp
xzhan96/chromium.src
1bd0cf3997f947746c0fc5406a2466e7b5f6159e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2021-01-07T18:51:03.000Z
2021-01-07T18:51:03.000Z
chrome/browser/resources/md_extensions/compiled_resources2.gyp
emilio/chromium.src
1bd0cf3997f947746c0fc5406a2466e7b5f6159e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/resources/md_extensions/compiled_resources2.gyp
emilio/chromium.src
1bd0cf3997f947746c0fc5406a2466e7b5f6159e
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'animation_helper', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'code_section', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(EXTERNS_GYP):developer_private', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'detail_view', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/neon-animation/compiled_resources2.gyp:neon-animatable-behavior-extracted', '<(EXTERNS_GYP):developer_private', 'animation_helper', 'item', 'item_source', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'drop_overlay', 'dependencies': [ '<(DEPTH)/chrome/browser/resources/extensions/compiled_resources2.gyp:drag_and_drop_handler', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:drag_wrapper', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'error_page', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/neon-animation/compiled_resources2.gyp:neon-animatable-behavior-extracted', '<(EXTERNS_GYP):developer_private', 'animation_helper', 'code_section', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'extensions', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', 'manager', 'service', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'item', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(EXTERNS_GYP):developer_private', 'item_source', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'item_list', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/neon-animation/compiled_resources2.gyp:neon-animatable-behavior-extracted', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-resizable-behavior/compiled_resources2.gyp:iron-resizable-behavior-extracted', '<(EXTERNS_GYP):developer_private', 'animation_helper', 'item', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'item_source', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(EXTERNS_GYP):developer_private', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'keyboard_shortcuts', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/neon-animation/compiled_resources2.gyp:neon-animatable-behavior-extracted', '<(EXTERNS_GYP):developer_private', 'animation_helper', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'manager', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(EXTERNS_GYP):developer_private', 'animation_helper', 'detail_view', 'item', 'item_list', 'keyboard_shortcuts', 'sidebar', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'options_dialog', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(EXTERNS_GYP):developer_private', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'pack_dialog', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'service', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(EXTERNS_GYP):developer_private', '<(EXTERNS_GYP):management', 'error_page', 'item', 'manager', 'pack_dialog', 'sidebar', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'shortcut_input', 'dependencies': [ '<(DEPTH)/chrome/browser/resources/extensions/compiled_resources2.gyp:shortcut_util', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(EXTERNS_GYP):developer_private', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, { 'target_name': 'sidebar', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], }, ] }
41.097826
146
0.628008
790
7,562
5.775949
0.120253
0.18146
0.211703
0.179487
0.887136
0.883191
0.874206
0.874206
0.854482
0.809336
0
0.014304
0.186459
7,562
183
147
41.322404
0.727406
0.020497
0
0.644444
0
0.027778
0.730109
0.608537
0
0
0
0
0.066667
1
0
true
0
0
0
0
0
0
0
0
null
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
11
db1ae9c852d3517a6d295afea5ad93f7baef0d56
3,948
py
Python
test/test_init_thrs_multiplier.py
WoojunePark/LQ-Nets
2f80fb9afe5ad866ccb93ffd1814b58ff0e565d7
[ "MIT" ]
2
2020-03-27T03:56:06.000Z
2020-03-30T01:51:41.000Z
test/test_init_thrs_multiplier.py
WoojunePark/LQ-Nets
2f80fb9afe5ad866ccb93ffd1814b58ff0e565d7
[ "MIT" ]
null
null
null
test/test_init_thrs_multiplier.py
WoojunePark/LQ-Nets
2f80fb9afe5ad866ccb93ffd1814b58ff0e565d7
[ "MIT" ]
1
2020-08-27T15:56:26.000Z
2020-08-27T15:56:26.000Z
nbit = 3 num_levels = 2 ** nbit # initialize threshold multiplier init_thrs_multiplier = [] for i in range(1, num_levels): thrs_multiplier_i = [0. for j in range(num_levels)] print(f'for i={i}, initial thrs_multiplier_i is {thrs_multiplier_i}') thrs_multiplier_i[i - 1] = 0.5 print(f'for i={i}, initial thrs_multiplier_i[i-1] is {thrs_multiplier_i[i - 1]}') thrs_multiplier_i[i] = 0.5 print(f'for i={i}, initial thrs_multiplier_i[i] is {thrs_multiplier_i[i]}') init_thrs_multiplier.append(thrs_multiplier_i) print(f'current init_thrs_multiplier is {init_thrs_multiplier}') print('----------------') print(f'final init_thrs_multiplier is {init_thrs_multiplier}') # C:\ProgramData\Anaconda3\python.exe D:/GitHub/LQ-Nets/test/test_init_thrs_multiplier.py # for i=1, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=1, initial thrs_multiplier_i[i-1] is 0.5 # for i=1, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]] # ---------------- # for i=2, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=2, initial thrs_multiplier_i[i-1] is 0.5 # for i=2, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0]] # ---------------- # for i=3, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=3, initial thrs_multiplier_i[i-1] is 0.5 # for i=3, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0]] # ---------------- # for i=4, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=4, initial thrs_multiplier_i[i-1] is 0.5 # for i=4, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0]] # ---------------- # for i=5, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=5, initial thrs_multiplier_i[i-1] is 0.5 # for i=5, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0]] # ---------------- # for i=6, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=6, initial thrs_multiplier_i[i-1] is 0.5 # for i=6, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0]] # ---------------- # for i=7, initial thrs_multiplier_i is [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] # for i=7, initial thrs_multiplier_i[i-1] is 0.5 # for i=7, initial thrs_multiplier_i[i] is 0.5 # current init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5]] # ---------------- # final init_thrs_multiplier is [[0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.5]] # # Process finished with exit code 0
69.263158
328
0.556991
1,065
3,948
1.974648
0.041315
0.493581
0.68331
0.8369
0.8602
0.820257
0.819306
0.779363
0.775559
0.757014
0
0.223732
0.161094
3,948
57
329
69.263158
0.411232
0.81079
0
0
0
0
0.448373
0.12447
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
0
0
1
null
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
14
db2e57c781bbf3e9b380a21e47b704f485363df6
2,447
py
Python
hw3/plot_ac.py
hatim-ez/berkeley-cs294-deep-rl
8ffd415e8140b18f9456bc8560a099e98456bf05
[ "MIT" ]
3
2018-11-17T10:32:53.000Z
2019-04-28T02:23:53.000Z
hw3/plot_ac.py
hatim-ez/berkeley-cs294-deep-rl
8ffd415e8140b18f9456bc8560a099e98456bf05
[ "MIT" ]
null
null
null
hw3/plot_ac.py
hatim-ez/berkeley-cs294-deep-rl
8ffd415e8140b18f9456bc8560a099e98456bf05
[ "MIT" ]
null
null
null
from pylab import * import os from os.path import join dirnames = os.listdir("data") fig, ax = plt.subplots(figsize=(25,20)) ax.set_title("Finding best target update per gradient steps ratio for actor-critic on cartpole") ax.set_xlabel("Iteration") ax.set_ylabel("Average return") for dirname in dirnames: if not ("CartPole" in dirname) or dirname == "ac_1_1_CartPole-v0_10-10-2018_20-40-20": continue print(dirname) experiments = {} for subdirname in os.listdir(os.path.join("data", dirname)): experiments[subdirname] = np.genfromtxt(join("data", dirname, subdirname, 'log.txt'), delimiter='\t', dtype=None, names=True) for key, data in experiments.items(): errorbar(data['Iteration'], data['AverageReturn'], np.sqrt(data['StdReturn']), label=dirname[3:8] + "_{}".format(key)) ax.legend(prop={'size': 10}).draggable() plt.savefig("figs/ac_update_settings_comparison.png") #plt.show() fig, ax = plt.subplots(figsize=(25,20)) ax.set_title("AC results on Inverted Pendulum for ntu=10, ngsptu=10") ax.set_xlabel("Iteration") ax.set_ylabel("Average return") for dirname in dirnames: if not ("InvertedPendulum" in dirname): continue print(dirname) experiments = {} for subdirname in os.listdir(os.path.join("data", dirname)): experiments[subdirname] = np.genfromtxt(join("data", dirname, subdirname, 'log.txt'), delimiter='\t', dtype=None, names=True) for key, data in experiments.items(): errorbar(data['Iteration'], data['AverageReturn'], np.sqrt(data['StdReturn']), label=dirname[3:8] + "_{}".format(key)) ax.legend(prop={'size': 10}).draggable() plt.savefig("figs/ac_inverted_pendulum_results.png") fig, ax = plt.subplots(figsize=(25,20)) ax.set_title("AC results on Inverted Pendulum for ntu=10, ngsptu=10") ax.set_xlabel("Iteration") ax.set_ylabel("Average return") for dirname in dirnames: if not ("HalfCheetah" in dirname): continue print(dirname) experiments = {} for subdirname in os.listdir(os.path.join("data", dirname)): experiments[subdirname] = np.genfromtxt(join("data", dirname, subdirname, 'log.txt'), delimiter='\t', dtype=None, names=True) for key, data in experiments.items(): errorbar(data['Iteration'], data['AverageReturn'], np.sqrt(data['StdReturn']), label=dirname[3:8] + "_{}".format(key)) ax.legend(prop={'size': 10}).draggable() plt.savefig("figs/ac_half_cheetah_results.png")
37.646154
133
0.69432
341
2,447
4.906158
0.26393
0.026898
0.053796
0.028691
0.824268
0.824268
0.824268
0.824268
0.824268
0.824268
0
0.023245
0.138537
2,447
65
134
37.646154
0.770398
0.004087
0
0.77551
0
0
0.247947
0.059524
0
0
0
0
0
1
0
false
0
0.061224
0
0.061224
0.061224
0
0
0
null
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
c0555c19a15e3f8a056a9fd7167774f00d47449b
39
py
Python
agent/src/agent/data_extractor/__init__.py
anodot/daria
d475899309f56cd85347be0f7001a0dd97dd197a
[ "Apache-2.0" ]
16
2019-04-03T08:31:54.000Z
2021-01-24T17:12:04.000Z
agent/src/agent/data_extractor/__init__.py
anodot/daria
d475899309f56cd85347be0f7001a0dd97dd197a
[ "Apache-2.0" ]
10
2020-01-20T14:59:06.000Z
2022-01-21T10:19:16.000Z
agent/src/agent/data_extractor/__init__.py
anodot/daria
d475899309f56cd85347be0f7001a0dd97dd197a
[ "Apache-2.0" ]
5
2021-01-08T19:23:03.000Z
2021-11-09T14:15:49.000Z
from . import cacti from . import snmp
13
19
0.74359
6
39
4.833333
0.666667
0.689655
0
0
0
0
0
0
0
0
0
0
0.205128
39
2
20
19.5
0.935484
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
7
2253e610a5c53ed127912c6dc911bef8e4e5f8cf
13,842
py
Python
planetary_systems/migrations/0001_initial.py
Neo1277/nasa-datasetcsv-django-mysql
7a66148080358685eb65c15ba89c9a7a8e811092
[ "MIT" ]
1
2021-03-03T00:14:04.000Z
2021-03-03T00:14:04.000Z
planetary_systems/migrations/0001_initial.py
Neo1277/nasa-datasetcsv-django-mysql
7a66148080358685eb65c15ba89c9a7a8e811092
[ "MIT" ]
null
null
null
planetary_systems/migrations/0001_initial.py
Neo1277/nasa-datasetcsv-django-mysql
7a66148080358685eb65c15ba89c9a7a8e811092
[ "MIT" ]
null
null
null
# Generated by Django 3.1.5 on 2021-01-14 03:22 from django.db import migrations, models import django.db.models.deletion import planetary_systems.models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='DiscoveryFacility', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=255)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ], ), migrations.CreateModel( name='DiscoveryMethod', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=255)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ], ), migrations.CreateModel( name='PlanetarySystem', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=255)), ('number_of_stars', models.PositiveSmallIntegerField()), ('number_of_planets', models.PositiveSmallIntegerField()), ('publication_reference', models.CharField(max_length=255)), ('right_ascension_sexagesimal', models.CharField(max_length=23)), ('right_ascension_decimal', models.DecimalField(decimal_places=10, max_digits=23)), ('declination_sexagesimal', models.CharField(max_length=23)), ('declination_decimal', models.DecimalField(decimal_places=10, max_digits=23)), ('distance', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('distance_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('distance_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_v_magnitude', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_v_magnitude_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_v_magnitude_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_ks_magnitude', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_ks_magnitude_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_ks_magnitude_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_gaia_magnitude', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_gaia_magnitude_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('brightness_gaia_magnitude_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ], ), migrations.CreateModel( name='SolutionType', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=255)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ], ), migrations.CreateModel( name='SpectralType', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=20)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ], ), migrations.CreateModel( name='Star', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('hd_name', models.CharField(help_text='Name of the star as given by the Henry Draper Catalog', max_length=255, null=True)), ('hip_name', models.CharField(help_text='Name of the star as given by the Hipparcos Catalog', max_length=255, null=True)), ('tic_id', models.CharField(help_text='Name of the star as given by the TESS Input Catalog', max_length=255, null=True)), ('gaia_id', models.CharField(help_text='Name of the star as given by the Gaia Catalog', max_length=255, null=True)), ('publication_reference', models.CharField(max_length=255)), ('effective_temperature', models.DecimalField(decimal_places=4, max_digits=10, null=True)), ('effective_temperature_err1', models.DecimalField(decimal_places=4, max_digits=10, null=True)), ('effective_temperature_err2', models.DecimalField(decimal_places=4, max_digits=10, null=True)), ('effective_temperature_limit', models.SmallIntegerField(null=True)), ('radius', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('radius_err1', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('radius_err2', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('radius_limit', models.SmallIntegerField(null=True)), ('mass', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('mass_err1', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('mass_err2', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('mass_limit', models.SmallIntegerField(null=True)), ('measurement', models.DecimalField(decimal_places=4, max_digits=7, null=True)), ('measurement_err1', models.DecimalField(decimal_places=4, max_digits=7, null=True)), ('measurement_err2', models.DecimalField(decimal_places=4, max_digits=7, null=True)), ('measurement_limit', models.SmallIntegerField(null=True)), ('metallicity_ratio', models.CharField(max_length=20, null=True)), ('surface_gravity', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('surface_gravity_err1', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('surface_gravity_err2', models.DecimalField(decimal_places=3, max_digits=7, null=True)), ('surface_gravity_limit', models.SmallIntegerField(null=True)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ('planetary_system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='star_planetary_system', to='planetary_systems.planetarysystem')), ('spectral_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='star_spectral_type', to='planetary_systems.spectraltype')), ], ), migrations.CreateModel( name='Planet', fields=[ ('id', planetary_systems.models.UnsignedAutoField(primary_key=True, serialize=False, unique=True)), ('name', models.CharField(max_length=255)), ('planet_letter', models.CharField(max_length=1)), ('explicit', models.BooleanField()), ('discovery_year', models.PositiveSmallIntegerField()), ('controversial_flag', models.BooleanField()), ('publication_reference', models.CharField(max_length=255)), ('orbital_period', models.DecimalField(decimal_places=10, max_digits=25, null=True)), ('orbital_period_err1', models.DecimalField(decimal_places=10, max_digits=25, null=True)), ('orbital_period_err2', models.DecimalField(decimal_places=10, max_digits=25, null=True)), ('orbital_period_limit', models.SmallIntegerField(null=True)), ('orbit_semi_major_axis', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('orbit_semi_major_axis_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('orbit_semi_major_axis_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('orbit_semi_major_axis_limit', models.SmallIntegerField(null=True)), ('earth_radius', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('earth_radius_err1', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('earth_radius_err2', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('earth_radius_limit', models.SmallIntegerField(null=True)), ('jupiter_radius', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('jupiter_radius_err1', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('jupiter_radius_err2', models.DecimalField(decimal_places=4, max_digits=9, null=True)), ('jupiter_radius_limit', models.SmallIntegerField(null=True)), ('earth_mass', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('earth_mass_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('earth_mass_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('earth_mass_limit', models.SmallIntegerField(null=True)), ('jupiter_mass', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('jupiter_mass_err1', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('jupiter_mass_err2', models.DecimalField(decimal_places=10, max_digits=23, null=True)), ('jupiter_mass_limit', models.SmallIntegerField(null=True)), ('mass_provenance', models.CharField(max_length=20, null=True)), ('eccentricity', models.DecimalField(decimal_places=10, max_digits=14, null=True)), ('eccentricity_err1', models.DecimalField(decimal_places=10, max_digits=14, null=True)), ('eccentricity_err2', models.DecimalField(decimal_places=10, max_digits=14, null=True)), ('eccentricity_limit', models.SmallIntegerField(null=True)), ('insolation_flux', models.DecimalField(decimal_places=3, max_digits=8, null=True)), ('insolation_flux_err1', models.DecimalField(decimal_places=3, max_digits=8, null=True)), ('insolation_flux_err2', models.DecimalField(decimal_places=3, max_digits=8, null=True)), ('insolation_flux_limit', models.SmallIntegerField(null=True)), ('equilibrium_temperature', models.SmallIntegerField(null=True)), ('equilibrium_temperature_err1', models.SmallIntegerField(null=True)), ('equilibrium_temperature_err2', models.SmallIntegerField(null=True)), ('equilibrium_temperature_limit', models.SmallIntegerField(null=True)), ('transit_timing_variations', models.BooleanField()), ('date_last_update', models.DateField()), ('reference_date_publication', models.CharField(max_length=25)), ('release_date', models.CharField(max_length=25)), ('row_created_on', models.DateTimeField(auto_now_add=True, help_text='Date and time when the register was created')), ('row_updated_on', models.DateTimeField(auto_now=True, help_text='Date and time when the register was updated')), ('discovery_facility', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='planet_discovery_facility', to='planetary_systems.discoveryfacility')), ('discovery_method', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='planet_discovery_method', to='planetary_systems.discoverymethod')), ('planetary_system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='planet_planetary_system', to='planetary_systems.planetarysystem')), ('solution_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='planet_solution_type', to='planetary_systems.solutiontype')), ], ), ]
78.647727
187
0.658648
1,547
13,842
5.641888
0.100194
0.068744
0.15181
0.188245
0.871104
0.848992
0.749083
0.725137
0.720555
0.708868
0
0.024761
0.215142
13,842
175
188
79.097143
0.778627
0.003251
0
0.339286
1
0
0.229721
0.077057
0
0
0
0
0
1
0
false
0
0.017857
0
0.041667
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
8
97d3e775aa23a35b1a9c70118ef82af1da68b459
116
py
Python
flaskexample/setting.py
hinowashi/InshightWebapp
e1eb89d14a403ee13788115e1600ebecb0089277
[ "MIT" ]
null
null
null
flaskexample/setting.py
hinowashi/InshightWebapp
e1eb89d14a403ee13788115e1600ebecb0089277
[ "MIT" ]
null
null
null
flaskexample/setting.py
hinowashi/InshightWebapp
e1eb89d14a403ee13788115e1600ebecb0089277
[ "MIT" ]
null
null
null
MAPBOX_ACCESS_KEY = 'pk.eyJ1IjoiaGlub3dhc2hpIiwiYSI6ImNrYmIxbnF5bDAwM2kyc2xjaXo2NDJ1YWkifQ.q3H1blv9u7mMl0H06niDeQ'
58
115
0.922414
6
116
17.5
1
0
0
0
0
0
0
0
0
0
0
0.142857
0.034483
116
1
116
116
0.794643
0
0
0
0
0
0.793103
0.793103
0
1
0
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
7
97e6f738c7ab7e9cf59befa44c92e2522d53621e
138
py
Python
discord/webhook/async_.py
kuzaku-developers/disnake
61cc1ad4c2bafd39726a1447c85f7e469e41af10
[ "MIT" ]
null
null
null
discord/webhook/async_.py
kuzaku-developers/disnake
61cc1ad4c2bafd39726a1447c85f7e469e41af10
[ "MIT" ]
null
null
null
discord/webhook/async_.py
kuzaku-developers/disnake
61cc1ad4c2bafd39726a1447c85f7e469e41af10
[ "MIT" ]
null
null
null
from disnake.webhook.async_ import * from disnake.webhook.async_ import __dict__ as __original_dict__ locals().update(__original_dict__)
27.6
64
0.84058
18
138
5.555556
0.555556
0.22
0.36
0.46
0.58
0
0
0
0
0
0
0
0.086957
138
4
65
34.5
0.793651
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
7
97f5fbbc04c072c891121d895a8eec72d115ab0c
6,464
py
Python
django_bleach/tests/test_forms.py
pegler/django-bleach
eb371ed9a032558d23ff04d8b707d5a30a2baa25
[ "MIT" ]
1
2021-01-05T17:30:56.000Z
2021-01-05T17:30:56.000Z
django_bleach/tests/test_forms.py
PhysicistSouravDas/django-bleach
0973e1ff79512fd63f103829b9bd3e24cedf493c
[ "MIT" ]
null
null
null
django_bleach/tests/test_forms.py
PhysicistSouravDas/django-bleach
0973e1ff79512fd63f103829b9bd3e24cedf493c
[ "MIT" ]
null
null
null
from django.test import TestCase from mock import patch from testproject.forms import BleachForm class TestBleachField(TestCase): def test_empty(self): """ Test no data """ form = BleachForm(data={}) form.is_valid() self.assertEqual(form.fields['no_tags'].to_python(None), None) self.assertEqual(form.fields['no_tags'].to_python(''), '') self.assertEqual(form.fields['no_tags'].to_python([]), []) self.assertEqual(form.fields['no_tags'].to_python({}), {}) def test_bleaching(self): """ Test values are bleached """ test_data = { 'no_tags': "<h1>Heading</h1>", 'no_strip': "<h1>Heading</h1>", 'bleach_strip': "<!-- script here -->" "<script>alert(\"Hello World\")</script>", 'bleach_attrs': "<a href=\"https://www.google.com\" " "target=\"_blank\">google.com</a>", 'bleach_styles': "<li style=\"color: white\">item</li>" } form = BleachForm(data=test_data) form.is_valid() self.assertEqual( form.cleaned_data['no_tags'], 'Heading' ) self.assertEqual( form.cleaned_data['no_strip'], '&lt;h1&gt;Heading&lt;/h1&gt;' ) self.assertEqual( form.cleaned_data['bleach_strip'], 'alert("Hello World")' ) self.assertEqual( form.cleaned_data['bleach_attrs'], '<a href="https://www.google.com">google.com</a>' ) self.assertNotEqual( form.cleaned_data['bleach_styles'], test_data['bleach_styles'] ) def test_tags(self): """ Test allowed tags are rendered""" test_data = { 'no_tags': "<p>No tags here</p>", 'no_strip': "No tags here", 'bleach_strip': "<ul><li>one</li><li>two</li></ul>", 'bleach_attrs': "<a href=\"https://www.google.com\" " "title=\"Google\">google.com</a>", 'bleach_styles': "<li style=\"color: white;\">item</li>" } form = BleachForm(data=test_data) form.is_valid() self.assertEqual(form.cleaned_data['no_tags'], "No tags here") self.assertEqual(form.cleaned_data['no_strip'], "No tags here") self.assertEqual( form.cleaned_data['bleach_strip'], test_data['bleach_strip'] ) self.assertEqual( form.cleaned_data['bleach_attrs'], test_data['bleach_attrs'] ) self.assertEqual( form.cleaned_data['bleach_styles'], test_data['bleach_styles'] ) def test_attrs(self): """ Test allowed attributes are rendered """ list_html = "<ul class=\"our-list\">" \ "<li class=\"list-item\">one</li>" \ "<li>two</li>" \ "</ul>" test_data = { 'no_strip': "", 'no_tags': list_html, 'bleach_strip': list_html, 'bleach_attrs': list_html, 'bleach_styles': list_html } form = BleachForm(data=test_data) form.is_valid() self.assertEqual(form.cleaned_data['no_tags'], 'onetwo') self.assertEqual( form.cleaned_data['bleach_strip'], '<ul><li>one</li><li>two</li></ul>' ) self.assertEqual( form.cleaned_data['bleach_attrs'], test_data['bleach_strip'] ) self.assertEqual( form.cleaned_data['bleach_styles'], '<ul><li>one</li><li>two</li></ul>' ) @patch('django_bleach.forms.settings', BLEACH_DEFAULT_WIDGET='testproject.forms.CustomBleachWidget') def test_custom_widget(self, settings): self.assertEqual( settings.BLEACH_DEFAULT_WIDGET, 'testproject.forms.CustomBleachWidget' ) test_data = { 'no_tags': "<h1>Heading</h1>", 'no_strip': "<h1>Heading</h1>", 'bleach_strip': "<!-- script here -->" "<script>alert(\"Hello World\")</script>", 'bleach_attrs': "<a href=\"http://www.google.com\" " "target=\"_blank\">google.com</a>", 'bleach_styles': "<li style=\"color: white\">item</li>" } form = BleachForm(data=test_data) form.is_valid() self.assertEqual( form.cleaned_data['no_tags'], 'Heading' ) self.assertEqual( form.cleaned_data['no_strip'], '&lt;h1&gt;Heading&lt;/h1&gt;' ) self.assertEqual( form.cleaned_data['bleach_strip'], 'alert("Hello World")' ) self.assertEqual( form.cleaned_data['bleach_attrs'], '<a>google.com</a>' ) self.assertNotEqual( form.cleaned_data['bleach_styles'], test_data['bleach_styles'] ) @patch('django_bleach.forms.settings', BLEACH_DEFAULT_WIDGET='testproject.forms.CustomBleachWidget') def test_custom_widget2(self, settings): self.assertEqual( settings.BLEACH_DEFAULT_WIDGET, 'testproject.forms.CustomBleachWidget' ) test_data = { 'no_tags': "<h1>Heading</h1>", 'no_strip': "<h1>Heading</h1>", 'bleach_strip': "<!-- script here -->" "<script>alert(\"Hello World\")</script>", 'bleach_attrs': "<a href=\"https://www.google.com\" " "target=\"_blank\">google.com</a>", 'bleach_styles': "<li style=\"color: white\">item</li>" } form = BleachForm(data=test_data) form.is_valid() self.assertEqual( form.cleaned_data['no_tags'], 'Heading' ) self.assertEqual( form.cleaned_data['no_strip'], '&lt;h1&gt;Heading&lt;/h1&gt;' ) self.assertEqual( form.cleaned_data['bleach_strip'], 'alert("Hello World")' ) self.assertEqual( form.cleaned_data['bleach_attrs'], '<a href="https://www.google.com">google.com</a>' ) self.assertNotEqual( form.cleaned_data['bleach_styles'], test_data['bleach_styles'] )
34.940541
72
0.519028
663
6,464
4.853695
0.116139
0.125855
0.147607
0.169671
0.861094
0.850528
0.846178
0.820075
0.767247
0.767247
0
0.004347
0.323793
6,464
184
73
35.130435
0.731869
0.016708
0
0.625
0
0
0.277839
0.060496
0
0
0
0
0.178571
1
0.035714
false
0
0.017857
0
0.059524
0
0
0
0
null
0
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
7
3f06fd82aa3c914bfd41ed43aa69e7830cc89363
735
py
Python
test.py
SUPERustam/Flask_pattern
a843ab09d5e4feff78e879054fe75e6b4e914bc2
[ "MIT" ]
1
2021-04-27T15:51:06.000Z
2021-04-27T15:51:06.000Z
test.py
SUPERustam/Flask_template
a843ab09d5e4feff78e879054fe75e6b4e914bc2
[ "MIT" ]
null
null
null
test.py
SUPERustam/Flask_template
a843ab09d5e4feff78e879054fe75e6b4e914bc2
[ "MIT" ]
null
null
null
from requests import get, post, delete print(get('http://localhost:5000/api/v2/news').json()) print(get('http://localhost:5000/api/v2/news/1').json()) print(get('http://localhost:5000/api/v2/news/999').json()) print(get('http://localhost:5000/api/v2/news/q').json()) print(post('http://localhost:5000/api/v2/news', json={'title': 'Заголовок'}).json()) print(post('http://localhost:5000/api/v2/news', json={'title': 'Заголовок', 'content': 'Текст новости', 'user_id': 1, 'is_private': False}).json()) print(delete('http://localhost:5000/api/v2/news/999').json()) # новости с id = 999 нет в базе print(delete('http://localhost:5000/api/v2/news/1').json())
30.625
61
0.613605
105
735
4.27619
0.295238
0.231626
0.302895
0.356347
0.783964
0.783964
0.783964
0.783964
0.507795
0.253898
0
0.083871
0.156463
735
23
62
31.956522
0.640323
0.039456
0
0.142857
0
0
0.487216
0
0
0
0
0
0
1
0
true
0
0.071429
0
0.071429
0.571429
0
0
0
null
1
1
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
8